Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

274 lines (226 sloc) 11.263 kB
<?xml version="1.0" encoding="UTF-8"?>
<project name="mcpatcher" default="all">
<property file="mcpatcher.properties" />
<taskdef resource="proguard/ant/task.properties"
classpath="${proguard.dir}\lib\proguard.jar" />
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar
:${launch4j.dir}/lib/xstream.jar" />
<!-- Uncomment the following property if no tests compilation is needed -->
<property name="skip.tests" value="true"/>
<!-- Compiler options -->
<property name="compiler.debug" value="on"/>
<property name="compiler.generate.no.warnings" value="off"/>
<property name="compiler.args" value="-target 1.5"/>
<property name="compiler.max.memory" value="128m"/>
<patternset id="ignored.files">
<exclude name="**/CVS/**"/>
<exclude name="**/SCCS/**"/>
<exclude name="**/RCS/**"/>
<exclude name="**/rcs/**"/>
<exclude name="**/.DS_Store/**"/>
<exclude name="**/.svn/**"/>
<exclude name="**/.pyc/**"/>
<exclude name="**/.pyo/**"/>
<exclude name="**/*.pyc/**"/>
<exclude name="**/*.pyo/**"/>
<exclude name="**/.git/**"/>
<exclude name="**/*.hprof/**"/>
<exclude name="**/_svn/**"/>
<exclude name="**/.hg/**"/>
</patternset>
<patternset id="library.patterns">
<include name="*.zip"/>
<include name="*.war"/>
<include name="*.egg"/>
<include name="*.ear"/>
<include name="*.swc"/>
<include name="*.jar"/>
</patternset>
<patternset id="compiler.resources">
<include name="**/?*.properties"/>
<include name="**/?*.xml"/>
<include name="**/?*.gif"/>
<include name="**/?*.png"/>
<include name="**/?*.jpeg"/>
<include name="**/?*.jpg"/>
<include name="**/?*.html"/>
<include name="**/?*.dtd"/>
<include name="**/?*.tld"/>
<include name="**/?*.ftl"/>
</patternset>
<!-- JDK definitions -->
<property name="jdk.bin.1.6" value="${jdk.home.1.6}/bin"/>
<path id="jdk.classpath.1.6">
<fileset dir="${jdk.home.1.6}">
<include name="jre/lib/alt-rt.jar"/>
<include name="jre/lib/charsets.jar"/>
<include name="jre/lib/deploy.jar"/>
<include name="jre/lib/javaws.jar"/>
<include name="jre/lib/jce.jar"/>
<include name="jre/lib/jsse.jar"/>
<include name="jre/lib/management-agent.jar"/>
<include name="jre/lib/plugin.jar"/>
<include name="jre/lib/resources.jar"/>
<include name="jre/lib/rt.jar"/>
<include name="jre/lib/ext/dnsns.jar"/>
<include name="jre/lib/ext/localedata.jar"/>
<include name="jre/lib/ext/sunjce_provider.jar"/>
<include name="jre/lib/ext/sunmscapi.jar"/>
<include name="jre/lib/ext/sunpkcs11.jar"/>
</fileset>
</path>
<property name="project.jdk.home" value="${jdk.home.1.6}"/>
<property name="project.jdk.bin" value="${jdk.bin.1.6}"/>
<property name="project.jdk.classpath" value="jdk.classpath.1.6"/>
<!-- Project Libraries -->
<path id="library.javassist.classpath">
<pathelement location="${javassist.dir}/javassist.jar"/>
</path>
<path id="library.unrar.classpath">
<pathelement location="${junrar.dir}/junrar.jar"/>
</path>
<path id="library.jgoodies.classpath">
<pathelement location="${basedir}/lib/junit-3.8.2.jar"/>
<pathelement location="${basedir}/lib/forms-1.2.1.jar"/>
</path>
<path id="library.intellij.forms.classpath">
<pathelement location="${javac2.home}/forms_rt.jar"/>
</path>
<!-- Register Custom Compiler Taskdefs -->
<property name="javac2.home" value="${idea.home}/lib"/>
<path id="javac2.classpath">
<pathelement location="${javac2.home}/javac2.jar"/>
<pathelement location="${javac2.home}/jdom.jar"/>
<pathelement location="${javac2.home}/asm.jar"/>
<pathelement location="${javac2.home}/asm-commons.jar"/>
<pathelement location="${javac2.home}/jgoodies-forms.jar"/>
</path>
<target name="register.custom.compilers">
<taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="javac2.classpath"/>
<taskdef name="instrumentIdeaExtensions" classname="com.intellij.ant.InstrumentIdeaExtensions" classpathref="javac2.classpath"/>
</target>
<!-- Modules -->
<!-- Module mcpatcher -->
<dirname property="module.mcpatcher.basedir" file="${ant.file}"/>
<property name="module.jdk.home.mcpatcher" value="${project.jdk.home}"/>
<property name="module.jdk.bin.mcpatcher" value="${project.jdk.bin}"/>
<property name="module.jdk.classpath.mcpatcher" value="${project.jdk.classpath}"/>
<property name="compiler.args.mcpatcher" value="${compiler.args}"/>
<property name="mcpatcher.output.dir" value="${module.mcpatcher.basedir}/out/production/mcpatcher"/>
<property name="mcpatcher.testoutput.dir" value="${module.mcpatcher.basedir}/out/test/mcpatcher"/>
<path id="mcpatcher.module.bootclasspath">
<!-- Paths to be included in compilation bootclasspath -->
</path>
<path id="mcpatcher.module.production.classpath">
<path refid="${module.jdk.classpath.mcpatcher}"/>
<path refid="library.javassist.classpath"/>
<path refid="library.jgoodies.classpath"/>
<path refid="library.unrar.classpath"/>
<path refid="library.intellij.forms.classpath"/>
</path>
<path id="mcpatcher.runtime.production.module.classpath">
<pathelement location="${mcpatcher.output.dir}"/>
<path refid="library.javassist.classpath"/>
<path refid="library.jgoodies.classpath"/>
<path refid="library.unrar.classpath"/>
<path refid="library.intellij.forms.classpath"/>
</path>
<path id="mcpatcher.module.classpath">
<path refid="${module.jdk.classpath.mcpatcher}"/>
<pathelement location="${mcpatcher.output.dir}"/>
<path refid="library.javassist.classpath"/>
<path refid="library.jgoodies.classpath"/>
<path refid="library.unrar.classpath"/>
<path refid="library.intellij.forms.classpath"/>
</path>
<path id="mcpatcher.runtime.module.classpath">
<pathelement location="${mcpatcher.testoutput.dir}"/>
<pathelement location="${mcpatcher.output.dir}"/>
<path refid="library.javassist.classpath"/>
<path refid="library.jgoodies.classpath"/>
<path refid="library.unrar.classpath"/>
<path refid="library.intellij.forms.classpath"/>
</path>
<patternset id="excluded.from.module.mcpatcher">
<patternset refid="ignored.files"/>
</patternset>
<patternset id="excluded.from.compilation.mcpatcher">
<patternset refid="excluded.from.module.mcpatcher"/>
</patternset>
<path id="mcpatcher.module.sourcepath">
<dirset dir="${module.mcpatcher.basedir}">
<include name="src"/>
</dirset>
</path>
<target name="compile.module.mcpatcher" depends="compile.module.mcpatcher.production,compile.module.mcpatcher.tests" description="Compile module mcpatcher"/>
<target name="compile.module.mcpatcher.production" depends="register.custom.compilers" description="Compile module mcpatcher; production classes">
<mkdir dir="${mcpatcher.output.dir}"/>
<javac2 destdir="${mcpatcher.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.mcpatcher}/javac">
<compilerarg line="${compiler.args.mcpatcher}"/>
<bootclasspath refid="mcpatcher.module.bootclasspath"/>
<classpath refid="mcpatcher.module.production.classpath"/>
<src refid="mcpatcher.module.sourcepath"/>
<patternset refid="excluded.from.compilation.mcpatcher"/>
</javac2>
<copy todir="${mcpatcher.output.dir}">
<fileset dir="${module.mcpatcher.basedir}/src">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="compile.module.mcpatcher.tests" depends="register.custom.compilers,compile.module.mcpatcher.production" description="compile module mcpatcher; test classes" unless="skip.tests"/>
<target name="clean.module.mcpatcher" description="cleanup module">
<delete dir="${mcpatcher.output.dir}"/>
<delete dir="${mcpatcher.testoutput.dir}"/>
</target>
<target name="init" description="Build initialization">
<!-- Perform any build initialization in this target -->
</target>
<target name="clean" depends="clean.module.mcpatcher" description="cleanup all"/>
<target name="build.modules" depends="init, clean, compile.module.mcpatcher" description="build all modules"/>
<target name="init.artifacts">
<property name="artifacts.temp.dir" value="${basedir}/__artifacts_temp"/>
<property name="artifact.output.mcpatcher:jar" value="${basedir}/out/artifacts/mcpatcher_jar"/>
<mkdir dir="${artifacts.temp.dir}"/>
<property name="temp.jar.path.mcpatcher.jar" value="${artifacts.temp.dir}/mcpatcher.jar"/>
</target>
<target name="artifact.mcpatcher:jar" depends="init.artifacts, compile.module.mcpatcher" description="Build &apos;mcpatcher:jar&apos; artifact">
<property name="artifact.temp.output.mcpatcher:jar" value="${artifacts.temp.dir}/mcpatcher_jar"/>
<mkdir dir="${artifact.temp.output.mcpatcher:jar}"/>
<jar destfile="${temp.jar.path.mcpatcher.jar}"
duplicate="preserve"
manifest="${basedir}/src/META-INF/MANIFEST.MF"
filesetmanifest="skip">
<zipfileset dir="${mcpatcher.output.dir}"/>
<zipfileset src="${javassist.dir}/javassist.jar" excludes="**/*.txt,**/*.html,**/README,**/LICENSE,**/maven/"/>
<zipfileset src="${basedir}/lib/forms-1.2.1.jar" excludes="**/*.txt,**/*.html,**/README,**/LICENSE,**/maven/"/>
<zipfileset src="${junrar.dir}/junrar.jar" excludes="**/*.txt,**/*.html,**/README,**/LICENSE,**/.idea/,**/maven/" />
<zipfileset src="${idea.home}/lib/forms_rt.jar" excludes="**/*.txt,**/*.html,**/README,**/LICENSE,**/.idea/,**/maven/" />
</jar>
<!--<copy file="${temp.jar.path.mcpatcher.jar}" tofile="${artifact.temp.output.mcpatcher:jar}/mcpatcher.jar"/> -->
<proguard configuration="mcpatcher.pro">
<injar path="${temp.jar.path.mcpatcher.jar}" />
<outjar path="${artifact.temp.output.mcpatcher:jar}/mcpatcher-pg.jar" />
</proguard>
<jar destfile="${artifact.temp.output.mcpatcher:jar}/mcpatcher.jar"
filesetmanifest="merge">
<zipfileset src="${artifact.temp.output.mcpatcher:jar}/mcpatcher-pg.jar"/>
<zipfileset dir="${mcpatcher.output.dir}/../newcode" prefix="newcode/"/>
</jar>
<launch4j configFile="mcpatcher-l4j.xml"
jar="${artifact.temp.output.mcpatcher:jar}/mcpatcher.jar"
outfile="${artifact.temp.output.mcpatcher:jar}/mcpatcher.exe" />
</target>
<target name="build.all.artifacts" depends="artifact.mcpatcher:jar" description="Build all artifacts">
<mkdir dir="${artifact.output.mcpatcher:jar}"/>
<copy todir="${artifact.output.mcpatcher:jar}">
<fileset dir="${artifact.temp.output.mcpatcher:jar}"/>
</copy>
<!-- Delete temporary files -->
<delete dir="${artifacts.temp.dir}"/>
</target>
<target name="all" depends="build.modules, build.all.artifacts" description="build all"/>
</project>
Jump to Line
Something went wrong with that request. Please try again.