Creating an Android app from ant via Hudson - chicken and egg problem

When using the Android build file created, the ant file refers to your SDK installation using the sdk.dir property in the local.properties files, which is generated by the "android update project -p."

The comments in the build.xml file indicate that local.properties should NOT be checked in version control.

BUT, when you run your build from Hudson, it performs a new code check from version control, so local.properties does not exist, and subsequently the build fails without installing sdk.dir. So this is a problem with chicken and egg. As a workaround, I checked local.properties in version control for now (no one will use it), but I was curious how other developers solved this problem?

+4
source share
2 answers

Just add the first step, β€œCommand Line Execution,” to your build task that launches the -p android update project. - it will start immediately after checking the source. Place the Ant build step after this, and you should be fine.

+7
source

You can simply pass -Dsdk.dir=/some/where/android-sdk-linux to the ant command line in hudson.

+5
source

Source: https://habr.com/ru/post/1307831/


All Articles