@@ -172,21 +172,6 @@ static string GetNdkToolchainLibraryDir (string binDir, AndroidTargetArch arch)
172172 return GetNdkToolchainLibraryDir ( binDir , NdkUtil . GetArchDirName ( arch ) ) ;
173173 }
174174
175- static string GetShortPath ( string path )
176- {
177- if ( Environment . OSVersion . Platform != PlatformID . Win32NT )
178- return QuoteFileName ( path ) ;
179- var shortPath = KernelEx . GetShortPathName ( Path . GetDirectoryName ( path ) ) ;
180- return Path . Combine ( shortPath , Path . GetFileName ( path ) ) ;
181- }
182-
183- static string QuoteFileName ( string fileName )
184- {
185- var builder = new CommandLineBuilder ( ) ;
186- builder . AppendFileNameIfNotNull ( fileName ) ;
187- return builder . ToString ( ) ;
188- }
189-
190175 static bool ValidateAotConfiguration ( TaskLoggingHelper log , AndroidTargetArch arch , bool enableLLVM )
191176 {
192177 return true ;
@@ -380,20 +365,19 @@ IEnumerable<Config> GetAotConfigs ()
380365
381366 var libs = new List < string > ( ) ;
382367 if ( NdkUtil . UsingClangNDK ) {
383- libs . Add ( $ "-L{ GetShortPath ( toolchainLibDir ) } ") ;
384- libs . Add ( $ "-L{ GetShortPath ( androidLibPath ) } ") ;
368+ libs . Add ( $ "-L{ Files . GetShortPath ( toolchainLibDir ) } ") ;
369+ libs . Add ( $ "-L{ Files . GetShortPath ( androidLibPath ) } ") ;
385370
386371 if ( arch == AndroidTargetArch . Arm ) {
387372 // Needed for -lunwind to work
388373 string compilerLibDir = Path . Combine ( toolchainPath , ".." , "sysroot" , "usr" , "lib" , NdkUtil . GetArchDirName ( arch ) ) ;
389- libs . Add ( $ "-L{ GetShortPath ( compilerLibDir ) } ") ;
374+ libs . Add ( $ "-L{ Files . GetShortPath ( compilerLibDir ) } ") ;
390375 }
391376 }
392377
393- libs . Add ( GetShortPath ( Path . Combine ( toolchainLibDir , "libgcc.a" ) ) ) ;
394- libs . Add ( GetShortPath ( Path . Combine ( androidLibPath , "libc.so" ) ) ) ;
395- libs . Add ( GetShortPath ( Path . Combine ( androidLibPath , "libm.so" ) ) ) ;
396-
378+ libs . Add ( Files . GetShortPath ( Path . Combine ( toolchainLibDir , "libgcc.a" ) ) ) ;
379+ libs . Add ( Files . GetShortPath ( Path . Combine ( androidLibPath , "libc.so" ) ) ) ;
380+ libs . Add ( Files . GetShortPath ( Path . Combine ( androidLibPath , "libm.so" ) ) ) ;
397381 ldFlags = string . Join ( ";" , libs ) ;
398382 }
399383
@@ -420,17 +404,17 @@ IEnumerable<Config> GetAotConfigs ()
420404 if ( ! string . IsNullOrEmpty ( AotAdditionalArguments ) )
421405 aotOptions . Add ( AotAdditionalArguments ) ;
422406 if ( sequencePointsMode == SequencePointsMode . Offline )
423- aotOptions . Add ( "msym-dir=" + GetShortPath ( outdir ) ) ;
407+ aotOptions . Add ( "msym-dir=" + Files . GetShortPath ( outdir ) ) ;
424408 if ( AotMode != AotMode . Normal )
425409 aotOptions . Add ( AotMode . ToString ( ) . ToLowerInvariant ( ) ) ;
426410
427- aotOptions . Add ( "outfile=" + GetShortPath ( outputFile ) ) ;
411+ aotOptions . Add ( "outfile=" + Files . GetShortPath ( outputFile ) ) ;
428412 aotOptions . Add ( "asmwriter" ) ;
429413 aotOptions . Add ( "mtriple=" + mtriple ) ;
430- aotOptions . Add ( "tool-prefix=" + GetShortPath ( toolPrefix ) ) ;
414+ aotOptions . Add ( "tool-prefix=" + Files . GetShortPath ( toolPrefix ) ) ;
431415 aotOptions . Add ( "ld-flags=" + ldFlags ) ;
432- aotOptions . Add ( "llvm-path=" + GetShortPath ( sdkBinDirectory ) ) ;
433- aotOptions . Add ( "temp-path=" + GetShortPath ( tempDir ) ) ;
416+ aotOptions . Add ( "llvm-path=" + Files . GetShortPath ( sdkBinDirectory ) ) ;
417+ aotOptions . Add ( "temp-path=" + Files . GetShortPath ( tempDir ) ) ;
434418
435419 string aotOptionsStr = ( EnableLLVM ? "--llvm " : "" ) + "--aot=" + string . Join ( "," , aotOptions ) ;
436420
@@ -452,9 +436,9 @@ IEnumerable<Config> GetAotConfigs ()
452436 }
453437
454438 var assembliesPath = Path . GetFullPath ( Path . GetDirectoryName ( resolvedPath ) ) ;
455- var assemblyPath = QuoteFileName ( Path . GetFullPath ( resolvedPath ) ) ;
439+ var assemblyPath = Files . QuoteFileName ( Path . GetFullPath ( resolvedPath ) ) ;
456440
457- yield return new Config ( assembliesPath , QuoteFileName ( aotCompiler ) , aotOptionsStr , assemblyPath , outputFile ) ;
441+ yield return new Config ( assembliesPath , Files . QuoteFileName ( aotCompiler ) , aotOptionsStr , assemblyPath , outputFile ) ;
458442 }
459443 }
460444 }
0 commit comments