@@ -60,15 +60,19 @@ internal static void CreateFauxJdk (string dir, string releaseVersion, string re
6060 Directory . CreateDirectory ( jli ) ;
6161 Directory . CreateDirectory ( jre ) ;
6262
63-
63+ string quote = OS . IsWindows ? "" : " \" " ;
6464 string java =
6565 $ "echo Property settings:{ Environment . NewLine } " +
66- $ "echo \" java.home = { dir } \" { Environment . NewLine } " +
67- $ "echo \" java.vendor = Xamarin.Android Unit Tests\" { Environment . NewLine } " +
68- $ "echo \" java.version = { javaVersion } \" { Environment . NewLine } " +
69- $ "echo \" xamarin.multi-line = line the first\" { Environment . NewLine } " +
70- $ "echo \" line the second\" { Environment . NewLine } " +
71- $ "echo \" .\" { Environment . NewLine } ";
66+ $ "echo { quote } java.home = { dir } { quote } { Environment . NewLine } " +
67+ $ "echo { quote } java.vendor = Xamarin.Android Unit Tests{ quote } { Environment . NewLine } " +
68+ $ "echo { quote } java.version = { javaVersion } { quote } { Environment . NewLine } " +
69+ $ "echo { quote } xamarin.multi-line = line the first{ quote } { Environment . NewLine } " +
70+ $ "echo { quote } line the second{ quote } { Environment . NewLine } " +
71+ $ "echo { quote } .{ quote } { Environment . NewLine } ";
72+
73+ if ( OS . IsWindows ) {
74+ java = $ "@echo off{ Environment . NewLine } { java } ";
75+ }
7276
7377 CreateShellScript ( Path . Combine ( bin , "jar" ) , "" ) ;
7478 CreateShellScript ( Path . Combine ( bin , "java" ) , java ) ;
@@ -86,7 +90,7 @@ public void DeleteFauxJdk ()
8690
8791 static void CreateShellScript ( string path , string contents )
8892 {
89- if ( OS . IsWindows )
93+ if ( OS . IsWindows && string . Compare ( Path . GetExtension ( path ) , ".dll" , true ) != 0 )
9094 path += ".cmd" ;
9195 using ( var script = new StreamWriter ( path ) ) {
9296 if ( ! OS . IsWindows ) {
0 commit comments