-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathbuild.xml
More file actions
145 lines (134 loc) · 6.53 KB
/
Copy pathbuild.xml
File metadata and controls
145 lines (134 loc) · 6.53 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?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="is.macos">
<os family="mac"/>
</condition>
<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}"/>
<delete file="lib/natives-macos/libjhvmetalhost.dylib"/>
</target>
<target name="build-metal-host" if="is.macos">
<mkdir dir="lib/natives-macos"/>
<exec executable="xcrun" failonerror="true">
<arg value="clang"/>
<arg value="-O2"/>
<arg value="-fobjc-arc"/>
<arg value="-dynamiclib"/>
<arg value="-mmacosx-version-min=12.0"/>
<arg value="-Werror=unguarded-availability-new"/>
<arg value="-arch"/>
<arg value="arm64"/>
<arg value="-arch"/>
<arg value="x86_64"/>
<arg value="-I${java.home}/include"/>
<arg value="-I${java.home}/include/darwin"/>
<arg value="-framework"/>
<arg value="Foundation"/>
<arg value="-framework"/>
<arg value="AppKit"/>
<arg value="-framework"/>
<arg value="QuartzCore"/>
<arg value="-framework"/>
<arg value="Metal"/>
<arg value="-o"/>
<arg value="lib/natives-macos/libjhvmetalhost.dylib"/>
<arg value="native/macos/jhv_metal_host.m"/>
</exec>
</target>
<target name="compile">
<mkdir dir="${bin}"/>
<javac srcdir="${src}" destdir="${bin}" release="25" 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.50.0-with-dependencies.jar"/>
<pathelement location="extra/prone/dataflow-errorprone-3.49.5-eisop1.jar"/>
<pathelement location="extra/prone/checker-qual-3.49.5-eisop1.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="-XDcompilePolicy=simple"/>
<compilerarg value="--should-stop=ifError=FLOW"/>
<compilerarg value="-processorpath"/>
<compilerarg pathref="processorpath.ref"/>
<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"/>
<!-- 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
-Xep:ArrayRecordComponent:OFF
"/>
<classpath>
<fileset refid="libfiles"/>
</classpath>
</javac>
</target>
<target name="jar" depends="compile">
<delete file="${jarfile}"/>
<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="build-metal-host,jar">
<java jar="${jarfile}" fork="true">
<jvmarg value="--enable-native-access=ALL-UNNAMED"/>
</java>
</target>
<target name="all" depends="jar"/>
</project>