views:

279

answers:

2

When using an Android-generated ant build file, the file references your SDK installation via an sdk.dir property inside the local.properties files which is generated by "android update project -p .".

The comments in build.xml suggest that local.properties should NOT be checked into version control.

BUT, when you run your build from Hudson, it does a fresh checkout of your code from version control, hence local.properties does not exist and subsequently the build fails without sdk.dir being set. So its kind of chicken and egg problem. As a workaround I have checked local.properties into version control for now (nobody else will use it) but I was curious as to how other developers had tackled this problem ?

+1  A: 

Just add a first "Execute Shell" step to your build job that runs "android update project -p ." - this will be run immediately after the source is checked out. Put your Ant build step after that and you should be OK.

gareth_bowles
I like that idea.
Eno
+2  A: 

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

Dominic Mitchell