Changeset 125 in tmcsimulator-scriptbuilder
- Timestamp:
- 09/26/2017 09:31:52 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/build.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/build.xml
r8 r125 36 36 </propertyfile> 37 37 </target> 38 <!-- 38 <target name="package-jars" depends="jar"> 39 39 40 There exist several targets which are by default empty and which can be 41 used for execution of your tasks. These targets are usually executed 42 before and after some main targets. They are: 43 44 -pre-init: called before initialization of project properties 45 -post-init: called after initialization of project properties 46 -pre-compile: called before javac compilation 47 -post-compile: called after javac compilation 48 -pre-compile-single: called before javac compilation of single file 49 -post-compile-single: called after javac compilation of single file 50 -pre-compile-test: called before javac compilation of JUnit tests 51 -post-compile-test: called after javac compilation of JUnit tests 52 -pre-compile-test-single: called before javac compilation of single JUnit test 53 -post-compile-test-single: called after javac compilation of single JUunit test 54 -pre-jar: called before JAR building 55 -post-jar: called after JAR building 56 -post-clean: called after cleaning build products 57 58 (Targets beginning with '-' are not intended to be called on their own.) 59 60 Example of inserting an obfuscator after compilation could look like this: 61 62 <target name="-post-compile"> 63 <obfuscate> 64 <fileset dir="${build.classes.dir}"/> 65 </obfuscate> 66 </target> 67 68 For list of available properties check the imported 69 nbproject/build-impl.xml file. 40 <!-- Change the value of this property to be the name of your JAR, 41 minus the .jar extension. It should not have spaces. 42 <property name="deploy.jar.name" value="MyJarName"/> 43 --> 44 <property name="deploy.jar.name" value="ScriptBuilder"/> 70 45 71 46 72 Another way to customize the build is by overriding existing main targets. 73 The targets of interest are: 47 <!-- don't edit below this line --> 74 48 75 -init-macrodef-javac: defines macro for javac compilation 76 -init-macrodef-junit: defines macro for junit execution 77 -init-macrodef-debug: defines macro for class debugging 78 -init-macrodef-java: defines macro for class execution 79 -do-jar: JAR building 80 run: execution of project 81 -javadoc-build: Javadoc generation 82 test-report: JUnit report generation 49 <property name="deploy.dir" value="deploy"/> 50 <property name="deploy.jar" value="${deploy.dir}/${deploy.jar.name}.jar"/> 83 51 84 An example of overriding the target for project execution could look like this:52 <echo message="Packaging ${application.title} into a single JAR at ${deploy.jar}"/> 85 53 86 <target name="run" depends="ScriptBuilder_Repo-impl.jar"> 87 <exec dir="bin" executable="launcher.exe"> 88 <arg file="${dist.jar}"/> 89 </exec> 90 </target> 54 <delete dir="${deploy.dir}"/> 55 <mkdir dir="${deploy.dir}"/> 91 56 92 Notice that the overridden target depends on the jar target and not only on 93 the compile target as the regular run target does. Again, for a list of available 94 properties which you can use, check the target you are overriding in the 95 nbproject/build-impl.xml file. 57 <jar destfile="${deploy.dir}/temp_final.jar" filesetmanifest="skip"> 58 <zipgroupfileset dir="dist" includes="*.jar"/> 59 <zipgroupfileset dir="dist/lib" includes="*.jar"/> 96 60 97 --> 61 <manifest> 62 <attribute name="Main-Class" value="${main.class}"/> 63 </manifest> 64 </jar> 65 66 <zip destfile="${deploy.jar}"> 67 <zipfileset src="${deploy.dir}/temp_final.jar" 68 excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/> 69 </zip> 70 71 <delete file="${deploy.dir}/temp_final.jar"/> 72 73 </target> 98 74 </project>
Note: See TracChangeset
for help on using the changeset viewer.
