Permalink
Browse files

Merge pull request #36 from rgladwell/remove-jar-goal

Remove jar goal from process-compile phase
  • Loading branch information...
mosabua committed May 31, 2011
2 parents 39383bc + dfb88fa commit 1d436f5d67eef551769c53b1bbe9d8587a51ee78
@@ -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())
@@ -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;
@@ -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>
@@ -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>
@@ -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>
@@ -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>

0 comments on commit 1d436f5

Please sign in to comment.