-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider making check for ANDROID_HOME a warning instead of an error #90
Comments
This really isn't an easy problem to solve. If a project in particular makes use of the android build, it will pull in the android plugin settings (and trigger the error on sdkPath lookup failure). The best approach that I can think of is to make sure absolutely common code (i.e. pure-java, no android libraries, or at worst, with a maven android sdk reference) is in a plain-java project. If you do not apply Plugin.androidBuild, sdk-path will not raise an error. |
Looking at the libgdx template in particular, if you work with the |
I agree things like compile should fail on if it worked with "only desktop", it would be cool - but I wasn't able to run it. I've tried both
(project changed in 4'th line) and without
that's why I asked if the check could be delayed - or at least made into warning using some options - so people will be aware that commands that actually do something with android will fail. |
I'm confused. Your log messages don't really indicate what you're doing or what's happening. Can you include more detailed logs? Use 'last' if necessary. |
Sure, there are more details. Complete log from zero to working project: http://pastebin.com/PE6ypCPF same when using |
I see, sbt is eagerly loading the project and settings even when it's not directly referenced. For now, you can just workaround by specifying a bullshit ANDROID_HOME, e.g. |
Or rather, that should probably work ;-) |
this has probably been made worse by recent changes, all of the android SDK stuff is now loaded eagerly |
a fallback value will be used if ANDROID_HOME is not set. If android packages are not present when the build is run, they will be auto-installed. As long as android tasks are not executed, nothing will get installed to the fallback directory. |
Would it be possible to make check for ANDROID_HOME a warning instead of an error - and fail only when someone actually uses some Android related commands like android:package-debug?
I ask because I work on cross-platform application - we use Libgdx and build for Desktop, Android and iOS using same source and very thin layer (like few classes) of platform dependent code. Unfortunately, putting android-sdk-plugin in forces everyone to have Android SDK installed - even if they only want to build iOS or Desktop version. This was a big complain from people who make our iOS and Mac builds.
We mostly use libgdx-sbt-project.g8 template and the issue is tracked there as well: ajhager/libgdx-sbt-project.g8#65 (it dated back to when libgdx-sbt-project.g8 used another Android plugin - and this idea is duplicated there as jberkel/android-plugin#199).
Anyway, thanks for great plugin! It really helps us in getting things done!
The text was updated successfully, but these errors were encountered: