Skip to content

Replace ADT APK Builder with custom Maven APK Builder #67

Closed
rgladwell opened this Issue Feb 18, 2012 · 10 comments

5 participants

@rgladwell
Owner

Due to issues with Eclipse's in-abilty to filter and group classpath as Maven (see issues #52, '53, #58 and #62) can, we need to replace the default ADT APK Builder with a Maven ADT Builder that will filter out provided scope dependencies and support android-maven-plugin features.

See here for further discussion:

https://groups.google.com/d/topic/maven-android-developers/6a46CeVsUKg/discussion

@thoutbeckers

I'll be following this.

@tprochazka

If Maven ADT Builder will be faster I vote for it. But for now is ADT APK Builder much faster than build with maven itself (from commandline) or view Eclipse (run As -> Maven Build...)

@rgladwell
Owner

@tprochazka unfortunately, we may not have a choice but to go back to the Maven ADT Builder. Eclipse does not recognise different scopes of dependencies like Maven (compile, provided, etc.) so we may have to go back for this reason. Obviously, wrapping the native ADT builder to support maven scopes etc. might have performance issues, the question is whether these will be significant.

@tprochazka

It depends on whether it will be possible use compile on save functionality, reuse already generated R.class or already packed resources and merging .dex in the future. I also hope that aapt.exe will be rewritten to the something (like Java) which allow incremental update and stop progress if some change happen during build (like it now block whole Eclipse if I save any file during on save build progress). Like Eclipse do class compile on save, it also doesn't use javac.exe. And I also hope for hot swap class support in future version of Android VM, like Java does.

@rgladwell
Owner

Recent investigation digging around inside the ADT code indicates replacing the ADT APK builder is no longer possible, certainly not without a patch against the ADT. Removing "important" label.

@stephanenicolas

I can't say how much this issue is related to issue #8 but today I tried a maven configuration (that worked perfectly fine via command line using mvn) where my robolectric tests where included inside an apk project in src/test/java. It didn't work at all as test dependencies (mostly robolectric and transitive dependencies) where included in the apk that was deployed to the device / emulator when running the project via eclipse.

Test scoped dependencies were not treated properly in that configuration and I believe the issue to be still open.

Sample project that fails to be run in eclipse but works fine with maven can be found here.

@rgladwell
Owner

@stephanenicolas this issue is still open, its just "Closed" appears above for a few issues related to this ticket that were closed.

@tommyd3mdi

I stumbled upon the same problem like @stephanenicolas.

Is there any known workaround (like specifying the test dependencies in the parent pom and reference them again in the app's pom, but only with "provided"), or is moving the tests into a separate module the only option?

@rgladwell
Owner

Roboelectric support is a known issue that is currently being worked on, see issue #52

@rgladwell
Owner

Fixed by b2aa3

@rgladwell rgladwell closed this Apr 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.