A bastard combination of Maven and Ivy that will hopefully eventually allow us

to build and publish Getdown. Everything builds with Maven, but getting
Proguard to work inside Maven is an exercise in gouge-my-eyes-out-now, so I'll
be doing the Proguard bits in a separate Ant script which will use Ivy to
obtain dependencies sanely. This too is rife with PITA, but less so than doing
everything in Maven. Ivy bits don't yet work.
This commit is contained in:
Michael Bayne
2010-09-21 00:45:35 +00:00
parent 5fa9c80220
commit f6a03dd99f
3 changed files with 315 additions and 0 deletions
+102
View File
@@ -0,0 +1,102 @@
<?xml version="1.0"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="getdown" default="compile" basedir=".">
<property name="app.name" value="getdown"/>
<property name="revision" value="1.0"/>
<!-- downloads ivy if necessary and sets everything up -->
<property name="ivy.vers" value="2.1.0-rc2" />
<property name="ivy.jar.dir" value="${user.home}/.ant/lib" />
<condition property="ivy.exists"><available file="${ivy.jar.dir}/ivy.jar"/></condition>
<target name="-download-ivy" unless="ivy.exists">
<mkdir dir="${ivy.jar.dir}"/>
<get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.vers}/ivy-${ivy.vers}.jar"
dest="${ivy.jar.dir}/ivy.jar" usetimestamp="true"/>
</target>
<target name="-init-ivy" depends="-download-ivy">
<path id="ivy.lib.path"><fileset dir="${ivy.jar.dir}" includes="*.jar"/></path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
<ivy:cachepath pathid="compile.classpath" conf="compile" log="download-only"/>
</target>
<target name="check-ivy" depends="-init-ivy" description="Computes and prints Ivy classpath.">
<pathconvert pathsep="${line.separator} " property="compile.str" refid="compile.classpath"/>
<echo>Compile classpath:</echo>
<echo> ${compile.str}</echo>
</target>
<target name="proguard" depends="-init-ivy">
<!-- we need ant-contrib for if -->
<!--
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${deploy.dir}/lib/ant-contrib.jar"/>
</classpath>
</taskdef>
-->
<!-- figure out where the Java rt.jar file lives -->
<!--
<if><and><os family="mac"/><os family="unix"/></and><then>
<property name="rtClasses" value="${java.home}/../Classes/classes.jar"/>
</then><else>
<property name="rtClasses" value="${java.home}/lib/rt.jar"/>
</else></if>
-->
<mkdir dir="target"/>
<taskdef resource="proguard/ant/task.properties" classpathref="compile.classpath"/>
<proguard>
-injars dist/getdown.jar(!**/tools/**)
-injars dist/getdown.jar(**/tools/*Patcher*,**/tools/Differ*)
-injars dist/lib/jRegistryKey.jar(!META-INF/*)
-injars dist/lib/samskivert.jar(
com/samskivert/Log.class,**/io/**,**/swing/**,**/net/**,**/text/**,**/util/**)
-injars dist/lib/commons-codec.jar(!META-INF/*)
-dontskipnonpubliclibraryclasses
-outjars target/getdown-pro.jar
-keep public class ca.beq.util.win32.registry.** {
*;
}
-keep public class com.threerings.getdown.launcher.Getdown {
public static void main (java.lang.String[]);
}
-keep public class com.threerings.getdown.launcher.GetdownApp {
public static void main (java.lang.String[]);
}
-keep public class com.threerings.getdown.launcher.GetdownApplet {
*;
}
-keep class * extends javax.swing.JApplet {
&lt;methods&gt;;
}
-keep public class com.threerings.getdown.launcher.GetdownAppletConfig {
*;
}
</proguard>
<!--
<taskdef name="weave" classname="com.rc.retroweaver.ant.RetroWeaverTask"
classpath="${deploy.dir}/lib/retroweaver-all-1.2.2.jar"/>
<weave inputjar="${basedir}/${deploy.dir}/${app.name}-pro.jar"
outputjar="${basedir}/${deploy.dir}/${app.name}-retro-pro.jar"/>
-->
<!-- now combine the retroweaved jar file with the retroweaver runtime -->
<!--
<unjar src="${deploy.dir}/lib/retroweaver-rt-1.2.2.jar"
dest="${deploy.dir}/rptmp"/>
<jar destfile="${deploy.dir}/${app.name}-retro-pro.jar"
manifest="lib/manifest.mf" basedir="${deploy.dir}/rptmp" update="true"/>
<delete dir="${deploy.dir}/rptmp"/>
-->
</target>
</project>
+30
View File
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:mvn="http://ant.apache.org/ivy/maven">
<info organisation="com.threerings" module="getdown" revision="${revision}">
<description homepage="http://code.google.com/p/getdown"/>
</info>
<configurations>
<conf name="default" visibility="public" extends="runtime,master"/>
<conf name="master" visibility="public"/>
<conf name="provided" visibility="public"/>
<conf name="runtime" visibility="public"/>
<conf name="sources" visibility="public"/>
<conf name="javadoc" visibility="public"/>
<conf name="optional" visibility="public"/>
<conf name="compile" visibility="private" extends="runtime,provided,optional"/>
<conf name="test" visibility="private" extends="compile"/>
</configurations>
<publications>
<artifact type="jar"/>
<artifact type="source" ext="jar" mvn:classifier="sources"/>
<artifact type="javadoc" ext="jar" mvn:classifier="javadoc"/>
</publications>
<dependencies>
<dependency org="net.sf.proguard" name="proguard" rev="4.4" conf="compile->master(*)"/>
<dependency org="com.samskivert" name="samskivert" rev="1.0" conf="compile->master(*)"/>
<dependency org="commons-codec" name="commons-codec" rev="1.4" conf="compile->master(*)"/>
<dependency org="log4j" name="log4j" rev="1.2.15" conf="compile->master(*)"/>
<dependency org="net.sourceforge.retroweaver" name="retroweaver" rev="2.0.7" conf="compile->master(*)"/>
<dependency org="org.apache.ant" name="ant" rev="1.7.1" conf="compile->master(*)"/>
</dependencies>
</ivy-module>
+183
View File
@@ -0,0 +1,183 @@
<?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</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>getdown</name>
<description>An application installer and updater.</description>
<url>http://code.google.com/p/getdown/</url>
<issueManagement>
<url>http://code.google.com/p/getdown/issues/list</url>
</issueManagement>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>5</version>
</parent>
<licenses>
<license>
<name>GNU Lesser General Public License (LGPL), Version 2.1</name>
<url>http://www.fsf.org/licensing/licenses/lgpl.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>samskivert</id>
<name>Michael Bayne</name>
<email>mdb@samskivert.com</email>
</developer>
</developers>
<scm>
<connection>scm:svn:http://getdown.googlecode.com/svn/trunk/</connection>
<developerConnection>scm:svn:https://getdown.googlecode.com/svn/trunk/</developerConnection>
<url>http://getdown.googlecode.com/svn/trunk/</url>
</scm>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<scope>compile</scope>
<optional>true</optional>
<exclusions>
<exclusion><groupId>javax.mail</groupId><artifactId>mail</artifactId></exclusion>
<exclusion><groupId>javax.jms</groupId><artifactId>jms</artifactId></exclusion>
<exclusion><groupId>com.sun.jdmk</groupId><artifactId>jmxtools</artifactId></exclusion>
<exclusion><groupId>com.sun.jmx</groupId><artifactId>jmxri</artifactId></exclusion>
<exclusion><groupId>oro</groupId><artifactId>oro</artifactId></exclusion>
<exclusion><groupId>junit</groupId><artifactId>junit</artifactId></exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard</artifactId>
<version>4.4</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.samskivert</groupId>
<artifactId>samskivert</artifactId>
<version>1.0</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>net.sourceforge.retroweaver</groupId>
<artifactId>retroweaver</artifactId>
<version>2.0.7</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.7.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jregistrykey</groupId>
<artifactId>jregistrykey</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jRegistryKey.jar</systemPath>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>RELEASE</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<fork>true</fork>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<!-- yes, those quoted spaces are a workaround sanctioned by the Maven idiocracy -->
<compilerArgument>-Xlint" "-Xlint:-serial" "-Xlint:-path</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>RELEASE</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>RELEASE</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>RELEASE</version>
<configuration>
<quiet>true</quiet>
<show>public</show>
<links>
<link>http://java.sun.com/products/javamail/javadocs/</link>
<link>http://download.oracle.com/javaee/1.2.1/api/</link>
</links>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>RELEASE</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<keyname>mdb@samskivert.com</keyname>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>RELEASE</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>RELEASE</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>RELEASE</version>
</plugin>
</plugins>
</build>
</project>