summaryrefslogtreecommitdiffstats
path: root/LICENSE.txt
blob: 9184b333ddda1144d9347deedc1b347df39282dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Redmine - project management software
Copyright (C) Jean-Philippe Lang

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

For the full text of the license, please see the `COPYING` file
located in the `doc` directory.

You can also find the full text of the GPL version 2 at the Free
Software Foundation's website at

https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html

or by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
f='#n257'>257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325
<?xml version="1.0"?>

<!-- =================================================================== -->
<!-- JBoss build file                                                    -->
<!-- =================================================================== -->

<project name="javassist" default="jar" basedir=".">

  <property name="dist-version" value="javassist-3.24-GA"/>

  <property environment="env"/>
  <property name="target.jar" value="javassist.jar"/>
  <property name="target-src.jar" value="javassist-src.jar"/>
  <property name="lib.dir" value="${basedir}/lib"/>
  <property name="src.dir" value="${basedir}/src/main"/>
  <property name="build.dir" value="${basedir}/target"/>
  <property name="build.classes.dir" value="${build.dir}/classes"/>
  <property name="test.src.dir" value="${basedir}/src/test"/>
  <property name="test.lib.dir" value="${test.src.dir}/resources"/>
  <property name="test.build.dir" value="${build.dir}/test-classes"/>
  <property name="test.run.dir" value="${build.dir}/runtest"/>
  <property name="test.reports.dir" value = "${build.dir}/test-output"/>

  <property name="run.dir" value="${build.classes.dir}"/>

  <!-- Build classpath -->
  <path id="classpath">
    <pathelement location="${build.classes.dir}"/>
  </path>

  <property name="build.classpath" refid="classpath"/>

  <path id="test.compile.classpath">
    <pathelement location="${build.classes.dir}"/>
    <pathelement location="${lib.dir}/junit.jar"/>
    <pathelement location="${lib.dir}/hamcrest.jar"/>
  </path>

  <property name="test.compile.classpath" refid="test.compile.classpath"/>

  <path id="test.classpath">
    <pathelement location="${test.build.dir}"/>
    <pathelement location="${test.lib.dir}"/>
    <pathelement location="${lib.dir}/junit.jar"/>
    <pathelement location="${lib.dir}/hamcrest.jar"/>
    <pathelement location="${build.classes.dir}"/>
  </path>

  <property name="test.classpath" refid="test.classpath"/>

  <!-- =================================================================== -->
  <!-- Prepares the build directory                                        -->
  <!-- =================================================================== -->
  <target name="prepare" >
    <mkdir dir="${build.dir}"/>
    <mkdir dir="${build.classes.dir}"/>
    <mkdir dir="${test.build.dir}"/>
  	<mkdir dir="${test.reports.dir}"/>
  	<mkdir dir="${test.run.dir}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the source code                                            -->
  <!-- =================================================================== -->
  <target name="compile" depends="prepare">
    <javac srcdir="${src.dir}"
           destdir="${build.classes.dir}"
           debug="on"
           deprecation="on"
           optimize="off"
    	   includeantruntime="true"
           includes="**">
            <classpath refid="classpath"/>
    </javac>
  </target>

  <target name="compile16" depends="prepare">
    <javac srcdir="${src.dir}"
           destdir="${build.classes.dir}"
           debug="on"
           deprecation="on"
	       source="1.6"
	       target="1.6"
           optimize="off"
    	   includeantruntime="true"
           includes="**">
      <classpath refid="classpath"/>
    </javac>
  </target>

  <target name="test-compile" depends="compile">
    <javac srcdir="${test.src.dir}"
           destdir="${test.build.dir}"
           debug="on"
           deprecation="on"
           optimize="off"
    	   includeantruntime="false"
           includes="**">
            <classpath refid="test.compile.classpath"/>
            <compilerarg value="-parameters" />        
    </javac>
  </target>

  <target name="runtest" depends="jar,test-compile">
    <copy file="${test.lib.dir}/empty.jar"
          tofile="${test.lib.dir}/emptyorig.jar"
          preservelastmodified="true" />
    <junit fork="true" printsummary="true" dir="${test.run.dir}">
      <jvmarg value="-XX:-FailOverToOldVerifier"/>
      <classpath refid="test.classpath"/>
      <formatter type="xml" extension=".xml"/>
      <test name="javassist.JvstTest" outfile="TestLog" />
    </junit>
    <move file="${test.lib.dir}/emptyorig.jar"
          tofile="${test.lib.dir}/empty.jar" />
  </target>

  <target name="runtest9" depends="jar,test-compile">
    <copy file="${test.lib.dir}/empty.jar"
          tofile="${test.lib.dir}/emptyorig.jar"
          preservelastmodified="true" />
    <junit fork="true" printsummary="true" dir="${test.run.dir}">
      <jvmarg line="--add-opens java.base/java.lang=ALL-UNNAMED" />
      <jvmarg value="-XX:-FailOverToOldVerifier"/>
      <classpath refid="test.classpath"/>
      <formatter type="xml" extension=".xml"/>
      <test name="javassist.JvstTest" outfile="TestLog" />
    </junit>
    <move file="${test.lib.dir}/emptyorig.jar"
          tofile="${test.lib.dir}/empty.jar" />
  </target>

  <target name="sample" depends="compile">
    <javac srcdir="${basedir}"
           destdir="${build.classes.dir}"
           debug="on"
           deprecation="on"
           optimize="off"
           includes="sample/**"
           excludes="sample/hotswap/**,sample/evolve/sample/**">
            <classpath refid="classpath"/>
    </javac>

    <copy file="sample/vector/Test.j"
          todir="${build.classes.dir}/sample/vector"/>

    <javac srcdir="${basedir}/sample/evolve"
           destdir="${build.classes.dir}/sample/evolve/"
           debug="on"
           deprecation="on"
           optimize="off"
           includes="sample/**">
            <classpath refid="classpath"/>
    </javac>
    <copy todir="${build.classes.dir}/sample/evolve">
      <fileset dir="sample/evolve"/>
    </copy>
    <copy file="${build.classes.dir}/sample/evolve/WebPage.class"
          tofile="${build.classes.dir}/sample/evolve/WebPage.class.0"/>
    <copy file="${build.classes.dir}/sample/evolve/sample/evolve/WebPage.class"
          tofile="${build.classes.dir}/sample/evolve/WebPage.class.1"/>

    <javac srcdir="${basedir}/sample/hotswap"
           destdir="${build.classes.dir}"
           debug="on"
           deprecation="on"
           optimize="off"
           includes="*">
            <classpath refid="classpath"/>
    </javac>
    <mkdir dir="${build.classes.dir}/logging"/>
    <javac srcdir="${basedir}/sample/hotswap/logging"
           destdir="${build.classes.dir}/logging"
           debug="on"
           deprecation="on"
           optimize="off"
           includes="*">
            <classpath refid="classpath"/>
    </javac>
    <echo>To run the sample programs without ant, change the current directory 
