Revamped the Maven build to use the Maven Proguard plugin (PITA!) instead of
calling out to Ant to do the Proguard build. Running Ant from within Maven (which then runs Maven from within Ant) no longer works as of Maven 3. While I was in here, I changed the build to use the Proguard-ed artifact as the primary artifact, and changed the POM to reflect that none of the dependencies are transitive.
This commit is contained in:
@@ -100,17 +100,12 @@
|
||||
</javadoc>
|
||||
</target>
|
||||
|
||||
<target name="dist" depends="compile" description="Builds jar files.">
|
||||
<jar destfile="${deploy.dir}/${ant.project.name}.jar" manifest="lib/manifest.mf"
|
||||
<target name="dist" depends="compile" description="Builds jar file.">
|
||||
<jar destfile="${deploy.dir}/${ant.project.name}-bare.jar" manifest="lib/manifest.mf"
|
||||
basedir="${deploy.dir}/classes"/>
|
||||
<!-- generate our proguard client and tool jar files -->
|
||||
<antcall target="-proguard">
|
||||
<param name="getdown.jar" value="${deploy.dir}/${ant.project.name}.jar"/>
|
||||
<param name="version.suff" value=""/>
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
<target name="-proguard" depends="-prepare">
|
||||
<target name="proguard" depends="dist" description="Builds dependencies included jar file.">
|
||||
<!-- locate the platform classes -->
|
||||
<condition property="rt.jar" value="${java.home}/../Classes/classes.jar">
|
||||
<available file="${java.home}/../Classes/classes.jar"/>
|
||||
@@ -126,13 +121,13 @@
|
||||
|
||||
<!-- build the dependencies included jar file -->
|
||||
<proguard>
|
||||
<injar path="${getdown.jar}"/>
|
||||
<injar path="${deploy.dir}/${ant.project.name}-bare.jar"/>
|
||||
<injar path="${jregistrykey:jregistrykey:jar}" filter="!META-INF/**"/>
|
||||
<injar path="${com.samskivert:samskivert:jar}" filter="!META-INF/**,
|
||||
!**/Log4JLogger*,!**/*.java,com/samskivert/Log.class,**/samskivert/io/**,
|
||||
**/samskivert/swing/**,**/samskivert/text/**,**/samskivert/util/**"/>
|
||||
<injar path="${commons-codec:commons-codec:jar}" filter="!META-INF/**"/>
|
||||
<outjar path="${deploy.dir}/getdown-pro${version.suff}.jar"/>
|
||||
<outjar path="${deploy.dir}/${ant.project.name}.jar"/>
|
||||
<libraryjar name="${rt.jar}"/>
|
||||
<libraryjar name="${org.apache.ant:ant:jar}"/>
|
||||
<libraryjar name="${java.home}/lib/plugin.jar"/>
|
||||
@@ -154,7 +149,7 @@
|
||||
</target>
|
||||
|
||||
<property name="maven.deploy.repo" value="file://${user.home}/.m2/repository"/>
|
||||
<target name="maven-deploy" depends="dist"
|
||||
<target name="maven-deploy" depends="proguard"
|
||||
description="Deploys our build artifacts to a Maven repository.">
|
||||
<jar basedir="${src.dir}" destfile="${deploy.dir}/${ant.project.name}-sources.jar"/>
|
||||
<artifact:deploy file="${deploy.dir}/${ant.project.name}.jar" uniqueVersion="false">
|
||||
@@ -162,10 +157,5 @@
|
||||
<pom refid="pom"/>
|
||||
<attach file="${deploy.dir}/${ant.project.name}-sources.jar" classifier="sources"/>
|
||||
</artifact:deploy>
|
||||
<artifact:pom id="proguard-pom" file="proguard-pom.xml"/>
|
||||
<artifact:deploy file="${deploy.dir}/${ant.project.name}-pro.jar" uniqueVersion="false">
|
||||
<remoteRepository url="${maven.deploy.repo}"/>
|
||||
<pom refid="proguard-pom"/>
|
||||
</artifact:deploy>
|
||||
</target>
|
||||
</project>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.threerings</groupId>
|
||||
<artifactId>getdown</artifactId>
|
||||
@@ -52,19 +54,18 @@
|
||||
<groupId>com.samskivert</groupId>
|
||||
<artifactId>samskivert</artifactId>
|
||||
<version>1.2</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.4</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jregistrykey</groupId>
|
||||
<artifactId>jregistrykey</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -73,6 +74,13 @@
|
||||
<version>1.7.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>java</groupId>
|
||||
<artifactId>plugin</artifactId>
|
||||
<version>1.5</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${java.home}/lib/plugin.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
@@ -105,11 +113,6 @@
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
@@ -120,28 +123,56 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<groupId>com.pyx4me</groupId>
|
||||
<artifactId>proguard-maven-plugin</artifactId>
|
||||
<version>2.0.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>package</id>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<property name="deploy.dir" value="target" />
|
||||
<property name="getdown.jar" value="target/getdown-${project.version}.jar" />
|
||||
<property name="version.suff" value="-${project.version}" />
|
||||
<ant antfile="${basedir}/build.xml">
|
||||
<target name="-proguard" />
|
||||
</ant>
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<goals><goal>proguard</goal></goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.sf.proguard</groupId>
|
||||
<artifactId>proguard</artifactId>
|
||||
<version>4.4</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<proguardVersion>4.4</proguardVersion>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
<outjar>${project.build.finalName}.jar</outjar>
|
||||
<injar>${project.build.finalName}.jar</injar>
|
||||
<assembly>
|
||||
<inclusions>
|
||||
<inclusion>
|
||||
<groupId>com.samskivert</groupId>
|
||||
<artifactId>samskivert</artifactId>
|
||||
<filter>!**/Log4JLogger*,!**/*.java,com/samskivert/Log.class,**/samskivert/io/**,
|
||||
**/samskivert/swing/**,**/samskivert/text/**,**/samskivert/util/**</filter>
|
||||
</inclusion>
|
||||
<inclusion>
|
||||
<groupId>jregistrykey</groupId>
|
||||
<artifactId>jregistrykey</artifactId>
|
||||
</inclusion>
|
||||
<inclusion>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</inclusion>
|
||||
</inclusions>
|
||||
</assembly>
|
||||
<obfuscate>true</obfuscate>
|
||||
<options>
|
||||
<option>-keep public class com.threerings.getdown.** { *; }</option>
|
||||
<option>-keep public class ca.beq.util.win32.registry.** { *; }</option>
|
||||
</options>
|
||||
<libs>
|
||||
<lib>${rt.jar.path}</lib>
|
||||
</libs>
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
@@ -155,17 +186,8 @@
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -226,5 +248,24 @@
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<!-- finagling to deal with rt.jar not existing on Macs, thanks Apple! -->
|
||||
<profile>
|
||||
<id>mac</id>
|
||||
<activation>
|
||||
<file><exists>${java.home}/../Classes/classes.jar</exists></file>
|
||||
</activation>
|
||||
<properties>
|
||||
<rt.jar.path>${java.home}/../Classes/classes.jar</rt.jar.path>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>non-mac</id>
|
||||
<activation>
|
||||
<file><exists>${java.home}/../lib/rt.jar</exists></file>
|
||||
</activation>
|
||||
<properties>
|
||||
<rt.jar.path>${java.home}/../lib/rt.jar</rt.jar.path>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.threerings</groupId>
|
||||
<artifactId>getdown-pro</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
<name>getdown-pro</name>
|
||||
<description>A dependencies-included version of getdown.jar.</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- none! -->
|
||||
</dependencies>
|
||||
</project>
|
||||
Reference in New Issue
Block a user