|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<project name="jshell" default="all"> |
| 3 | + |
| 4 | + |
| 5 | + <property file="jshell.properties"/> |
| 6 | + <!-- Uncomment the following property if no tests compilation is needed --> |
| 7 | + <!-- |
| 8 | + <property name="skip.tests" value="true"/> |
| 9 | + --> |
| 10 | + |
| 11 | + <!-- Compiler options --> |
| 12 | + |
| 13 | + <property name="compiler.debug" value="on"/> |
| 14 | + <property name="compiler.generate.no.warnings" value="off"/> |
| 15 | + <property name="compiler.args" value=""/> |
| 16 | + <property name="compiler.max.memory" value="700m"/> |
| 17 | + <patternset id="ignored.files"> |
| 18 | + <exclude name="**/CVS/**"/> |
| 19 | + <exclude name="**/SCCS/**"/> |
| 20 | + <exclude name="**/RCS/**"/> |
| 21 | + <exclude name="**/rcs/**"/> |
| 22 | + <exclude name="**/.DS_Store/**"/> |
| 23 | + <exclude name="**/.svn/**"/> |
| 24 | + <exclude name="**/.pyc/**"/> |
| 25 | + <exclude name="**/.pyo/**"/> |
| 26 | + <exclude name="**/*.pyc/**"/> |
| 27 | + <exclude name="**/*.pyo/**"/> |
| 28 | + <exclude name="**/.git/**"/> |
| 29 | + <exclude name="**/*.hprof/**"/> |
| 30 | + <exclude name="**/_svn/**"/> |
| 31 | + <exclude name="**/.hg/**"/> |
| 32 | + <exclude name="**/*~/**"/> |
| 33 | + <exclude name="**/__pycache__/**"/> |
| 34 | + <exclude name="**/*.rbc/**"/> |
| 35 | + <exclude name="**/vssver.scc/**"/> |
| 36 | + <exclude name="**/vssver2.scc/**"/> |
| 37 | + </patternset> |
| 38 | + <patternset id="library.patterns"> |
| 39 | + <include name="*.egg"/> |
| 40 | + <include name="*.jar"/> |
| 41 | + <include name="*.ear"/> |
| 42 | + <include name="*.swc"/> |
| 43 | + <include name="*.war"/> |
| 44 | + <include name="*.ane"/> |
| 45 | + <include name="*.zip"/> |
| 46 | + </patternset> |
| 47 | + <patternset id="compiler.resources"> |
| 48 | + <exclude name="**/?*.java"/> |
| 49 | + <exclude name="**/?*.form"/> |
| 50 | + <exclude name="**/?*.class"/> |
| 51 | + <exclude name="**/?*.groovy"/> |
| 52 | + <exclude name="**/?*.scala"/> |
| 53 | + <exclude name="**/?*.flex"/> |
| 54 | + <exclude name="**/?*.kt"/> |
| 55 | + <exclude name="**/?*.clj"/> |
| 56 | + <exclude name="**/?*.aj"/> |
| 57 | + </patternset> |
| 58 | + |
| 59 | + <!-- Modules --> |
| 60 | + |
| 61 | + |
| 62 | + <!-- Module jshell --> |
| 63 | + |
| 64 | + <dirname property="module.jshell.basedir" file="${ant.file}"/> |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + <property name="compiler.args.jshell" value="-encoding UTF-8 -source 9 -target 9 ${compiler.args}"/> |
| 69 | + |
| 70 | + <property name="jshell.output.dir" value="build"/> |
| 71 | + <property name="jshell.testoutput.dir" value="test"/> |
| 72 | + |
| 73 | + <path id="jshell.module.bootclasspath"> |
| 74 | + <!-- Paths to be included in compilation bootclasspath --> |
| 75 | + </path> |
| 76 | + |
| 77 | + <path id="jshell.module.production.classpath"/> |
| 78 | + |
| 79 | + <path id="jshell.runtime.production.module.classpath"> |
| 80 | + <pathelement location="${jshell.output.dir}"/> |
| 81 | + </path> |
| 82 | + |
| 83 | + <path id="jshell.module.classpath"> |
| 84 | + <pathelement location="${jshell.output.dir}"/> |
| 85 | + </path> |
| 86 | + |
| 87 | + <path id="jshell.runtime.module.classpath"> |
| 88 | + <pathelement location="${jshell.testoutput.dir}"/> |
| 89 | + <pathelement location="${jshell.output.dir}"/> |
| 90 | + </path> |
| 91 | + |
| 92 | + |
| 93 | + <patternset id="excluded.from.module.jshell"> |
| 94 | + <patternset refid="ignored.files"/> |
| 95 | + </patternset> |
| 96 | + |
| 97 | + <patternset id="excluded.from.compilation.jshell"> |
| 98 | + <patternset refid="excluded.from.module.jshell"/> |
| 99 | + </patternset> |
| 100 | + |
| 101 | + <path id="jshell.module.sourcepath"> |
| 102 | + <dirset dir="."> |
| 103 | + <include name="src"/> |
| 104 | + <include name="src/main/java"/> |
| 105 | + </dirset> |
| 106 | + </path> |
| 107 | + |
| 108 | + |
| 109 | + <target name="compile.module.jshell" depends="compile.module.jshell.production,compile.module.jshell.tests" description="Compile module jshell"/> |
| 110 | + |
| 111 | + <target name="compile.module.jshell.production" description="Compile module jshell; production classes"> |
| 112 | + <mkdir dir="${jshell.output.dir}"/> |
| 113 | + <javac destdir="${jshell.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true"> |
| 114 | + <compilerarg line="${compiler.args.jshell}"/> |
| 115 | + <bootclasspath refid="jshell.module.bootclasspath"/> |
| 116 | + <classpath refid="jshell.module.production.classpath"/> |
| 117 | + <src refid="jshell.module.sourcepath"/> |
| 118 | + <patternset refid="excluded.from.compilation.jshell"/> |
| 119 | + </javac> |
| 120 | + |
| 121 | + </target> |
| 122 | + |
| 123 | + <target name="compile.module.jshell.tests" depends="compile.module.jshell.production" description="compile module jshell; test classes" unless="skip.tests"/> |
| 124 | + |
| 125 | + <target name="clean.module.jshell" description="cleanup module"> |
| 126 | + <delete dir="${jshell.output.dir}"/> |
| 127 | + <delete dir="${jshell.testoutput.dir}"/> |
| 128 | + </target> |
| 129 | + |
| 130 | + <target name="init" description="Build initialization"> |
| 131 | + <!-- Perform any build initialization in this target --> |
| 132 | + </target> |
| 133 | + |
| 134 | + <target name="clean" depends="clean.module.jshell" description="cleanup all"/> |
| 135 | + |
| 136 | + <target name="build.modules" depends="init, clean, compile.module.jshell" description="build all modules"/> |
| 137 | + |
| 138 | + <target name="init.artifacts"> |
| 139 | + <property name="artifacts.temp.dir" value="${basedir}/__artifacts_temp"/> |
| 140 | + <property name="artifact.output.attaching_jshell" value="lib"/> |
| 141 | + <mkdir dir="${artifacts.temp.dir}"/> |
| 142 | + <property name="temp.jar.path.attaching_jshell.jar" value="${artifacts.temp.dir}/attaching_jshell.jar"/> |
| 143 | + </target> |
| 144 | + |
| 145 | + <target name="artifact.attaching_jshell" depends="init.artifacts, compile.module.jshell" description="Build 'attaching_jshell' artifact"> |
| 146 | + <property name="artifact.temp.output.attaching_jshell" value="${artifacts.temp.dir}/attaching_jshell"/> |
| 147 | + <mkdir dir="${artifact.temp.output.attaching_jshell}"/> |
| 148 | + <jar destfile="${temp.jar.path.attaching_jshell.jar}" duplicate="preserve" filesetmanifest="mergewithoutmain"> |
| 149 | + <zipfileset dir="${jshell.output.dir}"/> |
| 150 | + <zipfileset dir="${basedir}/src/main/resources/META-INF" prefix="META-INF"/> |
| 151 | + </jar> |
| 152 | + <copy file="${temp.jar.path.attaching_jshell.jar}" tofile="${artifact.temp.output.attaching_jshell}/attaching_jshell.jar"/> |
| 153 | + </target> |
| 154 | + |
| 155 | + <target name="build.all.artifacts" depends="artifact.attaching_jshell" description="Build all artifacts"> |
| 156 | + <mkdir dir="${artifact.output.attaching_jshell}"/> |
| 157 | + <copy todir="${artifact.output.attaching_jshell}"> |
| 158 | + <fileset dir="${artifact.temp.output.attaching_jshell}"/> |
| 159 | + </copy> |
| 160 | + |
| 161 | + <!-- Delete temporary files --> |
| 162 | + <delete dir="${artifacts.temp.dir}"/> |
| 163 | + </target> |
| 164 | + |
| 165 | + <target name="all" depends="build.modules, build.all.artifacts" description="build all"/> |
| 166 | +</project> |
0 commit comments