|
2 | 2 | <!--
|
3 | 3 | Copyright (c) 2017, 2017 IBM Corp. and others
|
4 | 4 |
|
5 |
| - This program and the accompanying materials are made available under |
6 |
| - the terms of the Eclipse Public License 2.0 which accompanies this |
7 |
| - distribution and is available at https://www.eclipse.org/legal/epl-2.0/ |
8 |
| - or the Apache License, Version 2.0 which accompanies this distribution and |
9 |
| - is available at https://www.apache.org/licenses/LICENSE-2.0. |
| 5 | + This program and the accompanying materials are made available under |
| 6 | + the terms of the Eclipse Public License 2.0 which accompanies this |
| 7 | + distribution and is available at https://www.eclipse.org/legal/epl-2.0/ |
| 8 | + or the Apache License, Version 2.0 which accompanies this distribution and |
| 9 | + is available at https://www.apache.org/licenses/LICENSE-2.0. |
10 | 10 |
|
11 |
| - This Source Code is also Distributed under one or more Secondary Licenses, |
12 |
| - as those terms are defined by the Eclipse Public License, v. 2.0: GNU |
13 |
| - General Public License, version 2 with the GNU Classpath Exception [1] |
14 |
| - and GNU General Public License, version 2 with the OpenJDK Assembly |
15 |
| - Exception [2]. |
| 11 | + This Source Code may also be made available under the following |
| 12 | + Secondary Licenses when the conditions for such availability set |
| 13 | + forth in the Eclipse Public License, v. 2.0 are satisfied: GNU |
| 14 | + General Public License, version 2 with the GNU Classpath |
| 15 | + Exception [1] and GNU General Public License, version 2 with the |
| 16 | + OpenJDK Assembly Exception [2]. |
16 | 17 |
|
17 |
| - [1] https://www.gnu.org/software/classpath/license.html |
18 |
| - [2] http://openjdk.java.net/legal/assembly-exception.html |
| 18 | + [1] https://www.gnu.org/software/classpath/license.html |
| 19 | + [2] http://openjdk.java.net/legal/assembly-exception.html |
| 20 | +
|
| 21 | + SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 |
19 | 22 | -->
|
20 | 23 | <project name="OpenJ9 JSR 292 API Tests" default="build" basedir=".">
|
21 | 24 | <taskdef resource='net/sf/antcontrib/antlib.xml'/>
|
|
31 | 34 | <property name="build" location="./bin"/>
|
32 | 35 | <property name="transformerListener" location="../Utils/src"/>
|
33 | 36 |
|
| 37 | + <property name="mods_name" value="mods"/> |
| 38 | + <property name="modulea_name" value="mods.modulea"/> |
| 39 | + <property name="moduleb_name" value="mods.moduleb"/> |
| 40 | + <property name="modulec_name" value="mods.modulec"/> |
| 41 | + |
| 42 | + <property name="modulea_src" location="./modules/mods.modulea"/> |
| 43 | + <property name="moduleb_src" location="./modules/mods.moduleb"/> |
| 44 | + <property name="modulec_src" location="./modules/mods.modulec"/> |
| 45 | + |
| 46 | + <property name="mods_dir" location="./mods"/> |
| 47 | + <property name="modulea_bin" location="./mods/mods.modulea"/> |
| 48 | + <property name="moduleb_bin" location="./mods/mods.moduleb"/> |
| 49 | + <property name="modulec_bin" location="./mods/mods.modulec"/> |
| 50 | + |
34 | 51 | <target name="init">
|
35 | 52 | <mkdir dir="${DEST}"/>
|
36 | 53 | <mkdir dir="${build}"/>
|
| 54 | + <mkdir dir="${mods_dir}"/> |
| 55 | + <mkdir dir="${modulea_bin}"/> |
| 56 | + <mkdir dir="${moduleb_bin}"/> |
| 57 | + <mkdir dir="${modulec_bin}"/> |
37 | 58 | </target>
|
38 | 59 |
|
39 |
| - <target name="compile_tests" depends="init" description="compile the test source code" > |
| 60 | + <target name="compile_modulec" depends="init" description="Compile the module files in mods.modulec"> |
| 61 | + <echo>Compiling the module files in mods.modulec</echo> |
| 62 | + <echo>Ant version is ${ant.version}</echo> |
| 63 | + <property name="compiler.javac" value="${JAVA_BIN}/javac" /> |
| 64 | + <echo>============COMPILER SETTINGS============</echo> |
| 65 | + <echo>===fork: yes</echo> |
| 66 | + <echo>===executable: ${compiler.javac}</echo> |
| 67 | + <echo>===debug: on</echo> |
| 68 | + <echo>===destdir: ${DEST}</echo> |
| 69 | + <if> |
| 70 | + <equals arg1="${JAVA_VERSION}" arg2="SE90"/> |
| 71 | + <then> |
| 72 | + <property name="modulec_path" value="--module-path ${mods_dir} -d ${modulec_bin}" /> |
| 73 | + <javac srcdir="${modulec_src}" destdir="${modulec_bin}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1"> |
| 74 | + <src path="${modulec_src}"/> |
| 75 | + <compilerarg line='${modulec_path}' /> |
| 76 | + </javac> |
| 77 | + </then> |
| 78 | + </if> |
| 79 | + </target> |
| 80 | + |
| 81 | + <target name="compile_moduleb" depends="init" description="Compile the module files in mods.moduleb"> |
| 82 | + <echo>Compiling the module files in mods.moduleb</echo> |
| 83 | + <echo>Ant version is ${ant.version}</echo> |
| 84 | + <property name="compiler.javac" value="${JAVA_BIN}/javac" /> |
| 85 | + <echo>============COMPILER SETTINGS============</echo> |
| 86 | + <echo>===fork: yes</echo> |
| 87 | + <echo>===executable: ${compiler.javac}</echo> |
| 88 | + <echo>===debug: on</echo> |
| 89 | + <echo>===destdir: ${DEST}</echo> |
| 90 | + <if> |
| 91 | + <equals arg1="${JAVA_VERSION}" arg2="SE90"/> |
| 92 | + <then> |
| 93 | + <property name="moduleb_path" value="--module-path ${mods_dir} -d ${moduleb_bin}" /> |
| 94 | + <javac srcdir="${moduleb_src}" destdir="${moduleb_bin}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1"> |
| 95 | + <src path="${moduleb_src}"/> |
| 96 | + <compilerarg line='${moduleb_path}' /> |
| 97 | + </javac> |
| 98 | + </then> |
| 99 | + </if> |
| 100 | + </target> |
| 101 | + |
| 102 | + <target name="compile_modulea" depends="init,compile_moduleb,compile_modulec" description="Compile the module files in mods.modulea"> |
| 103 | + <echo>Compiling the module files in mods.modulea</echo> |
| 104 | + <echo>Ant version is ${ant.version}</echo> |
| 105 | + <property name="compiler.javac" value="${JAVA_BIN}/javac" /> |
| 106 | + <echo>============COMPILER SETTINGS============</echo> |
| 107 | + <echo>===fork: yes</echo> |
| 108 | + <echo>===executable: ${compiler.javac}</echo> |
| 109 | + <echo>===debug: on</echo> |
| 110 | + <echo>===destdir: ${DEST}</echo> |
| 111 | + <if> |
| 112 | + <equals arg1="${JAVA_VERSION}" arg2="SE90"/> |
| 113 | + <then> |
| 114 | + <property name="modulea_path" value="--module-path ${mods_dir} -d ${modulea_bin}" /> |
| 115 | + <javac srcdir="${modulea_src}" destdir="${modulea_bin}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1"> |
| 116 | + <src path="${modulea_src}"/> |
| 117 | + <compilerarg line='${modulea_path}' /> |
| 118 | + </javac> |
| 119 | + </then> |
| 120 | + </if> |
| 121 | + </target> |
| 122 | + |
| 123 | + <target name="compile_tests" depends="init,compile_modulea,compile_moduleb,compile_modulec" description="compile the test source code" > |
40 | 124 | <echo>Compiling the test source code</echo>
|
41 | 125 | <echo>Ant version is ${ant.version}</echo>
|
42 | 126 | <echo>============COMPILER SETTINGS============</echo>
|
|
47 | 131 | <if>
|
48 | 132 | <equals arg1="${JAVA_VERSION}" arg2="SE90"/>
|
49 | 133 | <then>
|
| 134 | + <property name="addModules" value="--add-modules ${modulea_name},${moduleb_name},${modulec_name} --module-path ${mods_dir}" /> |
50 | 135 | <javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
|
51 | 136 | <src path="${src}"/>
|
52 | 137 | <src path="${transformerListener}" />
|
| 138 | + <compilerarg line='${addModules}' /> |
53 | 139 | <classpath>
|
54 | 140 | <pathelement location="../TestConfig/lib/asm-all.jar" />
|
55 | 141 | <pathelement location="../TestConfig/lib/testng.jar"/>
|
|
64 | 150 | <copy todir="${DEST}">
|
65 | 151 | <fileset dir="${src}/../" includes="*.mk,*.xml" />
|
66 | 152 | </copy>
|
| 153 | + <copy todir="${DEST}/${mods_name}"> |
| 154 | + <fileset dir="${mods_dir}"/> |
| 155 | + </copy> |
67 | 156 | <jar jarfile="${DEST}/openj9_jsr292test.jar" filesonly="true">
|
68 | 157 | <fileset dir="${build}"/>
|
69 | 158 | </jar>
|
|
0 commit comments