-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.xml
105 lines (96 loc) · 4.96 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
100
101
102
103
104
105
<?xml version="1.0" encoding="utf-8"?>
<project name="JHelioviewer" default="all">
<property environment="env"/>
<property name="src" location="src"/>
<property name="bin" location="bin"/>
<property name="resources" location="resources"/>
<property name="jarfile" location= "JHelioviewer.jar"/>
<fileset id="libfiles" dir="./">
<include name="lib/**/*.jar"/>
</fileset>
<loadfile property="version" srcFile="VERSION"/>
<exec executable="sh" outputproperty="revision">
<arg value="-c"/>
<arg value="git rev-list --count HEAD || echo 0"/>
</exec>
<target name="clean">
<delete dir="${bin}"/>
<delete file="${jarfile}"/>
</target>
<target name="compile">
<mkdir dir="${bin}"/>
<javac srcdir="${src}" destdir="${bin}" release="21" debug="on" debuglevel="source,lines,vars" includeantruntime="false" encoding="utf-8">
<compilerarg value="-Xlint:all"/>
<classpath>
<fileset refid="libfiles"/>
</classpath>
</javac>
</target>
<target name="prone">
<mkdir dir="${bin}"/>
<!-- using github.com/google/error-prone-javac is required when running on JDK 8 -->
<condition property="jdk9orlater">
<javaversion atleast="9"/>
</condition>
<path id="processorpath.ref">
<pathelement location="extra/prone/error_prone_core-2.29.0-with-dependencies.jar"/>
<pathelement location="extra/prone/dataflow-errorprone-3.42.0-eisop4.jar"/>
<pathelement location="extra/prone/javax.inject-1.jar"/>
<!-- Add annotation processors and Error Prone custom checks here if needed -->
</path>
<javac srcdir="${src}" destdir="${bin}" fork="yes" includeantruntime="no" xmlns:unless="ant:unless">
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED"/>
<compilerarg value="-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/>
<compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED"/>
<compilerarg value="-J-Xbootclasspath/p:${javac.jar}" unless:set="jdk9orlater"/>
<compilerarg line="-XDcompilePolicy=simple"/>
<compilerarg value="-processorpath"/>
<compilerarg pathref="processorpath.ref"/>
<!-- CatchAndPrintStackTrace - not interesting -->
<compilerarg value="-Xplugin:ErrorProne
-Xep:CatchAndPrintStackTrace:OFF
-Xep:EmptyCatch:OFF
-Xep:DoubleBraceInitialization:OFF
-Xep:StringCaseLocaleUsage:OFF
-Xep:FutureReturnValueIgnored:OFF
-Xep:MutablePublicArray:OFF
"/>
<classpath>
<fileset refid="libfiles"/>
</classpath>
</javac>
</target>
<target name="jar" depends="compile">
<copy file="version.properties" tofile="${bin}/version.properties"/>
<replace file="${bin}/version.properties" token="@@VERSION" value="${version}"/>
<replace file="${bin}/version.properties" token="@@REVISION" value="${revision}"/>
<manifestclasspath property="manifest_cp" jarfile="${jarfile}">
<classpath>
<fileset refid="libfiles"/>
</classpath>
</manifestclasspath>
<jar destfile="${jarfile}">
<fileset dir="${bin}"/>
<fileset dir="${resources}"/>
<manifest>
<attribute name="Automatic-Module-Name" value="org.helioviewer.jhv"/>
<attribute name="Add-Exports" value="java.desktop/sun.awt java.desktop/sun.swing"/>
<attribute name="Main-Class" value="org.helioviewer.jhv.JHelioviewer"/>
<attribute name="Class-Path" value="${manifest_cp}"/>
<attribute name="version" value="${version}"/>
<attribute name="revision" value="${revision}"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java jar="${jarfile}" fork="true"/>
</target>
<target name="all" depends="jar"/>
</project>