android.jar dependency

3 views
Skip to first unread message

Vlad Skarzhevskyy

unread,
Mar 29, 2009, 4:40:12 PM3/29/09
to masa-de...@googlegroups.com
As it is right now we need to install android.jar to repository and
can't use system scope.
Even so I can use in my application pom:
<dependency>
<groupId>com.android</groupId>
<artifactId>android</artifactId>
<version>1.1_r1</version>
<scope>system</scope>
<systemPath>${ANDROID_SDK}/android.jar</systemPath>
</dependency>

I suggest to extends the android.jar dependency resolution in plugin
to project artifacts.

I tried this change in AbstractAaptMojo.java:

protected File resolveAndroidJar() throws MojoExecutionException {

+ for(Artifact d: (List<Artifact>)project.getCompileArtifacts()) {
+ if (d.getArtifactId().equals("android")) {
+ return d.getFile();
+ }
+ }

... original code....


So it can use what ever I have declared in my project pom. And all
worked just fine.

Also regarding subject hardcoded groupId 'android' it not really
good. It should it be 'com.android'
See http://maven.apache.org/guides/mini/guide-central-repository-upload.html

As a suggestion for compatibility can you just make it as parameter in Mojo?


--
Vlad

Reply all
Reply to author
Forward
0 new messages