to ${build.classes.dir}.</echo>
  </target>

  <target name="jar" depends="compile16">
    <jar jarfile="${target.jar}" update="true" manifest="${src.dir}/META-INF/MANIFEST.MF">
      <fileset dir="${build.classes.dir}">
      	  <include name="**/*.class"/>
      </fileset>
     </jar>
    <jar jarfile="${target-src.jar}" manifest="${src.dir}/META-INF/MANIFEST.MF">
      <fileset dir="${src.dir}">
        <include name="javassist/**"/>
      </fileset>
    </jar>
  </target>

  <target name="javadocs">
  	<mkdir dir="html"/>
    <javadoc
           Locale="en_US"
           packagenames="javassist.*"
           excludepackagenames="javassist.compiler.*,javassist.convert.*,javassist.scopedpool.*,javassist.bytecode.stackmap.*"
           sourcepath="src/main"
           defaultexcludes="yes"
           destdir="html"
           author="true"
           version="true"
           use="true"
           public="true"
           nohelp="true"
           windowtitle="Javassist API">
      <doctitle><![CDATA[<h1>Javassist</h1>]]></doctitle>
      <bottom><![CDATA[<i>Javassist, a Java-bytecode translator toolkit.<br>
Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.</i>]]></bottom>
    </javadoc>
  </target>

  <target name="dist" depends="jar,javadocs">
  	<delete file="${dist-version}.zip"/>
  	<delete file="TestLog.xml"/>
    <zip zipfile="${dist-version}.zip">
       <zipfileset dir="${basedir}" prefix="${dist-version}">
       	  <include name="html/**"/>
       	  <include name="sample/**"/>
       	  <include name="src/main/**"/>
       	  <include name="tutorial/**"/>
       	  <include name="*.html"/>
       	  <include name="*.xml"/>
       	  <include name="${target.jar}"/>
       </zipfileset>
    </zip>
  </target>

  <target name="clean">
    <delete dir="html"/>
    <delete dir="${build.dir}"/>
    <delete file="${target.jar}"/>
    <delete file="${dist-version}.zip"/>
  </target>

  <!-- =================================================================== -->
  <!-- Run samples                                                         -->
  <!-- =================================================================== -->

  <target name = "sample-all"
          depends="sample-test,sample-reflect,sample-duplicate,sample-vector">
    <echo>** please run sample-rmi, sample-evolve, and</echo>
    <echo>   sample-hotswap (or -hotswap5) separately **</echo>
  </target>

  <target name = "sample-test" depends="sample" >
    <java fork="true" dir="${run.dir}" classname="sample.Test">
      <classpath refid="classpath"/>
    </java>
  </target>

  <target name = "sample-reflect" depends="sample" >
    <java fork="true" dir="${run.dir}" classname="javassist.tools.reflect.Loader">
      <classpath refid="classpath"/>
      <arg line="sample.reflect.Main Joe" />
    </java>
  </target>

  <target name = "sample-duplicate" depends="sample" >
    <echo>run sample.duplicate.Viewer without reflection</echo>
    <java fork="true" dir="${run.dir}" classname="sample.duplicate.Viewer">
      <classpath refid="classpath"/>
    </java>
    <echo>run sample.duplicate.Viewer with reflection</echo>
    <java fork="true" dir="${run.dir}" classname="sample.duplicate.Main">
      <classpath refid="classpath"/>
    </java>
  </target>

  <target name = "sample-vector" depends="sample" >
    <echo>sample.preproc.Compiler sample/vector/Test.j</echo>
    <java fork="true" dir="${run.dir}" classname="sample.preproc.Compiler">
      <classpath refid="classpath"/>
      <arg line="sample/vector/Test.j"/>
    </java>
    <echo>javac sample/vector/Test.java</echo>
    <javac srcdir="${build.classes.dir}"
           destdir="${build.classes.dir}"
           includes="sample/vector/Test.java">
            <classpath refid="classpath"/>
    </javac>
    <java fork="true" dir="${run.dir}" classname="sample.vector.Test" />
  </target>

  <target name = "sample-rmi" depends="sample" >
    <echo>** Please open sample/rmi/webdemo.html with your browser **</echo>
    <java fork="true" dir="${run.dir}" classname="sample.rmi.Counter">
      <classpath refid="classpath"/>
      <arg value="5001" />
    </java>
  </target>

  <target name = "sample-evolve" depends="sample" >
    <echo>** Please open http://localhost:5003/demo.html with your browser **</echo>
    <java fork="true" dir="${run.dir}" classname="sample.evolve.DemoLoader">
      <classpath refid="classpath"/>
      <arg value="5003" />
    </java>
  </target>

  <!-- for JDK 1.4 -->
  <target name = "sample-hotswap" depends="sample">
    <echo>** JAVA_HOME/lib/tools.jar must be included in CLASS_PATH</echo>
    <echo>** for JDK 1.4</echo>
    <java fork="true" dir="${run.dir}" classname="Test">
      <jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000" />
      <classpath refid="classpath"/>
    </java>
  </target>

  <!-- for Java 5 -->
  <target name = "sample-hotswap5" depends="sample">
    <echo>** JAVA_HOME/lib/tools.jar must be included in CLASS_PATH</echo>
    <echo>** for JDK 1.5 or later</echo>
    <java fork="true" dir="${run.dir}" classname="Test">
      <jvmarg line="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000" />
      <classpath refid="classpath"/>
    </java>
  </target>
</project>