@@ -9,11 +9,21 @@ import { projectPaths, readJson, writeJson } from '../lib/core.mjs';
99
1010const testDir = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
1111
12+ function providerExecutable ( paths ) {
13+ const source = path . join ( testDir , 'fixtures' , 'model-bundle-provider.mjs' ) ;
14+ if ( process . platform !== 'win32' ) return source ;
15+ const dir = path . join ( paths . base , 'test-bin' ) ; fs . mkdirSync ( dir , { recursive : true } ) ;
16+ const script = path . join ( dir , 'model-bundle-provider.mjs' ) ; fs . copyFileSync ( source , script ) ;
17+ const shim = path . join ( dir , 'model-bundle-provider.cmd' ) ;
18+ fs . writeFileSync ( shim , `@echo off\r\n"${ process . execPath } " "${ script } " %*\r\n` ) ;
19+ return shim ;
20+ }
21+
1222function fixture ( { missingPolicy = 'placeholder' } = { } ) {
1323 const root = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'docgen-bundle-' ) ) ; const paths = projectPaths ( root ) ;
1424 fs . mkdirSync ( path . join ( root , 'src' ) , { recursive : true } ) ; fs . writeFileSync ( path . join ( root , 'src' , 'Resource.java' ) , 'class Resource {}\n' ) ;
1525 fs . mkdirSync ( path . dirname ( paths . config ) , { recursive : true } ) ;
16- const provider = path . join ( testDir , 'fixtures' , 'model-bundle-provider.mjs' ) ;
26+ const provider = providerExecutable ( paths ) ;
1727 writeJson ( paths . project , { schemaVersion : '2.0' , kitVersion : '2.0.0' } ) ;
1828 writeJson ( paths . config , {
1929 schemaVersion : '2.0' , projectName : 'Bundle Fixture' ,
0 commit comments