@@ -167,21 +167,6 @@ static string GetNdkToolchainLibraryDir (string binDir, AndroidTargetArch arch)
167167 return GetNdkToolchainLibraryDir ( binDir , NdkUtil . GetArchDirName ( arch ) ) ;
168168 }
169169
170- static string GetShortPath ( string path )
171- {
172- if ( Environment . OSVersion . Platform != PlatformID . Win32NT )
173- return QuoteFileName ( path ) ;
174- var shortPath = KernelEx . GetShortPathName ( Path . GetDirectoryName ( path ) ) ;
175- return Path . Combine ( shortPath , Path . GetFileName ( path ) ) ;
176- }
177-
178- static string QuoteFileName ( string fileName )
179- {
180- var builder = new CommandLineBuilder ( ) ;
181- builder . AppendFileNameIfNotNull ( fileName ) ;
182- return builder . ToString ( ) ;
183- }
184-
185170 static bool ValidateAotConfiguration ( TaskLoggingHelper log , AndroidTargetArch arch , bool enableLLVM )
186171 {
187172 return true ;
@@ -395,20 +380,19 @@ IEnumerable<Config> GetAotConfigs ()
395380
396381 var libs = new List < string > ( ) ;
397382 if ( NdkUtil . UsingClangNDK ) {
398- libs . Add ( $ "-L{ GetShortPath ( toolchainLibDir ) } ") ;
399- libs . Add ( $ "-L{ GetShortPath ( androidLibPath ) } ") ;
383+ libs . Add ( $ "-L{ Files . GetShortPath ( toolchainLibDir ) } ") ;
384+ libs . Add ( $ "-L{ Files . GetShortPath ( androidLibPath ) } ") ;
400385
401386 if ( arch == AndroidTargetArch . Arm ) {
402387 // Needed for -lunwind to work
403388 string compilerLibDir = Path . Combine ( toolchainPath , ".." , "sysroot" , "usr" , "lib" , NdkUtil . GetArchDirName ( arch ) ) ;
404- libs . Add ( $ "-L{ GetShortPath ( compilerLibDir ) } ") ;
389+ libs . Add ( $ "-L{ Files . GetShortPath ( compilerLibDir ) } ") ;
405390 }
406391 }
407392
408- libs . Add ( GetShortPath ( Path . Combine ( toolchainLibDir , "libgcc.a" ) ) ) ;
409- libs . Add ( GetShortPath ( Path . Combine ( androidLibPath , "libc.so" ) ) ) ;
410- libs . Add ( GetShortPath ( Path . Combine ( androidLibPath , "libm.so" ) ) ) ;
411-
393+ libs . Add ( Files . GetShortPath ( Path . Combine ( toolchainLibDir , "libgcc.a" ) ) ) ;
394+ libs . Add ( Files . GetShortPath ( Path . Combine ( androidLibPath , "libc.so" ) ) ) ;
395+ libs . Add ( Files . GetShortPath ( Path . Combine ( androidLibPath , "libm.so" ) ) ) ;
412396 ldFlags = string . Join ( ";" , libs ) ;
413397 }
414398
@@ -428,17 +412,17 @@ IEnumerable<Config> GetAotConfigs ()
428412 if ( ! string . IsNullOrEmpty ( AotAdditionalArguments ) )
429413 aotOptions . Add ( AotAdditionalArguments ) ;
430414 if ( sequencePointsMode == SequencePointsMode . Offline )
431- aotOptions . Add ( "msym-dir=" + GetShortPath ( outdir ) ) ;
415+ aotOptions . Add ( "msym-dir=" + Files . GetShortPath ( outdir ) ) ;
432416 if ( AotMode != AotMode . Normal )
433417 aotOptions . Add ( AotMode . ToString ( ) . ToLowerInvariant ( ) ) ;
434418
435- aotOptions . Add ( "outfile=" + GetShortPath ( outputFile ) ) ;
419+ aotOptions . Add ( "outfile=" + Files . GetShortPath ( outputFile ) ) ;
436420 aotOptions . Add ( "asmwriter" ) ;
437421 aotOptions . Add ( "mtriple=" + mtriple ) ;
438- aotOptions . Add ( "tool-prefix=" + GetShortPath ( toolPrefix ) ) ;
422+ aotOptions . Add ( "tool-prefix=" + Files . GetShortPath ( toolPrefix ) ) ;
439423 aotOptions . Add ( "ld-flags=" + ldFlags ) ;
440- aotOptions . Add ( "llvm-path=" + GetShortPath ( sdkBinDirectory ) ) ;
441- aotOptions . Add ( "temp-path=" + GetShortPath ( tempDir ) ) ;
424+ aotOptions . Add ( "llvm-path=" + Files . GetShortPath ( sdkBinDirectory ) ) ;
425+ aotOptions . Add ( "temp-path=" + Files . GetShortPath ( tempDir ) ) ;
442426
443427 string aotOptionsStr = ( EnableLLVM ? "--llvm " : "" ) + "--aot=" + string . Join ( "," , aotOptions ) ;
444428
@@ -460,9 +444,9 @@ IEnumerable<Config> GetAotConfigs ()
460444 }
461445
462446 var assembliesPath = Path . GetFullPath ( Path . GetDirectoryName ( resolvedPath ) ) ;
463- var assemblyPath = QuoteFileName ( Path . GetFullPath ( resolvedPath ) ) ;
447+ var assemblyPath = Files . QuoteFileName ( Path . GetFullPath ( resolvedPath ) ) ;
464448
465- yield return new Config ( assembliesPath , QuoteFileName ( aotCompiler ) , aotOptionsStr , assemblyPath , outputFile ) ;
449+ yield return new Config ( assembliesPath , Files . QuoteFileName ( aotCompiler ) , aotOptionsStr , assemblyPath , outputFile ) ;
466450 }
467451 }
468452 }
0 commit comments