GitLab will be upgraded on 30 Jan 2023 from 2.00 pm (AEDT) to 3.00 pm (AEDT). During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

build.xml 4.27 KB
Newer Older
1
2
3
4
5
6
7
8
<!--
 * Copyright (c) 2009 The Australian National University.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Apache License v2.0.
 * You may obtain the license at
 * 
 *    http://www.opensource.org/licenses/apache2.0.php
 -->
9
<project name="pmd" default="all" basedir="../..">
john's avatar
john committed
10
11
    <description>DaCapo pmd benchmark</description>
    <property file="dacapo.properties"/>
12

john's avatar
john committed
13
    <property name="bm-name" value="pmd"/>
John Zhang's avatar
John Zhang committed
14
    <property name="bm-version" value="6.1.0"/>
John Zhang's avatar
John Zhang committed
15
    <property name="bm-url" value="${github.url}/pmd/pmd/releases/download/pmd_releases%2F${bm-version}"/>
john's avatar
john committed
16
    <property name="bm-src" value="${bm-name}-src-${bm-version}.zip"/>
John Zhang's avatar
John Zhang committed
17
    <property name="jaxen-version" value="1.1.6"/>
John Zhang's avatar
John Zhang committed
18
    <property name="asm-version" value="6.0"/>
John Zhang's avatar
John Zhang committed
19
    <property name="commons-io-version" value="2.4"/>
John Zhang's avatar
John Zhang committed
20
    <property name="commons-lang3-version" value="3.7"/>
John Zhang's avatar
John Zhang committed
21
    <property name="jcommander-version" value="1.48"/>
John Zhang's avatar
John Zhang committed
22
    <property name="saxon-version" value="9.1.0.8"/>
John Zhang's avatar
John Zhang committed
23

24
25
26
    <property name="mvn-home" location="${toolsdir}/apache-maven-${mvn.version}/bin"/>
    <property name="mvn-exe" value="${mvn-home}/mvn"/>
    <condition property="mvn-exe" value="${mvn-home}/mvn.bat">
John Zhang's avatar
John Zhang committed
27
28
        <os family="windows"/>
    </condition>
29

john's avatar
john committed
30
    <import file="../common.xml"/>
31

John Zhang's avatar
John Zhang committed
32
33
    <property name="bm-build-top" value="${bm-build-dir}/pmd-src-${bm-version}"/>

John Zhang's avatar
John Zhang committed
34
    <target name="unpack" depends="unzip, patch"/>
35

36
    <target name="bm-build" depends="xerces">
John Zhang's avatar
John Zhang committed
37
        <!-- build JUnit -->
john's avatar
john committed
38
        <ant antfile="libs/junit/build.xml"/>
John Zhang's avatar
John Zhang committed
39
40
41

        <!-- set up toolchains.xml for Maven -->
        <property name="mvn-toolchains-xml" value="${bm-build-top}/toolchains.xml"/>
John Zhang's avatar
John Zhang committed
42
        <exec executable="${bm-files}/mvn_toolchain_setup.sh">
John Zhang's avatar
John Zhang committed
43
            <arg line="${mvn-toolchains-xml}"/>
John Zhang's avatar
John Zhang committed
44
        </exec>
John Zhang's avatar
John Zhang committed
45
46

        <!-- execute Maven in build directory -->
47
        <exec dir="${bm-build-top}" executable="${mvn-exe}">
John Zhang's avatar
John Zhang committed
48
49
50
51
52
53
            <env key="JAVA_HOME" value="${jdk9home}"/>
            <arg value="-B"/>
            <arg line="--global-toolchains ${mvn-toolchains-xml}"/>
            <arg value="-Dmaven.test.skip=true"/>
            <arg line="-pl pmd-core,pmd-java,pmd-dist"/>
            <arg line="clean package"/>
john's avatar
john committed
54
        </exec>
John Zhang's avatar
John Zhang committed
55
56
57
58

        <!-- unpacks produced zip file -->
        <property name="pmd-dist-target" value="${bm-build-top}/pmd-dist/target/pmd-bin-${bm-version}"/>
        <unzip src="${pmd-dist-target}.zip" dest="${bm-build-top}/pmd-dist/target"/>
john's avatar
john committed
59
    </target>
60

john's avatar
john committed
61
    <target name="jar" depends="libs">
John Zhang's avatar
John Zhang committed
62
63
64
65
66
67
        <copy todir="${bm-jars}">
            <resources>
                <file file="${pmd-dist-target}/lib/pmd-core-${bm-version}.jar"/>
                <file file="${pmd-dist-target}/lib/pmd-java-${bm-version}.jar"/>
            </resources>
        </copy>
john's avatar
john committed
68
    </target>
69

john's avatar
john committed
70
71
72
73
    <target name="data">
        <property name="pmd-data" value="${bm-build-top}/data/pmd"/>
        <mkdir dir="${pmd-data}"/>
        <copy todir="${pmd-data}">
John Zhang's avatar
John Zhang committed
74
75
            <fileset dir="${bm-build-top}">
                <include name="**/*.java"/>
john's avatar
john committed
76
77
78
            </fileset>
        </copy>
        <copy todir="${pmd-data}">
John Zhang's avatar
John Zhang committed
79
            <fileset dir="${bm-build-top}/pmd-java/src/main/resources">
john's avatar
john committed
80
81
82
83
84
85
86
87
88
89
90
                <include name="rulesets/**/*"/>
            </fileset>
        </copy>
        <copy todir="${pmd-data}" >
            <fileset dir="${bm-data}/pmd">
                <include name="*.lst"/>
            </fileset>
        </copy>
        <zip basedir="${bm-build-top}/data" includes="pmd/**" destfile="${bm-dat}/pmd.zip"/>
        <delete dir="${bm-build-top}/data"/>
    </target>
91

john's avatar
john committed
92
    <target name="libs">
John Zhang's avatar
John Zhang committed
93
94
95
96
97
98
99
        <copy todir="${bm-jars}">
            <resources>
                <file file="${pmd-dist-target}/lib/jaxen-${jaxen-version}.jar"/>
                <file file="${pmd-dist-target}/lib/asm-${asm-version}.jar"/>
                <file file="${pmd-dist-target}/lib/commons-io-${commons-io-version}.jar"/>
                <file file="${pmd-dist-target}/lib/commons-lang3-${commons-lang3-version}.jar"/>
                <file file="${pmd-dist-target}/lib/jcommander-${jcommander-version}.jar"/>
John Zhang's avatar
John Zhang committed
100
101
                <file file="${pmd-dist-target}/lib/saxon-${saxon-version}.jar"/>
                <file file="${pmd-dist-target}/lib/saxon-${saxon-version}-dom.jar"/>
John Zhang's avatar
John Zhang committed
102
103
            </resources>
        </copy>
john's avatar
john committed
104
    </target>
105
</project>