|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- You may freely edit this file. See commented blocks below for --> |
| 3 | +<!-- some examples of how to customize the build. --> |
| 4 | +<!-- (If you delete it and reopen the project it will be recreated.) --> |
| 5 | +<!-- By default, only the Clean and Build commands use this build script. --> |
| 6 | +<!-- Commands such as Run, Debug, and Test only use this build script if --> |
| 7 | +<!-- the Compile on Save feature is turned off for the project. --> |
| 8 | +<!-- You can turn off the Compile on Save (or Deploy on Save) setting --> |
| 9 | +<!-- in the project's Project Properties dialog box.--> |
| 10 | +<project name="WebTerminal" default="default" basedir="."> |
| 11 | + <description>Builds, tests, and runs the project WebTerminal.</description> |
| 12 | + <import file="nbproject/build-impl.xml"/> |
| 13 | + <property name="build.dir" value="build"/> |
| 14 | + <property name="dist.dir" value="dist"/> |
| 15 | + <property name="run.jvmargs" value="-Djava.library.path=${dist.dir}"/> |
| 16 | + |
| 17 | + <!-- |
| 18 | +
|
| 19 | + There exist several targets which are by default empty and which can be |
| 20 | + used for execution of your tasks. These targets are usually executed |
| 21 | + before and after some main targets. They are: |
| 22 | +
|
| 23 | + -pre-init: called before initialization of project properties |
| 24 | + -post-init: called after initialization of project properties |
| 25 | + -pre-compile: called before javac compilation |
| 26 | + -post-compile: called after javac compilation |
| 27 | + -pre-compile-single: called before javac compilation of single file |
| 28 | + -post-compile-single: called after javac compilation of single file |
| 29 | + -pre-compile-test: called before javac compilation of JUnit tests |
| 30 | + -post-compile-test: called after javac compilation of JUnit tests |
| 31 | + -pre-compile-test-single: called before javac compilation of single JUnit test |
| 32 | + -post-compile-test-single: called after javac compilation of single JUunit test |
| 33 | + -pre-jar: called before JAR building |
| 34 | + -post-jar: called after JAR building |
| 35 | + -post-clean: called after cleaning build products |
| 36 | +
|
| 37 | + (Targets beginning with '-' are not intended to be called on their own.) |
| 38 | +
|
| 39 | + Example of inserting an obfuscator after compilation could look like this: |
| 40 | +
|
| 41 | + <target name="-post-compile"> |
| 42 | + <obfuscate> |
| 43 | + <fileset dir="${build.classes.dir}"/> |
| 44 | + </obfuscate> |
| 45 | + </target> |
| 46 | +
|
| 47 | + For list of available properties check the imported |
| 48 | + nbproject/build-impl.xml file. |
| 49 | +
|
| 50 | +
|
| 51 | + Another way to customize the build is by overriding existing main targets. |
| 52 | + The targets of interest are: |
| 53 | +
|
| 54 | + -init-macrodef-javac: defines macro for javac compilation |
| 55 | + -init-macrodef-junit: defines macro for junit execution |
| 56 | + -init-macrodef-debug: defines macro for class debugging |
| 57 | + -init-macrodef-java: defines macro for class execution |
| 58 | + -do-jar-with-manifest: JAR building (if you are using a manifest) |
| 59 | + -do-jar-without-manifest: JAR building (if you are not using a manifest) |
| 60 | + run: execution of project |
| 61 | + -javadoc-build: Javadoc generation |
| 62 | + test-report: JUnit report generation |
| 63 | +
|
| 64 | + An example of overriding the target for project execution could look like this: |
| 65 | +
|
| 66 | + <target name="run" depends="WebTerminal-impl.jar"> |
| 67 | + <exec dir="bin" executable="launcher.exe"> |
| 68 | + <arg file="${dist.jar}"/> |
| 69 | + </exec> |
| 70 | + </target> |
| 71 | +
|
| 72 | + Notice that the overridden target depends on the jar target and not only on |
| 73 | + the compile target as the regular run target does. Again, for a list of available |
| 74 | + properties which you can use, check the target you are overriding in the |
| 75 | + nbproject/build-impl.xml file. |
| 76 | +
|
| 77 | + --> |
| 78 | + |
| 79 | + <target name="default" depends="test,jar,install-terminfo,javadoc" |
| 80 | + description="Build and test whole project."/> |
| 81 | + |
| 82 | + <target name="all" depends="test,jar,native,install-terminfo,javadoc" |
| 83 | + description="Build and test whole project."/> |
| 84 | + |
| 85 | + <property name="jheaders.dir" value="${build.dir}/include"/> |
| 86 | + |
| 87 | + <target name="jheaders" depends="jar"> |
| 88 | + <mkdir dir="${jheaders.dir}" /> |
| 89 | + <javah destdir="${jheaders.dir}" classpath="build/classes" force="yes"> |
| 90 | + <class name="ptyconsole.PTY"/> |
| 91 | + </javah> |
| 92 | + </target> |
| 93 | + |
| 94 | + <target name="compile-native" unless="cross.platform" > |
| 95 | + <exec executable="make" failonerror="true" dir="native"> |
| 96 | + <arg value="JDK_HOME=${JAVA_HOME}"/> |
| 97 | + <arg value="DIST_DIR=../${dist.dir}"/> |
| 98 | + <arg value="BUILD_DIR=../${build.dir}"/> |
| 99 | + <arg value="EXTRA_CFLAGS=${extra_cflags}"/> |
| 100 | + <arg value="EXTRA_LDFLAGS=${extra_ldflags}"/> |
| 101 | + <arg value="all"/> |
| 102 | + </exec> |
| 103 | + </target> |
| 104 | + |
| 105 | + <target name="compile-native-cross" if="cross.platform" > |
| 106 | + <exec executable="make" failonerror="true" dir="native"> |
| 107 | + <arg value="JDK_HOME=${platform.home}"/> |
| 108 | + <arg value="DIST_DIR=${native.cross.dist.dir}"/> |
| 109 | + <arg value="BUILD_DIR=${native.cross.build.dir}"/> |
| 110 | + <arg value="CC=${crosstools.gcc}"/> |
| 111 | + <arg value="EXTRA_CFLAGS=${crosstools.extra_cflags}"/> |
| 112 | + <arg value="EXTRA_LDFLAGS=${crosstools.extra_ldflags}"/> |
| 113 | + <arg value="LINK=${crosstools.gcc}"/> |
| 114 | + <arg value="all"/> |
| 115 | + </exec> |
| 116 | + </target> |
| 117 | + |
| 118 | + <target name="native" depends="jheaders, compile-native, compile-native-cross"/> |
| 119 | + |
| 120 | + <target name="install-terminfo"> |
| 121 | + <copy file="terminfo/j/jfxterm" todir="${dist.dir}/j"/> |
| 122 | + </target> |
| 123 | + |
| 124 | + <target depends="init,compile" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" description="Run a main class." name="run-main"> |
| 125 | + <!-- Run an application (i.e. a class with a "main" method in a |
| 126 | + WebTerminal, redirecting System.in, System.out, and System.err. |
| 127 | +
|
| 128 | + Set -Drunmain.classpath=EXTRA_PATH to expand the classpath. |
| 129 | + --> |
| 130 | + <j2seproject1:java classname="webterminal.RunInConsole" |
| 131 | + classpath="${run.classpath}:${runmain.classpath}"> |
| 132 | + <customize> |
| 133 | + <arg line="${runmain.class} ${runmain.args}"/> |
| 134 | + </customize> |
| 135 | + </j2seproject1:java> |
| 136 | + </target> |
| 137 | + |
| 138 | + <target depends="init,compile" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" description="Run in a PTY." name="run-pty"> |
| 139 | + <j2seproject1:java classname="ptyconsole.App" |
| 140 | + classpath="${run.classpath}:${runmain.classpath}"> |
| 141 | + <customize> |
| 142 | + <arg line=""/> |
| 143 | + </customize> |
| 144 | + </j2seproject1:java> |
| 145 | + </target> |
| 146 | + |
| 147 | +</project> |
0 commit comments