Skip to content

Commit

Permalink
Merge branch 'remove-jar-goal' of git://github.com/rgladwell/maven-an…
Browse files Browse the repository at this point in the history
…droid-plugin
  • Loading branch information
mosabua committed May 31, 2011
2 parents 39383bc + dfb88fa commit 54dcfc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Expand Up @@ -59,16 +59,13 @@ public void execute() throws MojoExecutionException, MojoFailureException {
.createDefaultCommmandExecutor();
executor.setLogger(this.getLog());

File inputFile = new File(project.getBuild().getDirectory()
+ File.separator + project.getBuild().getFinalName() + ".jar");

if (generateApk) {
// Unpack all dependent and main classes
unpackClasses(inputFile);
unpackClasses();
}
}

private File unpackClasses(File inputFile) throws MojoExecutionException {
private File unpackClasses() throws MojoExecutionException {
File outputDirectory = new File(project.getBuild().getDirectory(),
"android-classes");
if (lazyLibraryUnpack && outputDirectory.exists())
Expand Down Expand Up @@ -103,10 +100,11 @@ private File unpackClasses(File inputFile) throws MojoExecutionException {
}

try {
unjar(new JarFile(inputFile), outputDirectory);
File sourceDirectory = new File(project.getBuild().getDirectory(), "classes");
FileUtils.copyDirectory(sourceDirectory, outputDirectory);
} catch (IOException e) {
throw new MojoExecutionException("IOException while unjarring "
+ inputFile.getAbsolutePath() + " into "
throw new MojoExecutionException("IOException while copying "
+ sourceDirectory.getAbsolutePath() + " into "
+ outputDirectory.getAbsolutePath(), e);
}
return outputDirectory;
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/plexus/components.xml
Expand Up @@ -33,7 +33,6 @@
org.apache.maven.plugins:maven-compiler-plugin:compile
</compile>
<process-classes>
org.apache.maven.plugins:maven-jar-plugin:jar,
com.jayway.maven.plugins.android.generation2:maven-android-plugin:unpack
</process-classes>
<process-test-resources>
Expand All @@ -45,6 +44,7 @@
com.jayway.maven.plugins.android.generation2:maven-android-plugin:dex
</prepare-package>
<package>
org.apache.maven.plugins:maven-jar-plugin:jar,
com.jayway.maven.plugins.android.generation2:maven-android-plugin:apk
</package>
<install>
Expand Down Expand Up @@ -131,7 +131,6 @@
org.apache.maven.plugins:maven-compiler-plugin:compile
</compile>
<process-classes>
org.apache.maven.plugins:maven-jar-plugin:jar,
com.jayway.maven.plugins.android.generation2:maven-android-plugin:unpack
</process-classes>
<process-test-resources>
Expand All @@ -140,6 +139,7 @@
<test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
<test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
<package>
org.apache.maven.plugins:maven-jar-plugin:jar,
com.jayway.maven.plugins.android.generation2:maven-android-plugin:apklib
</package>
<install>
Expand Down

0 comments on commit 54dcfc8

Please sign in to comment.