JakeWharton / sdk-manager-plugin

DEPRECATED Gradle plugin which downloads and manages your Android SDK.
Apache License 2.0
1.41k stars 132 forks source link

Separate task for installing dependencies #4

Closed hvisser closed 10 years ago

hvisser commented 10 years ago

Currently the plugin executes in all-automatic-mode, which is great for most cases.

However there are situations where I'd would like to execute the installation or update of SDK dependencies on demand. Similarly there might be situations where I do not want a build to trigger updating my SDK. This could be achieved by adding a task to the project that would trigger updating the SDK. That would probably also get rid of the requirement to have the plugin installed before the android plugin as well, which is blocking me from adding it to init.gradle.

JakeWharton commented 10 years ago

I started with this as a task but it doesn't work. If it's not run before the Android plugin and the SDK is missing or local.properties isn't found an exception will fail the build immediately. Dependency resolution also happens before the task would have a chance to execute causing an exception to fail with missing dependencies.

If you haven't changed your compilation API or dependencies nothing will be updated. If you have changed them and they are already available in the SDK that local.properties points at nothing will be updated.

I can make auto-download configurable (defaulted to on), but when something is missing you'll need to download them anyway.

hvisser commented 10 years ago

OK, bummer. Maybe the android plugin could be more lenient in requiring the SDK to be setup, even when you run something like gradlew tasks. But that's a different issue tracker :)

JakeWharton commented 10 years ago

I would be in favor of that as well!

hvisser commented 10 years ago

It's worth a try: https://code.google.com/p/android/issues/detail?id=67988