@ -2,7 +2,7 @@
<project name= "Fernflower" default= "buildAll" basedir= "." >
<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" />
classpath="${basedir}/lib/proguard_4_11.jar" />
<taskdef name= "javancss"
<taskdef name= "javancss"
@ -18,22 +18,29 @@
<target name= "init" description= "initialization" >
<target name= "init" description= "initialization" >
<property name= "jar.file" value= "fernflower.jar" />
<property name= "jar.file" value= "fernflower.jar" />
<property name= "timer.jar.file" value= "timer.jar" />
<property name= "timer.jar.file" value= "timer.jar" />
<property name= "src" value= "${basedir}/src" />
<property name= "bin" value= "${basedir}/bin" />
<property name= "bin" value= "${basedir}/bin" />
<property name= "lib" value= "${basedir}/lib" />
<property name= "lib" value= "${basedir}/lib" />
<property name= "fulldist" value= "${basedir}/dist/full" />
<property name= "fulldist" value= "${basedir}/dist/full" />
<property name= "obfuscateddist" value= "${basedir}/dist/obfuscated" />
<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>
<target name= "buildAll" depends= "init, jar, obfuscate" description= "build full distribution paket" />
<target name= "buildAll" depends= "jar, obfuscate" description= "build full distribution packet" />
<target name= "timer" depends= "init" description= "generate timer jar file" >
<target name= "clean" depends= "init" >
<jar jarfile= "${lib}/timer/${timer.jar.file}" compress= "true" basedir= "${bin}" includes= "com/**/*.class,*.class" />
<delete includeemptydirs= "true" failonerror= "false" >
</target>
<fileset dir= "${bin}" />
<fileset dir= "${fulldist}" />
<fileset dir= "${obfuscateddist}" />
</delete>
</target>
<target name= "jar" depends= "init" description= "generate jar file" >
<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" >
<jar jarfile= "${fulldist}/${jar.file}" compress= "true" basedir= "${bin}" includes= "**/*.class" excludes= "test/**/*.*,com/**/*.*,*.class" >
<manifest >
<manifest >
<attribute name= "Main-Class" value= "de.fernflower.main.decompiler.ConsoleDecompiler" />
<attribute name= "Main-Class" value= "de.fernflower.main.decompiler.ConsoleDecompiler" />
@ -41,56 +48,63 @@
</jar>
</jar>
</target>
</target>
<target name= "deploy" depends= "jar" description= "deploy generated jar file to Tomcat" >
<target name= "obfuscate" depends= "init" description= "Call Proguard on Fernflower" >
<copy todir= "${webwrapper}" file= "${fulldist}/${jar.file}" overwrite= "true" />
<condition property= "rt_jar" value= "${java.home}/../Classes/classes.jar" else= "${java.home}/lib/rt.jar" >
<copy todir= "${tomcat}" file= "${fulldist}/${jar.file}" overwrite= "true" />
<contains string= "${java.vendor}" substring= "Apple" />
</target>
</condition>
<proguard >
<target name= "loc" description= "count lines of code" >
-injars "${fulldist}/${jar.file}"
<javancss srcdir= "${basedir}/src"
-outjars "${obfuscateddist}/${jar.file}"
generateReport="true"
-libraryjars "${rt_jar}"
functionMetrics="false"
classMetrics="false"
-forceprocessing
includes="**/*.java"
-repackageclasses
excludes="**/test/**,**/de/fernflower/code/instructions/**,**/timer/**"
<!-- - allowaccessmodification -->
/>
</target>
-optimizationpasses 5
-keep public class de.fernflower.main.decompiler.ConsoleDecompiler {
<target name= "obfuscate" description= "Call Proguard on Fernflower" >
public protected *;
<!-- 4.0.1 -->
}
<proguard >
-keep public class de.fernflower.main.decompiler.EclipseDecompiler {
-injars "${fulldist}/${jar.file}"
public protected *;
-outjars "${obfuscateddist}/${jar.file}"
}
-libraryjars "${java.home}/lib/rt.jar"
-keep public class de.fernflower.main.extern.* {
-forceprocessing
public protected *;
-repackageclasses
}
<!-- - allowaccessmodification -->
<!--
-optimizationpasses 5
-keep public class de.fernflower.code.instructions.* {
public protected *;
-keep public class de.fernflower.main.decompiler.ConsoleDecompiler {
}
public protected *;
-->
}
</proguard>
</target>
-keep public class de.fernflower.main.decompiler.EclipseDecompiler {
public protected *;
<!-- Helper targets -->
}
<target name= "timer" depends= "init" description= "generate timer jar file" >
-keep public class de.fernflower.main.extern.* {
<jar jarfile= "${lib}/timer/${timer.jar.file}" compress= "true" basedir= "${bin}" includes= "com/**/*.class,*.class" />
public protected *;
</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/" />
-keep public class de.fernflower.code.instructions.* {
<property name= "webwrapper" value= "D:/Nonbku/workspace/webwrapper/lib/" />
public protected *;
<copy todir= "${webwrapper}" file= "${fulldist}/${jar.file}" overwrite= "true" />
}
<copy todir= "${tomcat}" file= "${fulldist}/${jar.file}" overwrite= "true" />
-->
</target>
</proguard>
<target name= "loc" description= "count lines of code" >
</target>
<javancss srcdir= "${basedir}/src"
generateReport="true"
functionMetrics="false"
classMetrics="false"
includes="**/*.java"
excludes="**/test/**,**/de/fernflower/code/instructions/**,**/timer/**"
/>
</target>
<target name= "printunused" depends= "init" description= "Print unused code" >
<target name= "printunused" depends= "init" description= "Print unused code" >
<proguard >
<proguard >