aboutsummaryrefslogtreecommitdiffstats
path: root/make/build-graphui.xml
blob: 997068aa00a16aba727c1d05550f7bc0bd73801a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?xml version="1.0" encoding="UTF-8"?>
<!--
   - Ant build for GraphUI.  This build has been tested with ANT 1.7.0.  The
   - optional.jar that contains the optional ANT tasks must be in the ANT
   - classpath (typically the ant/lib directory).
   -
   - Public targets:
   -   all: (default)
   -   clean:        clean all built
   -->
<project name="GraphUI" basedir="." default="all">

    <import file="build-common.xml"/>

    <!-- needed for outofdate task -->
    <taskdef resource="net/sf/antcontrib/antlib.xml">
      <classpath> <pathelement location="${ant-contrib.jar}"/> </classpath>
    </taskdef>

    <!-- ================================================================== -->
    <!-- 
       - Base initialization and detection of operating system.
      -->
    <target name="partitioning.setup" depends="common.init">
        <property name="java.part.graph.ui"
                  value="com/jogamp/graph/ui/** jogamp/graph/ui/**"/>

        <property name="java.part.graph.ui.shadercode"
                  value="jogamp/graph/ui/opengl/shader/* jogamp/graph/ui/opengl/shader/bin/**"/>

        <property name="java.part.nonjava" 
                  value="${java.part.graph.ui.shadercode}"/>
    </target>

    <!-- ================================================================== -->
    <!-- 
       - Declare all paths and user defined variables.
      -->
    <target name="declare.common" description="Declare properties" depends="partitioning.setup">
        <property name="rootrel.src.java"         value="src/graphui/classes" />

        <!-- The source directories. -->
        <property name="src.java"                 value="${project.root}/${rootrel.src.java}" />
        
        <!-- The compiler output directories. -->
        <property name="classes"                  value="${build.graphui}/classes" />
    </target>
    
    <!-- ================================================================== -->
    <!-- 
       - Initialize all parameters required for the build and create any
       - required directories.
      -->
    <target name="init" depends="declare.common">
        <!-- Create the required output directories. -->
        <mkdir dir="${classes}" />
    </target>

    <target name="java.compile">
        <javac destdir="${classes}"
               fork="yes"
               includeAntRuntime="false"
               memoryMaximumSize="${javac.memorymax}"
               encoding="UTF-8"
               source="${target.sourcelevel}" 
               target="${target.targetlevel}" 
               bootclasspath="${target.rt.jar}"
               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
            <classpath refid="newt_jogl_nativewindow_gluegen.compile.classpath"/>
            <src path="${src.java}" />
        </javac>
        <!-- make shadercode and fonts available in classpath -->
        <copy todir="${classes}">
            <fileset dir="${src.java}"
                     includes="${java.part.nonjava}"
                     excludes="**/*.java"/>
        </copy>
    </target>

    <!-- ================================================================== -->
    <!--
       - Build the jar files.
      -->
    <target name="setup-manifestfile" depends="common.init">
        <property name="manifestfile" value="graphuiversion"/>
        <copy file="${manifestfile}"
            tofile="${build.graphui}/manifest.mf"
            overwrite="true">
            <filterset>
                <filter token="VERSION" value="${jogamp.version}"/>
                <filter token="BUILD_VERSION" value="${jogl.version}"/>
                <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
                <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
                <filter token="BASEVERSION" value="${jogamp.version.base}"/>
                <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
            </filterset>
        </copy>
    </target>

    <target name="build-jars" depends="setup-manifestfile">
        <jar manifest="${build.graphui}/manifest.mf" destfile="${graphui.jar}" filesonly="true">
            <fileset dir="${classes}" includes="${java.part.graph.ui}"/>
        </jar>
    </target>

    <!-- ================================================================== -->
    <!--
       - Clean up all that is built.
      -->
    <target name="clean" description="Remove all build products" depends="declare.common">
        <delete includeEmptyDirs="true" quiet="true">
            <fileset dir="${build.graphui}" />
        </delete>
    </target>

    <!-- ================================================================== -->
    <!--
       - Build everything.
      -->
    <target name="all" description="Build GraphUI JAR file." depends="init,java.compile,build-jars,generate.version.txt" />

    <target name="generate.version.txt" depends="init">
        <!-- Create a version.txt file indicating which version we just built -->
        <echo message="${jogl.version}" file="${build.graphui}/version.txt" />
    </target>

</project>