forked from Helioviewer-Project/JHelioviewer-SWHV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
92 lines (82 loc) · 3.71 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
<?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"/>
<condition property="DSN" value="${env.SENTRY_DSN}" else="">
<not>
<equals arg1="${env.SENTRY_DSN}" arg2="$${env.SENTRY_DSN}"/>
</not>
</condition>
<fileset id="libfiles" dir="./">
<include name="lib/**/*.jar"/>
</fileset>
<loadfile property="version" srcFile="VERSION"/>
<exec executable="git" outputproperty="revision">
<arg line="rev-list --count HEAD"/>
</exec>
<target name="clean">
<delete dir="${bin}"/>
<delete file="${jarfile}"/>
</target>
<target name="compile">
<mkdir dir="${bin}"/>
<javac srcdir="${src}" destdir="${bin}" target="1.8" source="1.8" 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}"/>
<property name="javac.jar" location="shared/javac-9+181-r4173-1.jar"/>
<!-- 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="shared/error_prone_core-2.3.2-with-dependencies.jar"/>
<pathelement location="shared/jFormatString-3.0.0.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-Xbootclasspath/p:${javac.jar}" unless:set="jdk9orlater"/>
<compilerarg line="-XDcompilePolicy=simple"/>
<compilerarg value="-processorpath"/>
<compilerarg pathref="processorpath.ref"/>
<!-- ReferenceEquality - crashes, CatchAndPrintStackTrace - not interesting -->
<compilerarg value="-Xplugin:ErrorProne -Xep:DeadException:ERROR -Xep:ReferenceEquality:OFF -Xep:CatchAndPrintStackTrace:OFF" />
<classpath>
<fileset refid="libfiles"/>
</classpath>
</javac>
</target>
<target name="jar" depends="compile">
<copy file="sentry.properties" tofile="${bin}/sentry.properties"/>
<replace file="${bin}/sentry.properties" token="@@DSN" value="${DSN}"/>
<replace file="${bin}/sentry.properties" token="@@VERSION" value="${version}"/>
<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="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>