Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
Support Android SDK Deployer platform dependencies
Browse files Browse the repository at this point in the history
The Maven Android SDK Deployer by default uses 'android' as the group id
instead of 'com.google.android'.  I believe Google with Gradle is starting to
move toward the com.google.android group ID but for legacy projects the
'android' groupID still needs to be supported.

The Android app test suite now runs against the latest Android API
version. This requires that the Maven Android SDK Deployer should be
executed before the test suite runs.

Documentation and Travis Ci scripts have been updated accordingly.

This issue fixes:

https://github.com/rgladwell/m2e-android/issues/181
  • Loading branch information
kingargyle authored and rgladwell committed Apr 11, 2014
1 parent b2aa383 commit 2367ded
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -12,6 +12,9 @@ before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch > /dev/null
- echo yes |android update sdk --filter platform-tools,build-tools-17.0.0,android-10,android-7,extra-android-support,sysimg-16 --no-ui --force > /dev/null
- git clone git@github.com:mosabua/maven-android-sdk-deployer.git
- cd maven-android-sdk-deployer
- mvn install
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
script: mvn --file me.gladwell.eclipse.m2e.android.test/pom.xml -Dtycho.showEclipseLog=true -Dtarget.platform=$TARGET_PLATFORM verify
1 change: 1 addition & 0 deletions README.textile
Expand Up @@ -18,6 +18,7 @@ In addition to having Eclipse Juno installed, you need to do the following steps
# Install the "Android SDK.":http://developer.android.com/sdk/index.html
# Create ANDROID_HOME environment variable containing the Android SDK install path.
# Ensure you have the latest update on the Android SDK (execute @android update sdk --no-ui --obsolete --force@)
# Install the "Maven Android SDK Deployer":https://github.com/mosabua/maven-android-sdk-deployer
# Install latest "Android Development Tools.":http://developer.android.com/sdk/eclipse-adt.html
# Install "Eclipse Plug-in Development Environment.":http://www.eclipse.org/pde/
# Install "M2E Plugin 1.2+.":http://www.eclipse.org/m2e/download/
Expand Down
Expand Up @@ -9,12 +9,12 @@
<name>my-android-application</name>

<properties>
<platform.version>2.3.3</platform.version>
<platform.version>4.4_r1</platform.version>
</properties>

<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>${platform.version}</version>
<scope>provided</scope>
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012 Ricardo Gladwell
* Copyright (c) 2012, 2013, 2014 Ricardo Gladwell and David Carver
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -95,13 +95,18 @@ public List<String> getPlatformProvidedDependencies() {

private Dependency getAndroidDependency() {
for(Artifact artifact : mavenProject.getArtifacts()) {
if(artifact.getGroupId().equals("com.google.android") && artifact.getArtifactId().equals("android")) {
if(isAndroidGroupId(artifact) && artifact.getArtifactId().equals("android")) {
return new MavenDependency(artifact);
}
}
throw new ProjectConfigurationException("cannot find android dependency for project=[" + getName() + "]");
}

private boolean isAndroidGroupId(Artifact artifact) {
return artifact.getGroupId().equals("com.google.android") ||
artifact.getGroupId().equals("android");
}

public List<Dependency> getLibraryDependencies() {
List<Dependency> results = new ArrayList<Dependency>(mavenProject.getArtifacts().size());

Expand Down

0 comments on commit 2367ded

Please sign in to comment.