annotate build/build.xml @ 26:1bfff4a9a00a

Switching to ASM6 release
author afedorch
date Fri, 29 Sep 2017 10:37:46 -0700
parents 16cbc6c62174
children 4cfae0867822
rev   line source
afedorch@16 1 <?xml version="1.0" encoding="UTF-8"?>
afedorch@16 2
afedorch@16 3 <!--
afedorch@16 4 Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
afedorch@16 5 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
afedorch@16 6
afedorch@16 7 This code is free software; you can redistribute it and/or modify it
afedorch@16 8 under the terms of the GNU General Public License version 2 only, as
afedorch@16 9 published by the Free Software Foundation. Oracle designates this
afedorch@16 10 particular file as subject to the "Classpath" exception as provided
afedorch@16 11 by Oracle in the LICENSE file that accompanied this code.
afedorch@16 12
afedorch@16 13 This code is distributed in the hope that it will be useful, but WITHOUT
afedorch@16 14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
afedorch@16 15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
afedorch@16 16 version 2 for more details (a copy is included in the LICENSE file that
afedorch@16 17 accompanied this code).
afedorch@16 18
afedorch@16 19 You should have received a copy of the GNU General Public License version
afedorch@16 20 2 along with this work; if not, write to the Free Software Foundation,
afedorch@16 21 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
afedorch@16 22
afedorch@16 23 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
afedorch@16 24 or visit www.oracle.com if you need additional information or have any
afedorch@16 25 questions.
afedorch@16 26 -->
afedorch@16 27
afedorch@16 28 <project name="JCov" default="build" basedir=".">
afedorch@16 29
afedorch@16 30 <property file="release.properties"/>
afedorch@16 31 <property file="build.properties"/>
afedorch@26 32 <import file="check-dependecies.xml"/>
afedorch@16 33
afedorch@16 34 <!-- Build area -->
afedorch@16 35 <property name="build.dir" location="${result.dir}/jcov_${build.version}"/>
afedorch@26 36 <property name="jcov.classpath" value="${asm.jar}:${asm.util.jar}:${asm.tree.jar}:${java.home}/lib/tools.jar"/>
afedorch@16 37
afedorch@16 38 <!-- Temp dir is for files which do not appear in release directory -->
afedorch@16 39 <property name="tmp.dir" location="${result.dir}/temp"/>
afedorch@16 40
afedorch@16 41 <property name="jcov.classes" location="${tmp.dir}/jcov_classes"/>
afedorch@16 42 <property name="jcov.src.update" location="${tmp.dir}/jcov_src_update"/>
afedorch@16 43
afedorch@16 44 <property name="jcov.filesaver.classes" location="${tmp.dir}/jcov_filesaver_classes"/>
afedorch@16 45 <property name="jcov.filesaver.src" location="${tmp.dir}/jcov_filesaver_src"/>
afedorch@16 46
afedorch@16 47 <property name="jcov.networksaver.classes" location="${tmp.dir}/jcov_network_classes"/>
afedorch@16 48 <property name="jcov.networksaver.src" location="${tmp.dir}/jcov_network_src"/>
afedorch@16 49
afedorch@16 50 <property name="jcov.jtobserver.classes" location="${tmp.dir}/jcov_jtobserver_classes"/>
afedorch@16 51
afedorch@16 52 <patternset id="jcov.files">
afedorch@16 53 <include name="com/sun/tdk/jcov/**"/>
afedorch@16 54 <include name="resources/**"/>
afedorch@16 55 </patternset>
afedorch@16 56
afedorch@16 57 <patternset id="jcov.file.saver.files">
afedorch@16 58 <include name="com/sun/tdk/jcov/runtime/Collect.*"/>
afedorch@16 59 <include name="com/sun/tdk/jcov/runtime/CollectDetect.*"/>
afedorch@16 60 <include name="com/sun/tdk/jcov/runtime/JCovSaver.*"/>
afedorch@16 61 <include name="com/sun/tdk/jcov/runtime/SaverDecorator.*"/>
afedorch@16 62 <include name="com/sun/tdk/jcov/runtime/PropertyFinder.*"/>
afedorch@16 63 <include name="com/sun/tdk/jcov/util/MapHelper.*"/>
afedorch@16 64 <include name="com/sun/tdk/jcov/util/RuntimeUtils.*"/>
afedorch@16 65 <include name="com/sun/tdk/jcov/runtime/TemplateFileSaver*"/>
afedorch@16 66 <include name="com/sun/tdk/jcov/util/MapHelper.*"/>
afedorch@16 67 <include name="com/sun/tdk/jcov/constants/MiscConstants*"/>
afedorch@16 68 </patternset>
afedorch@16 69
afedorch@16 70 <patternset id="jcov.network.saver.files">
afedorch@16 71 <include name="com/sun/tdk/jcov/runtime/Collect.*"/>
afedorch@16 72 <include name="com/sun/tdk/jcov/runtime/CollectDetect.*"/>
afedorch@16 73 <include name="com/sun/tdk/jcov/runtime/PropertyFinder.*"/>
afedorch@16 74 <include name="com/sun/tdk/jcov/runtime/JCovSocketSaver.*"/>
afedorch@16 75 <include name="com/sun/tdk/jcov/runtime/JCovSESocketSaver.*"/>
afedorch@16 76 <include name="com/sun/tdk/jcov/runtime/JCovSaver.*"/>
afedorch@16 77 <include name="com/sun/tdk/jcov/runtime/NetworkSatelliteDecorator.*"/>
afedorch@16 78 <include name="com/sun/tdk/jcov/runtime/SaverDecorator.*"/>
afedorch@16 79 </patternset>
afedorch@16 80
afedorch@16 81 <fileset dir="${src.dir}" id="jcov.resources.files">
afedorch@16 82 <include name="com/sun/tdk/jcov/report/html/resources/**"/>
afedorch@16 83 <include name="com/sun/tdk/jcov/logging.properties"/>
afedorch@16 84 <exclude name="**/*.java"/>
afedorch@16 85 </fileset>
afedorch@16 86
afedorch@16 87 <patternset id="asm.files">
afedorch@16 88 <include name="org/objectweb/asm/**"/>
afedorch@16 89 </patternset>
afedorch@16 90
afedorch@16 91 <target name="clean" description="clean build data">
afedorch@16 92
afedorch@16 93 <delete dir="${build.dir}"/>
afedorch@16 94 <delete dir="${tmp.dir}"/>
afedorch@16 95
afedorch@16 96 </target>
afedorch@16 97
afedorch@26 98 <target name="prepare" depends="clean, verify-dependencies" description="checks dependencies">
afedorch@25 99
afedorch@16 100 <condition property="javatest.present">
afedorch@24 101 <and>
afedorch@24 102 <isset property="javatestjar"/>
afedorch@24 103 <not>
afedorch@24 104 <equals arg1="${javatestjar}" arg2=""/>
afedorch@24 105 </not>
afedorch@24 106 </and>
afedorch@16 107 </condition>
afedorch@16 108
afedorch@16 109 <mkdir dir="${jcov.src.update}"/>
afedorch@16 110 <mkdir dir="${jcov.classes}"/>
afedorch@16 111
afedorch@16 112 </target>
afedorch@16 113
afedorch@16 114 <target name="build-date" description="adds bild and date information">
afedorch@16 115 <tstamp>
afedorch@16 116 <format property="date" pattern="dd MMMM yyyy" locale="en"/>
afedorch@16 117 </tstamp>
afedorch@16 118 <mkdir dir="${jcov.src.update}/com/sun/tdk/jcov/tools"/>
afedorch@16 119 <echo file="${jcov.src.update}/com/sun/tdk/jcov/tools/JcovVersion.java">
afedorch@16 120 /*
afedorch@16 121 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
afedorch@16 122 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
afedorch@16 123 *
afedorch@16 124 * This code is free software; you can redistribute it and/or modify it
afedorch@16 125 * under the terms of the GNU General Public License version 2 only, as
afedorch@16 126 * published by the Free Software Foundation. Oracle designates this
afedorch@16 127 * particular file as subject to the "Classpath" exception as provided
afedorch@16 128 * by Oracle in the LICENSE file that accompanied this code.
afedorch@16 129 *
afedorch@16 130 * This code is distributed in the hope that it will be useful, but WITHOUT
afedorch@16 131 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
afedorch@16 132 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
afedorch@16 133 * version 2 for more details (a copy is included in the LICENSE file that
afedorch@16 134 * accompanied this code).
afedorch@16 135 *
afedorch@16 136 * You should have received a copy of the GNU General Public License version
afedorch@16 137 * 2 along with this work; if not, write to the Free Software Foundation,
afedorch@16 138 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
afedorch@16 139 *
afedorch@16 140 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
afedorch@16 141 * or visit www.oracle.com if you need additional information or have any
afedorch@16 142 * questions.
afedorch@16 143 */
afedorch@16 144
afedorch@16 145 package com.sun.tdk.jcov.tools;
afedorch@16 146
afedorch@16 147 public class JcovVersion{
afedorch@16 148 public static final String jcovVersion = "${build.version}";
afedorch@16 149 public static final String jcovMilestone = "${build.milestone}";
afedorch@16 150 public static final String jcovBuildNumber = "${build.number}";
afedorch@16 151 public static final String jcovBuildDate = "${date}";
afedorch@16 152 public static String getJcovVersion() {
afedorch@16 153 return String.format("%s%s-%s built: %s", jcovVersion, jcovMilestone, jcovBuildNumber, jcovBuildDate);
afedorch@16 154 }
afedorch@16 155 }
afedorch@16 156 </echo>
afedorch@16 157
afedorch@16 158 </target>
afedorch@16 159
afedorch@16 160 <target name="compile" depends="prepare, build-date"
afedorch@16 161 description="compile main tools">
afedorch@16 162
afedorch@22 163 <javac includeantruntime="false" encoding="iso-8859-1" debug="true" target="1.7" source="1.7"
afedorch@16 164 srcdir="${jcov.src.update}"
afedorch@16 165 destdir="${jcov.classes}"
afedorch@16 166 classpath="${jcov.classpath}">
afedorch@16 167 </javac>
afedorch@16 168
afedorch@22 169 <javac includeantruntime="true" encoding="iso-8859-1" debug="true" target="1.7" source="1.7"
afedorch@16 170 srcdir="${src.dir}"
afedorch@16 171 destdir="${jcov.classes}"
afedorch@16 172 classpath="${jcov.classpath}">
afedorch@16 173 <patternset refid="jcov.files"/>
afedorch@16 174 </javac>
afedorch@16 175
afedorch@16 176 <copy todir="${jcov.classes}">
afedorch@16 177 <fileset refid="jcov.resources.files"/>
afedorch@16 178 </copy>
afedorch@16 179 </target>
afedorch@16 180
afedorch@16 181 <patternset id="jcov.services">
afedorch@16 182 <include name="META-INF/services/**"/>
afedorch@16 183 </patternset>
afedorch@16 184
afedorch@16 185 <target name="build-jcov" depends="compile" description="build jcov jar">
afedorch@26 186 <unjar src="${asm.jar}" dest="${jcov.classes}"/>
afedorch@26 187 <unjar src="${asm.tree.jar}" dest="${jcov.classes}"/>
afedorch@26 188 <unjar src="${asm.util.jar}" dest="${jcov.classes}"/>
afedorch@16 189
afedorch@16 190 <mkdir dir="${jcov.classes}/META-INF"/>
afedorch@16 191 <mkdir dir="${jcov.classes}/META-INF/services"/>
afedorch@16 192 <echo file="${jcov.classes}/META-INF/services/com.sun.tdk.jcov.report.ancfilters.DefaultAncFilter"
afedorch@16 193 append="false">
afedorch@16 194 com.sun.tdk.jcov.report.ancfilters.ToStringANCFilter
afedorch@16 195 com.sun.tdk.jcov.report.ancfilters.DeprecatedANCFilter
afedorch@16 196 com.sun.tdk.jcov.report.ancfilters.EmptyANCFilter
afedorch@16 197 com.sun.tdk.jcov.report.ancfilters.CatchANCFilter
afedorch@16 198 com.sun.tdk.jcov.report.ancfilters.ThrowANCFilter
afedorch@16 199 com.sun.tdk.jcov.report.ancfilters.SyntheticANCFilter
afedorch@16 200 com.sun.tdk.jcov.report.ancfilters.GetterANCFilter
afedorch@16 201 com.sun.tdk.jcov.report.ancfilters.SetterANCFilter
afedorch@16 202 </echo>
afedorch@16 203
afedorch@16 204 <jar destfile="${build.dir}/jcov.jar" basedir="${jcov.classes}" index="false">
afedorch@16 205 <manifest>
afedorch@16 206 <attribute name="Built-By" value="${user.name}"/>
afedorch@16 207 <attribute name="Premain-Class" value="com.sun.tdk.jcov.Agent"/>
afedorch@16 208 <attribute name="Boot-Class-Path" value="jcov.jar"/>
afedorch@16 209 <attribute name="Main-Class" value="com.sun.tdk.jcov.Helper"/>
afedorch@16 210 <attribute name="Can-Retransform-Classes" value="true"/>
afedorch@16 211 <attribute name="Can-Set-Native-Method-Prefix" value="true" />
afedorch@16 212 </manifest>
afedorch@16 213
afedorch@16 214 <patternset refid="jcov.files"/>
afedorch@16 215 <patternset refid="asm.files"/>
afedorch@16 216 <patternset refid="jcov.services"/>
afedorch@16 217 </jar>
afedorch@16 218
afedorch@16 219 </target>
afedorch@16 220
afedorch@16 221 <target name="build-file.saver" depends="prepare" description="build file saver jar">
afedorch@16 222
afedorch@16 223 <mkdir dir="${jcov.filesaver.classes}"/>
afedorch@16 224 <mkdir dir="${jcov.filesaver.src}"/>
afedorch@16 225
afedorch@16 226 <copy todir="${jcov.filesaver.src}">
afedorch@16 227 <fileset dir="${src.dir}">
afedorch@16 228 <patternset refid="jcov.file.saver.files"/>
afedorch@16 229 </fileset>
afedorch@16 230 <fileset dir="${jcov.src.update}">
afedorch@16 231 </fileset>
afedorch@16 232 <filterchain>
afedorch@16 233 <tokenfilter>
afedorch@16 234 <replaceregex pattern="\/\*@" replace="@"/>
afedorch@16 235 <replaceregex pattern="@\*\/" replace="@"/>
afedorch@16 236 </tokenfilter>
afedorch@16 237 <filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
afedorch@16 238 <param type="propertiesfile" value="filesaver.replace.properties"/>
afedorch@16 239 </filterreader>
afedorch@16 240 </filterchain>
afedorch@16 241 </copy>
afedorch@22 242 <javac includeantruntime="true" encoding="iso-8859-1" debug="true" target="1.7" source="1.7"
afedorch@16 243 srcdir="${jcov.filesaver.src}"
afedorch@16 244 sourcepath=""
afedorch@16 245 classpath="${jcov.filesaver.classes}"
afedorch@16 246 destdir="${jcov.filesaver.classes}">
afedorch@16 247 </javac>
afedorch@16 248 <jar destfile="${build.dir}/jcov_file_saver.jar"
afedorch@16 249 basedir="${jcov.filesaver.classes}"
afedorch@16 250 index="false">
afedorch@16 251 <manifest>
afedorch@16 252 <attribute name="Built-By" value="${user.name}"/>
afedorch@16 253 </manifest>
afedorch@16 254 </jar>
afedorch@16 255 </target>
afedorch@16 256
afedorch@16 257 <target name="build-network.saver" depends="prepare" description="build network saver jar">
afedorch@16 258
afedorch@16 259 <mkdir dir="${jcov.networksaver.classes}"/>
afedorch@16 260 <mkdir dir="${jcov.networksaver.src}"/>
afedorch@16 261
afedorch@16 262 <copy todir="${jcov.networksaver.src}">
afedorch@16 263 <fileset dir="${src.dir}">
afedorch@16 264 <patternset refid="jcov.network.saver.files"/>
afedorch@16 265 </fileset>
afedorch@16 266 <filterchain>
afedorch@16 267 <tokenfilter>
afedorch@16 268 <replaceregex pattern="\/\*@" replace="@"/>
afedorch@16 269 <replaceregex pattern="@\*\/" replace="@"/>
afedorch@16 270 </tokenfilter>
afedorch@16 271 <filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
afedorch@16 272 <param type="propertiesfile" value="networksaver.replace.properties"/>
afedorch@16 273 </filterreader>
afedorch@16 274 </filterchain>
afedorch@16 275 </copy>
afedorch@22 276 <javac includeantruntime="true" encoding="iso-8859-1" debug="true" target="1.7" source="1.7"
afedorch@16 277 srcdir="${jcov.networksaver.src}"
afedorch@16 278 sourcepath=""
afedorch@16 279 classpath="${jcov.networksaver.classes}"
afedorch@16 280 destdir="${jcov.networksaver.classes}">
afedorch@16 281 </javac>
afedorch@16 282 <jar destfile="${build.dir}/jcov_network_saver.jar"
afedorch@16 283 basedir="${jcov.networksaver.classes}"
afedorch@16 284 index="false">
afedorch@16 285 <manifest>
afedorch@16 286 <attribute name="Built-By" value="${user.name}"/>
afedorch@16 287 </manifest>
afedorch@16 288 </jar>
afedorch@16 289 </target>
afedorch@16 290
afedorch@16 291 <target name="build-jt.observer" depends="prepare" if ="javatest.present" description="build jtobserver jar">
afedorch@16 292 <mkdir dir="${jcov.jtobserver.classes}"/>
afedorch@22 293 <javac includeantruntime="false" encoding="iso-8859-1" debug="true" target="1.7" source="1.7"
afedorch@16 294 srcdir="${src.dir}"
afedorch@16 295 sourcepath=""
afedorch@16 296 destdir="${jcov.jtobserver.classes}" classpath="${javatestjar}">
afedorch@16 297 <include name="jcov/*"/>
afedorch@16 298 </javac>
afedorch@16 299 <jar destfile ="${build.dir}/jtobserver.jar" basedir="${jcov.jtobserver.classes}" index="false"/>
afedorch@16 300 </target>
afedorch@16 301
afedorch@16 302 <target name="build"
afedorch@16 303 depends="build-jcov, build-file.saver, build-network.saver, build-jt.observer"
afedorch@16 304 description="Creates the build-distribution.">
afedorch@16 305 </target>
afedorch@16 306
afedorch@25 307 </project>