Skip to content

Commit f2eb704

Browse files
pjcollinsjonpryor
authored andcommitted
[tests/Codegen-Binding] Use a variable for the 'gradlew' invocation in BuildJavaLibs (#696)
This fixes a 'gradlew' failure which is encountered on Windows only. Unfortunately, the 'gradlew' invocation prefixes the 'sdk.dir' value read from 'local.properties' with the path of the working directory. As a result, we encounter a failure along the following lines on Windows: ``` * What went wrong: A problem occurred configuring project ':library'. > The SDK directory 'C:\Users\xamarinqa\git\xamarin-android\tests\CodeGen-Binding\Xamarin.Android.LibraryProjectZip-LibBinding\java\JavaLib\C:Program Files (x86)Androidandroid-sdk' does not exist ``` This can be avoided by exporting ANDROID_HOME in the Exec portion of the BuildJavaLibs target, rather than writing this information to a file and expecting 'gradlew' to process it correctly.
1 parent acd80a0 commit f2eb704

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tests/CodeGen-Binding/Xamarin.Android.LibraryProjectZip-LibBinding/Xamarin.Android.LibraryProjectZip-LibBinding.targets

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,8 @@
4242
DependsOnTargets="AndroidPrepareForBuild"
4343
Inputs="java\JavaLib\project.properties"
4444
Outputs="$(OutputPath)JavaLib.zip">
45-
<WriteLinesToFile
46-
Overwrite="true"
47-
File="java\JavaLib\local.properties"
48-
Lines="sdk.dir=$(AndroidSdkDirectory)"
49-
/>
5045
<Exec
46+
EnvironmentVariables="ANDROID_HOME=$(AndroidSdkDirectory)"
5147
Command=".\gradlew assembleDebug --stacktrace"
5248
WorkingDirectory="$(MSBuildThisFileDirectory)java\JavaLib"
5349
/>

0 commit comments

Comments
 (0)