This repository has been archived by the owner on Jun 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
99 lines (87 loc) · 5.07 KB
/
build.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="org.dayflower.pathtracer" default="distribution" basedir=".">
<!--The following properties should be specified by each project. Some of them are the same for all projects, whereas others are not.-->
<property name="java.source" value="1.8"/>
<property name="java.target" value="1.8"/>
<property name="project.class.classpath" value=". ./lib/aparapi.jar ./lib/org.macroing.image4j.jar ./lib/org.macroing.math4j.jar"/>
<property name="project.class.main" value="org.dayflower.pathtracer.main.DayflowerApplication"/>
<property name="project.directory.root" location="."/>
<property name="project.name" value="${ant.project.name}"/>
<property name="project.vendor" value="Dayflower.org"/>
<property name="project.version" value="0.2.1"/>
<!--The following properties are based on the above properties and don't really need to change.-->
<property name="project.directory.binary" location="bin"/>
<property name="project.directory.binary.main" location="${project.directory.binary}/main/java"/>
<property name="project.directory.distribution" location="${project.directory.root}/distribution"/>
<property name="project.directory.distribution.current" location="${project.directory.distribution}/${project.name}"/>
<property name="project.directory.library" location="lib"/>
<property name="project.directory.resources" location="resources"/>
<property name="project.directory.resources.distribution" location="${project.directory.resources}/distribution"/>
<property name="project.directory.resources.jar" location="${project.directory.resources}/jar"/>
<property name="project.directory.resources.metainf" location="${project.directory.resources}/metainf"/>
<property name="project.directory.source" location="src"/>
<property name="project.directory.source.main" location="${project.directory.source}/main/java"/>
<target name="clean" description="Deletes generated directories and files for project ${project.name}.">
<!-- <delete dir="${project.directory.binary}"/>-->
<delete dir="${project.directory.distribution}"/>
</target>
<target name="distribution" depends="clean">
<!--Initialize all directories.-->
<mkdir dir="${project.directory.binary.main}"/>
<mkdir dir="${project.directory.distribution.current}"/>
<mkdir dir="${project.directory.resources.distribution}"/>
<mkdir dir="${project.directory.resources.jar}"/>
<mkdir dir="${project.directory.resources.metainf}"/>
<mkdir dir="${project.directory.source.main}"/>
<path id="library.path">
<fileset dir="${project.directory.library}" includes="**/*.jar"/>
</path>
<!--Perform Java compilation.-->
<javac source="${java.source}" target="${java.target}" srcdir="${project.directory.source.main}" destdir="${project.directory.binary.main}" classpathref="library.path" includeAntRuntime="false" encoding="UTF-8" debug="true" debuglevel="lines,vars,source">
<compilerarg value="-Xlint:all"/>
</javac>
<!--Initialize time-stamps.-->
<tstamp>
<format property="build.date" pattern="EEEE, d MMMM yyyy"/>
<format property="build.time" pattern="hh:mm a"/>
</tstamp>
<!--Create a JAR-file.-->
<jar destfile="${project.directory.distribution.current}/${project.name}.jar" basedir="${project.directory.binary.main}">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Class-Path" value="${project.class.classpath}"/>
<attribute name="Main-Class" value="${project.class.main}"/>
<attribute name="Specification-Title" value="${project.name}"/>
<attribute name="Specification-Version" value="${project.version}"/>
<attribute name="Specification-Vendor" value="${project.vendor}"/>
<attribute name="Implementation-Title" value="${project.name}"/>
<attribute name="Implementation-Version" value="${project.version}"/>
<attribute name="Implementation-Vendor" value="${project.vendor}"/>
</manifest>
<fileset dir="${project.directory.resources.jar}" excludes="**/.*/**"/>
<metainf dir="${project.directory.resources.metainf}" excludes="**/.*/**"/>
</jar>
<!--Generate Javadocs.-->
<javadoc encoding="UTF-8" charset="UTF-8" docencoding="UTF-8" sourcepath="${project.directory.source.main}" destdir="${project.directory.distribution.current}/doc" author="true" version="true" use="true" access="protected" linksource="false" windowtitle="${project.name} API">
<classpath>
<path refid="library.path"/>
<pathelement location="${project.directory.binary.main}"/>
</classpath>
</javadoc>
<!--Copy files.-->
<copy todir="${project.directory.distribution.current}">
<fileset dir="${project.directory.resources.distribution}"/>
<fileset dir="." includes="COPYING"/>
<fileset dir="." includes="COPYING.LESSER"/>
<fileset dir="." includes="README.md"/>
</copy>
<!--Copy the source code.-->
<copy todir="${project.directory.distribution.current}/src">
<fileset dir="${project.directory.source.main}"/>
</copy>
<!--Copy the libraries.-->
<copy todir="${project.directory.distribution.current}/lib">
<fileset dir="${project.directory.library}"/>
</copy>
</target>
</project>