@@ -166,21 +166,6 @@ static string GetNdkToolchainLibraryDir (string binDir, AndroidTargetArch arch)
166166 return GetNdkToolchainLibraryDir ( binDir , NdkUtil . GetArchDirName ( arch ) ) ;
167167 }
168168
169- static string GetShortPath ( string path )
170- {
171- if ( Environment . OSVersion . Platform != PlatformID . Win32NT )
172- return QuoteFileName ( path ) ;
173- var shortPath = KernelEx . GetShortPathName ( Path . GetDirectoryName ( path ) ) ;
174- return Path . Combine ( shortPath , Path . GetFileName ( path ) ) ;
175- }
176-
177- static string QuoteFileName ( string fileName )
178- {
179- var builder = new CommandLineBuilder ( ) ;
180- builder . AppendFileNameIfNotNull ( fileName ) ;
181- return builder . ToString ( ) ;
182- }
183-
184169 static bool ValidateAotConfiguration ( TaskLoggingHelper log , AndroidTargetArch arch , bool enableLLVM )
185170 {
186171 return true ;
@@ -394,20 +379,19 @@ IEnumerable<Config> GetAotConfigs ()
394379
395380 var libs = new List < string > ( ) ;
396381 if ( NdkUtil . UsingClangNDK ) {
397- libs . Add ( $ "-L{ GetShortPath ( toolchainLibDir ) } ") ;
398- libs . Add ( $ "-L{ GetShortPath ( androidLibPath ) } ") ;
382+ libs . Add ( $ "-L{ Files . GetShortPath ( toolchainLibDir ) } ") ;
383+ libs . Add ( $ "-L{ Files . GetShortPath ( androidLibPath ) } ") ;
399384
400385 if ( arch == AndroidTargetArch . Arm ) {
401386 // Needed for -lunwind to work
402387 string compilerLibDir = Path . Combine ( toolchainPath , ".." , "sysroot" , "usr" , "lib" , NdkUtil . GetArchDirName ( arch ) ) ;
403- libs . Add ( $ "-L{ GetShortPath ( compilerLibDir ) } ") ;
388+ libs . Add ( $ "-L{ Files . GetShortPath ( compilerLibDir ) } ") ;
404389 }
405390 }
406391
407- libs . Add ( GetShortPath ( Path . Combine ( toolchainLibDir , "libgcc.a" ) ) ) ;
408- libs . Add ( GetShortPath ( Path . Combine ( androidLibPath , "libc.so" ) ) ) ;
409- libs . Add ( GetShortPath ( Path . Combine ( androidLibPath , "libm.so" ) ) ) ;
410-
392+ libs . Add ( Files . GetShortPath ( Path . Combine ( toolchainLibDir , "libgcc.a" ) ) ) ;
393+ libs . Add ( Files . GetShortPath ( Path . Combine ( androidLibPath , "libc.so" ) ) ) ;
394+ libs . Add ( Files . GetShortPath ( Path . Combine ( androidLibPath , "libm.so" ) ) ) ;
411395 ldFlags = string . Join ( ";" , libs ) ;
412396 }
413397
@@ -427,17 +411,17 @@ IEnumerable<Config> GetAotConfigs ()
427411 if ( ! string . IsNullOrEmpty ( AotAdditionalArguments ) )
428412 aotOptions . Add ( AotAdditionalArguments ) ;
429413 if ( sequencePointsMode == SequencePointsMode . Offline )
430- aotOptions . Add ( "msym-dir=" + GetShortPath ( outdir ) ) ;
414+ aotOptions . Add ( "msym-dir=" + Files . GetShortPath ( outdir ) ) ;
431415 if ( AotMode != AotMode . Normal )
432416 aotOptions . Add ( AotMode . ToString ( ) . ToLowerInvariant ( ) ) ;
433417
434- aotOptions . Add ( "outfile=" + GetShortPath ( outputFile ) ) ;
418+ aotOptions . Add ( "outfile=" + Files . GetShortPath ( outputFile ) ) ;
435419 aotOptions . Add ( "asmwriter" ) ;
436420 aotOptions . Add ( "mtriple=" + mtriple ) ;
437- aotOptions . Add ( "tool-prefix=" + GetShortPath ( toolPrefix ) ) ;
421+ aotOptions . Add ( "tool-prefix=" + Files . GetShortPath ( toolPrefix ) ) ;
438422 aotOptions . Add ( "ld-flags=" + ldFlags ) ;
439- aotOptions . Add ( "llvm-path=" + GetShortPath ( sdkBinDirectory ) ) ;
440- aotOptions . Add ( "temp-path=" + GetShortPath ( tempDir ) ) ;
423+ aotOptions . Add ( "llvm-path=" + Files . GetShortPath ( sdkBinDirectory ) ) ;
424+ aotOptions . Add ( "temp-path=" + Files . GetShortPath ( tempDir ) ) ;
441425
442426 string aotOptionsStr = ( EnableLLVM ? "--llvm " : "" ) + "--aot=" + string . Join ( "," , aotOptions ) ;
443427
@@ -459,9 +443,9 @@ IEnumerable<Config> GetAotConfigs ()
459443 }
460444
461445 var assembliesPath = Path . GetFullPath ( Path . GetDirectoryName ( resolvedPath ) ) ;
462- var assemblyPath = QuoteFileName ( Path . GetFullPath ( resolvedPath ) ) ;
446+ var assemblyPath = Files . QuoteFileName ( Path . GetFullPath ( resolvedPath ) ) ;
463447
464- yield return new Config ( assembliesPath , QuoteFileName ( aotCompiler ) , aotOptionsStr , assemblyPath , outputFile ) ;
448+ yield return new Config ( assembliesPath , Files . QuoteFileName ( aotCompiler ) , aotOptionsStr , assemblyPath , outputFile ) ;
465449 }
466450 }
467451 }
0 commit comments