Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed Issue 331: Multiple proguardConfig #163

Merged
merged 1 commit into from

2 participants

@brudaswen

Fixed issue http://code.google.com/p/maven-android-plugin/issues/detail?id=331

Any comments and improvements are welcome. Thanks for the maven-android-plugin.

@mosabua
Owner

Thanks for the pull request. I will pull this in in the next week or two.

@mosabua mosabua merged commit 0f468ee into simpligility:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 25, 2012
  1. Fixed Issue 331: Multiple proguardConfig

    Sven Obser authored
This page is out of date. Refresh to see the latest.
View
6 src/main/java/com/jayway/maven/plugins/android/configuration/Proguard.java
@@ -18,6 +18,7 @@
* Path to the ProGuard configuration file (relative to project root).
*/
private String config;
+ private String[] configs;
private String proguardJarPath;
private String outputDirectory;
private String[] jvmArguments;
@@ -35,6 +36,11 @@ public String getConfig()
return config;
}
+ public String[] getConfigs()
+ {
+ return configs;
+ }
+
public String getProguardJarPath()
{
return proguardJarPath;
View
30 src/main/java/com/jayway/maven/plugins/android/phase04processclasses/ProguardMojo.java
@@ -51,6 +51,9 @@
* <proguard>
* <skip>true|false</skip>
* <config>proguard.cfg</config>
+ * <configs>
+ * <config>${env.ANDROID_HOME}/tools/proguard/proguard-android.txt</config>
+ * </configs>
* <proguardJarPath>someAbsolutePathToProguardJar</proguardJarPath>
* <filterMavenDescriptor>true|false</filterMavenDescriptor>
* <filterManifest>true|false</filterManifest>
@@ -96,6 +99,17 @@
private String parsedConfig;
/**
+ * Additional ProGuard configuration files (relative to project root).
+ *
+ * @parameter expression="${android.proguard.configs}"
+ * @optional
+ */
+ private String[] proguardConfigs;
+
+ @PullParameter( defaultValueGetterMethod = "getDefaultProguardConfigs" )
+ private String[] parsedConfigs;
+
+ /**
* Path to the proguard jar and therefore version of proguard to be used. By default this will load the jar from
* the Android SDK install. Overriding it with an absolute path allows you to use a newer or custom proguard
* version..
@@ -300,6 +314,11 @@ private void executeProguard() throws MojoExecutionException
commands.add( "@" + parsedConfig );
+ for ( String config : parsedConfigs )
+ {
+ commands.add( "@" + config );
+ }
+
collectInputFiles( commands );
commands.add( "-outjars" );
@@ -587,4 +606,15 @@ private String getProguardJarPathFromDependencies() throws MojoExecutionExceptio
return new String[]{ "-Xmx512M" };
}
+ /**
+ * Get the default ProGuard config files.
+ *
+ * @return
+ * @see #parsedConfigs
+ */
+ private String[] getDefaultProguardConfigs()
+ {
+ return new String[0];
+ }
+
}
Something went wrong with that request. Please try again.