bulid file updated

- compilation step included (main module only) to allow command-line build
- Apple JDK support added to obfuscator step
- main targets grouped at file start for better readability
This commit is contained in:
Roman Shevchenko 2014-05-19 17:01:18 +04:00
parent 78ef309b3e
commit ddffcf6f94

142
build.xml
View File

@ -2,9 +2,9 @@
<project name="Fernflower" default="buildAll" basedir=".">
<taskdef resource="proguard/ant/task.properties"
<taskdef resource="proguard/ant/task.properties"
classpath="${basedir}/lib/proguard_4_11.jar" />
<taskdef name="javancss"
classname="javancss.JavancssAntTask">
<classpath>
@ -14,26 +14,33 @@
<pathelement location="${basedir}/lib/ncss/ccl.jar"/>
</classpath>
</taskdef>
<target name="init" description="initialization">
<property name="jar.file" value="fernflower.jar" />
<property name="timer.jar.file" value="timer.jar" />
<property name="src" value="${basedir}/src" />
<property name="bin" value="${basedir}/bin" />
<property name="lib" value="${basedir}/lib" />
<property name="fulldist" value="${basedir}/dist/full" />
<property name="obfuscateddist" value="${basedir}/dist/obfuscated" />
<property name="tomcat" value="C:/revjava/apache-tomcat-5.5.27/shared/lib/" />
<property name="webwrapper" value="D:/Nonbku/workspace/webwrapper/lib/" />
</target>
<target name="buildAll" depends="init, jar, obfuscate" description="build full distribution paket"/>
<target name="timer" depends="init" description="generate timer jar file">
<jar jarfile="${lib}/timer/${timer.jar.file}" compress="true" basedir="${bin}" includes="com/**/*.class,*.class"/>
</target>
<target name="buildAll" depends="jar, obfuscate" description="build full distribution packet"/>
<target name="jar" depends="init" description="generate jar file">
<target name="clean" depends="init">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${bin}"/>
<fileset dir="${fulldist}"/>
<fileset dir="${obfuscateddist}"/>
</delete>
</target>
<target name="compile" depends="clean" description="compile sources (main module only)">
<mkdir dir="${bin}"/>
<javac srcdir="${src}" destdir="${bin}" source="1.6" target="1.6" encoding="UTF-8"/>
</target>
<target name="jar" depends="compile" description="generate jar file">
<jar jarfile="${fulldist}/${jar.file}" compress="true" basedir="${bin}" includes="**/*.class" excludes="test/**/*.*,com/**/*.*,*.class">
<manifest>
<attribute name="Main-Class" value="de.fernflower.main.decompiler.ConsoleDecompiler"/>
@ -41,57 +48,64 @@
</jar>
</target>
<target name="deploy" depends="jar" description="deploy generated jar file to Tomcat">
<copy todir="${webwrapper}" file="${fulldist}/${jar.file}" overwrite="true"/>
<copy todir="${tomcat}" file="${fulldist}/${jar.file}" overwrite="true"/>
</target>
<target name="loc" description="count lines of code">
<javancss srcdir="${basedir}/src"
generateReport="true"
functionMetrics="false"
classMetrics="false"
includes="**/*.java"
excludes="**/test/**,**/de/fernflower/code/instructions/**,**/timer/**"
/>
</target>
<target name="obfuscate" description="Call Proguard on Fernflower">
<!-- 4.0.1 -->
<proguard>
<target name="obfuscate" depends="init" description="Call Proguard on Fernflower">
<condition property="rt_jar" value="${java.home}/../Classes/classes.jar" else="${java.home}/lib/rt.jar">
<contains string="${java.vendor}" substring="Apple"/>
</condition>
<proguard>
-injars "${fulldist}/${jar.file}"
-outjars "${obfuscateddist}/${jar.file}"
-libraryjars "${rt_jar}"
-injars "${fulldist}/${jar.file}"
-outjars "${obfuscateddist}/${jar.file}"
-libraryjars "${java.home}/lib/rt.jar"
-forceprocessing
-repackageclasses
<!-- -allowaccessmodification -->
-forceprocessing
-repackageclasses
<!-- -allowaccessmodification -->
-optimizationpasses 5
-keep public class de.fernflower.main.decompiler.ConsoleDecompiler {
public protected *;
}
-optimizationpasses 5
-keep public class de.fernflower.main.decompiler.EclipseDecompiler {
public protected *;
}
-keep public class de.fernflower.main.decompiler.ConsoleDecompiler {
public protected *;
}
-keep public class de.fernflower.main.decompiler.EclipseDecompiler {
public protected *;
}
-keep public class de.fernflower.main.extern.* {
public protected *;
}
<!--
-keep public class de.fernflower.code.instructions.* {
public protected *;
}
-->
</proguard>
</target>
<!-- Helper targets -->
<target name="timer" depends="init" description="generate timer jar file">
<jar jarfile="${lib}/timer/${timer.jar.file}" compress="true" basedir="${bin}" includes="com/**/*.class,*.class"/>
</target>
<target name="deploy" depends="jar" description="deploy generated jar file to Tomcat">
<property name="tomcat" value="C:/revjava/apache-tomcat-5.5.27/shared/lib/" />
<property name="webwrapper" value="D:/Nonbku/workspace/webwrapper/lib/" />
<copy todir="${webwrapper}" file="${fulldist}/${jar.file}" overwrite="true"/>
<copy todir="${tomcat}" file="${fulldist}/${jar.file}" overwrite="true"/>
</target>
<target name="loc" description="count lines of code">
<javancss srcdir="${basedir}/src"
generateReport="true"
functionMetrics="false"
classMetrics="false"
includes="**/*.java"
excludes="**/test/**,**/de/fernflower/code/instructions/**,**/timer/**"
/>
</target>
-keep public class de.fernflower.main.extern.* {
public protected *;
}
<!--
-keep public class de.fernflower.code.instructions.* {
public protected *;
}
-->
</proguard>
</target>
<target name="printunused" depends="init" description="Print unused code">
<proguard>
@ -108,7 +122,7 @@
public *;
}
-->
-keep public class de.fernflower.main.decompiler.ConsoleDecompiler {
public protected *;
}
@ -123,9 +137,9 @@
<!--
-keep public class de.fernflower.code.instructions.*
-->
-->
</proguard>
</target>
</project>
</project>