make/idea/template/build.xml
author chegar
Tue, 10 May 2016 13:34:30 +0100
changeset 37861 53d85619d7fe
child 37976 9cc5debe0f47
permissions -rw-r--r--
8074716: IntelliJ IDEA project support Reviewed-by: rriggs Contributed-by: Chris Hegarty <chris.hegarty@oracle.com>, Maurizio Cimadamore <maurizio.cimadamore@oracle.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37861
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     1
<!-- importing.xml -->
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     2
<project name="jdk" basedir="..">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     3
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     4
    <script language="javascript" classpath=".idea/classes">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     5
        var JdkLogger = Java.type("idea.JdkIdeaAntLogger");
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     6
        new JdkLogger(project)
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     7
    </script>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     8
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
     9
     <!-- java.marker is set to a marker file to check for within a Java install dir.
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    10
         The best file to check for across Solaris/Linux/Windows/MacOS is one of the
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    11
         executables; regrettably, that is OS-specific. -->
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    12
    <condition property="java.marker" value="bin/java">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    13
        <os family="unix"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    14
    </condition>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    15
    <condition property="java.marker" value="bin/java.exe">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    16
        <os family="windows"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    17
    </condition>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    18
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    19
    <property name="test.dir" value="${basedir}/jdk/test"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    20
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    21
    <macrodef name="call-make">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    22
            <attribute name="dir"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    23
            <attribute name="args"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    24
            <sequential>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    25
                <exec executable="make" dir="@{dir}" failonerror="true">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    26
                    <arg line="@{args}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    27
                    <env key="CLASSPATH" value = ""/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    28
                </exec>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    29
            </sequential>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    30
        </macrodef>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    31
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    32
    <macrodef name="exec-target">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    33
        <attribute name="antfile" default="${ant.file}" />
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    34
        <attribute name="target" />
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    35
        <sequential>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    36
            <java classname="org.apache.tools.ant.Main" fork="true" spawn="true">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    37
                <arg value="-f"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    38
                <arg value="@{antfile}"/>  
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    39
                <arg value="-Dboot.java.home=${boot.java.home}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    40
                <arg value="-Dbuild.target.dir=${build.target.dir}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    41
                <arg value="-Djtreg.home=${jtreg.home}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    42
                <arg value="-Djtreg.tests=${jtreg.tests}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    43
                <arg value="-Djtreg.jpda.jvmargs=${jtreg.jpda.jvmargs}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    44
                <arg value="@{target}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    45
                <classpath>           
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    46
                    <pathelement path="${java.class.path}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    47
                </classpath>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    48
            </java>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    49
        </sequential>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    50
    </macrodef>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    51
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    52
    <target name="post-make" depends="build-module"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    53
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    54
    <!--
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    55
        **** Global JDK Build Targets
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    56
    -->
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    57
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    58
    <target name="clean" depends="-do-configure">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    59
        <echo message="base = ${basedir}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    60
        <call-make dir = "${build.target.dir}" args = "clean"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    61
    </target>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    62
    
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    63
    <target name="-do-configure">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    64
        <echo message="base = ${basedir}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    65
        <fail message="Not part of a full JDK forest">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    66
            <condition>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    67
                <not>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    68
                    <available file="${basedir}/configure" />
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    69
                </not>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    70
            </condition>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    71
        </fail>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    72
        <exec executable="sh" dir="${basedir}" failonerror="true">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    73
            <arg line="configure --with-boot-jdk=${boot.java.home}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    74
        </exec>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    75
    </target>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    76
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    77
    <target name="images">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    78
        <call-make dir = "${build.target.dir}" args = "images"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    79
    </target>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    80
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    81
    <target name="jimages">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    82
        <call-make dir = "${build.target.dir}" args = "jimages"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    83
    </target>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    84
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    85
    <target name="check-env">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    86
        <exec executable="env" dir="${basedir}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    87
    </target>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    88
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    89
    <target name="build-module">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    90
        <call-make dir = "${build.target.dir}" args = "${module.name}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    91
    </target>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    92
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    93
    <target name="-check-boot.java.home" depends="-def-check">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    94
        <check name="bootstrap java" property="boot.java.home" marker="${java.marker}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    95
    </target>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    96
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    97
    <target name="-def-check">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    98
        <macrodef name="check">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
    99
            <attribute name="name"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   100
            <attribute name="property"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   101
            <attribute name="marker" default=""/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   102
            <sequential>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   103
                <fail message="Cannot locate @{name}: please set @{property} to its location">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   104
                    <condition>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   105
                        <not>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   106
                            <isset property="@{property}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   107
                        </not>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   108
                    </condition>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   109
                </fail>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   110
                <fail message="@{name} is not installed in ${@{property}}">
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   111
                    <condition>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   112
                        <and>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   113
                            <not>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   114
                                <equals arg1="@{marker}" arg2=""/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   115
                            </not>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   116
                            <not>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   117
                                <available file="${@{property}}/@{marker}"/>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   118
                            </not>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   119
                        </and>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   120
                    </condition>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   121
                </fail>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   122
            </sequential>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   123
        </macrodef>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   124
    </target>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   125
</project>
53d85619d7fe 8074716: IntelliJ IDEA project support
chegar
parents:
diff changeset
   126