@@ -138,7 +138,7 @@ export function findLatestServeD(force: boolean = false, channel?: string): Then
138
138
if ( channel == "frozen" && force )
139
139
channel = "stable" ;
140
140
141
- if ( channel == "frozen" )
141
+ if ( channel == "frozen" || config ( null ) . get ( "forceCompileServeD" , false ) )
142
142
return Promise . resolve ( undefined ) ;
143
143
144
144
if ( servedVersionCache . channel == channel )
@@ -340,7 +340,7 @@ export function updateAndInstallServeD(env: any): Thenable<boolean | undefined>
340
340
vscode . commands . executeCommand ( "workbench.action.openGlobalSettings" ) ;
341
341
return Promise . resolve ( undefined ) ;
342
342
} ) ;
343
- } else if ( ! version . asset ) {
343
+ } else if ( ! version . asset || config ( null ) . get ( "forceCompileServeD" , false ) ) {
344
344
return compileServeD ( "master" ) ( env ) ;
345
345
} else {
346
346
return installServeD ( [ { url : version . asset . browser_download_url , title : "Serve-D" } ] , version . name ) ( env ) ;
@@ -482,33 +482,33 @@ export function extractServedBuiltDate(log: string): Date | false {
482
482
}
483
483
484
484
export function compileServeD ( ref ?: string ) : ( env : NodeJS . ProcessEnv ) => Promise < boolean | undefined > {
485
- return ( env : any ) => new Promise < boolean | undefined > ( ( resolve ) => {
485
+ return ( env : any ) => new Promise < boolean | undefined > ( async ( ) => {
486
486
var outputFolder = determineOutputFolder ( ) ;
487
487
mkdirp . sync ( outputFolder ) ;
488
- fs . exists ( outputFolder , async function ( exists ) {
489
- const dubPath = config ( null ) . get ( "dubPath " , "dub" ) ;
490
- const dmdPath = config ( null ) . get ( "dmdPath " , undefined ) ;
491
- if ( ! exists )
492
- fs . mkdirSync ( outputFolder ) ;
493
- env [ "DFLAGS" ] = "-O -release" ;
494
- let buildArgs = [ "build" ] ;
495
- if ( process . platform == "win32" ) {
496
- env [ "DFLAGS" ] = "-release" ;
497
- buildArgs . push ( "--arch=x86_mscoff" ) ;
498
- }
499
- if ( dubPath != "dub" && dmdPath ) {
500
- // explicit dub path specified, it won't automatically find dmd if it's not in the same folder so we just pass the path if we have it
501
- buildArgs . push ( "--compiler=" + dmdPath ) ;
502
- }
503
- await compileDependency ( outputFolder , "serve-d" , "https://github.com/Pure-D/serve-d.git" , [
504
- [ dubPath , [ "upgrade" ] ] ,
505
- [ dubPath , buildArgs ]
506
- ] , env , ref ) ;
507
- var finalDestination = path . join ( outputFolder , "serve-d" , "serve-d" + ( process . platform == "win32" ? ".exe" : "" ) ) ;
508
-
509
- await config ( null ) . update ( "servedPath" , finalDestination , true ) ;
510
- resolve ( true ) ;
511
- } ) ;
488
+ const dubPath = config ( null ) . get ( "dubPath" , "dub" ) ;
489
+ const dmdPath = config ( null ) . get ( "dmdPath " , undefined ) ;
490
+ const dubCompiler = config ( null ) . get ( "dubCompiler " , undefined ) ;
491
+ env [ "DFLAGS" ] = "-O -release" ;
492
+ let buildArgs = [ "build" ] ;
493
+ if ( process . platform == "win32" ) {
494
+ env [ "DFLAGS" ] = "-release" ;
495
+ buildArgs . push ( "--arch=x86_mscoff" ) ;
496
+ }
497
+ if ( dubCompiler ) {
498
+ buildArgs . push ( "--compiler=" + dubCompiler ) ;
499
+ }
500
+ else if ( dubPath != "dub" && dmdPath ) {
501
+ // explicit dub path specified, it won't automatically find dmd if it's not in the same folder so we just pass the path if we have it
502
+ buildArgs . push ( "--compiler=" + dmdPath ) ;
503
+ }
504
+ await compileDependency ( outputFolder , "serve-d" , "https://github.com/Pure-D/serve-d.git" , [
505
+ [ dubPath , [ "upgrade" ] ] ,
506
+ [ dubPath , buildArgs ]
507
+ ] , env , ref ) ;
508
+ var finalDestination = path . join ( outputFolder , "serve-d" , "serve-d" + ( process . platform == "win32" ? ".exe" : "" ) ) ;
509
+
510
+ await config ( null ) . update ( "servedPath" , finalDestination , true ) ;
511
+ return true ;
512
512
} ) ;
513
513
}
514
514
0 commit comments