-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
281 lines (250 loc) · 13.9 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<project>
<property file="build.properties" />
<target name="lombok-config">
<propertyfile file="lombok.config" jdkproperties="true">
<entry key="config.stopBubbling" value="true" />
<entry key="lombok.addLombokGeneratedAnnotation" value="true" />
</propertyfile>
</target>
<target name="codeql-delombok">
<tstamp>
<format property="tstamp.backup" pattern="yyyy-MM-dd_HH.mm.ss.SSS" />
</tstamp>
<zip destfile="${project.build.sourceDirectory}_${tstamp.backup}.zip" basedir="${project.build.sourceDirectory}" level="9" />
<copy overwrite="true" verbose="true" todir="${project.build.sourceDirectory}">
<fileset dir="${lombok.outputDirectory}" />
</copy>
</target>
<condition property="testSourceDirectory.available">
<available file="${project.build.testSourceDirectory}" type="dir" />
</condition>
<target name="codeql-delombok-test" if="testSourceDirectory.available">
<tstamp>
<format property="tstamp.backup.test" pattern="yyyy-MM-dd_HH.mm.ss.SSS" />
</tstamp>
<zip destfile="${project.build.testSourceDirectory}_${tstamp.backup.test}.zip" basedir="${project.build.testSourceDirectory}" level="9" />
<copy overwrite="true" verbose="true" todir="${project.build.testSourceDirectory}">
<fileset dir="${lombok.testOutputDirectory}" />
</copy>
</target>
<target name="jarbundler">
<mkdir dir="${project.build.directory}/jarbundler" />
<jarbundler vmoptions="${mac.vmoptions}" dir="${project.build.directory}/jarbundler" name="${project.name}" mainclass="${gui.mainClass}" startonmainthread="true" version="${project.version}" icon="${project.build.iconsSourceDirectory}/mac/${mac.build.finalName}.icns" usejavaxkey="true" jvmversion="${maven.compiler.target}+" stubfile="${project.build.binSourceDirectory}/mac/universalJavaApplicationStub" highresolutioncapable="true">
<jarfileset dir="${project.build.directory}" includes="*.${project.packaging},${dependencies.directory}/*.jar" />
</jarbundler>
</target>
<target name="launch4j">
<echo level="debug" message="os.name: ${os.name}" />
<echo level="debug" message="os.version: ${os.version}" />
<echo level="debug" message="os.arch: ${os.arch}" />
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="${launch4j.directory}/launch4j.jar:${launch4j.directory}/lib/xstream.jar" />
<condition property="launch4j.bindir" value="${launch4j.directory}/bin/win32">
<and>
<os family="windows" />
<available file="${launch4j.directory}/bin/win32" type="dir" />
</and>
</condition>
<condition property="launch4j.bindir" value="${launch4j.directory}/bin/macosx-x86">
<and>
<os family="mac" />
<available file="${launch4j.directory}/bin/macosx-x86" type="dir" />
</and>
</condition>
<condition property="launch4j.bindir" value="${launch4j.directory}/bin/linux">
<and>
<os name="linux" />
<os arch="i386" />
<available file="${launch4j.directory}/bin/linux" type="dir" />
</and>
</condition>
<condition property="launch4j.bindir" value="${launch4j.directory}/bin/linux-x64">
<and>
<os name="linux" />
<os arch="amd64" />
<available file="${launch4j.directory}/bin/linux-x64" type="dir" />
</and>
</condition>
<condition property="launch4j.bindir" value="${launch4j.directory}/bin/linux-armhf">
<and>
<os name="linux" />
<os arch="arm" />
<available file="${launch4j.directory}/bin/linux-armhf" type="dir" />
</and>
</condition>
<condition property="launch4j.bindir" value="${launch4j.directory}/bin/linux-aarch64">
<and>
<os name="linux" />
<os arch="aarch64" />
<available file="${launch4j.directory}/bin/linux-aarch64" type="dir" />
</and>
</condition>
<echo level="info" message="launch4j.bindir: ${launch4j.bindir}" />
<chmod perm="+x" file="${launch4j.bindir}/ld" failonerror="false" failifexecutionfails="false" ignoremissing="true" />
<chmod perm="+x" file="${launch4j.bindir}/windres" failonerror="false" failifexecutionfails="false" ignoremissing="true" />
<mkdir dir="${project.build.directory}/launch4j" />
<launch4j bindir="${launch4j.bindir}">
<config outfile="${project.build.directory}/launch4j/${windows.gui.exeFileName}" jarpath="${windows.build.finalName}.${project.packaging}" headertype="gui" dontwrapjar="${launch4j.config.dontWrapJar}" stayalive="${launch4j.config.stayAlive}" restartoncrash="${launch4j.config.restartOnCrash}" priority="${launch4j.config.priority}" errtitle="${launch4j.config.errTitle}" chdir="." icon="${project.build.iconsSourceDirectory}/windows/${windows.build.finalName}.ico">
<singleInstance mutexname="${gui.mainClass}" windowtitle="${project.name}" />
<jre path="${launch4j.config.jre.path}" minversion="${maven.compiler.target}.0" jdkpreference="${launch4j.config.jre.jdkPreference}" initialheapsize="${gui.vm.initialHeapSize}" maxheapsize="${gui.vm.maxHeapSize}" runtimebits="${launch4j.jre.runtimeBits}" />
<classPath mainclass="${gui.mainClass}" />
<versionInfo fileversion="${project.version}.0" txtfileversion="${project.version}" filedescription="${project.name}" copyright="${launch4j.config.versionInfo.copyright}" productversion="${project.version}.0" txtproductversion="${project.version}" productname="${project.name}" internalname="${project.artifactId}" originalfilename="${windows.gui.exeFileName}" companyname="${launch4j.config.versionInfo.companyName}" />
</config>
</launch4j>
<launch4j bindir="${launch4j.bindir}">
<config outfile="${project.build.directory}/launch4j/${windows.cli.exeFileName}" jarpath="${windows.build.finalName}.${project.packaging}" headertype="console" dontwrapjar="${launch4j.config.dontWrapJar}" stayalive="${launch4j.config.stayAlive}" restartoncrash="${launch4j.config.restartOnCrash}" priority="${launch4j.config.priority}" errtitle="${launch4j.config.errTitle}" chdir=".">
<jre path="${launch4j.config.jre.path}" minversion="${maven.compiler.target}.0" jdkpreference="${launch4j.config.jre.jdkPreference}" initialheapsize="${cli.vm.initialHeapSize}" maxheapsize="${cli.vm.maxHeapSize}" />
<classPath mainclass="${cli.mainClass}" />
<versionInfo fileversion="${project.version}.0" txtfileversion="${project.version}" filedescription="${project.name}" copyright="${launch4j.config.versionInfo.copyright}" productversion="${project.version}.0" txtproductversion="${project.version}" productname="${project.name}" internalname="${project.name}" originalfilename="${windows.cli.exeFileName}" companyname="${launch4j.config.versionInfo.companyName}" />
</config>
</launch4j>
</target>
<target name="innosetup">
<for trim="true" list="${build.platforms.windows}" param="platform" parallel="${build.parallel}">
<sequential>
<unzip src="${project.build.basedir}/${project.artifactId}-${project.version}-@{platform}-bin.zip" dest="${project.build.basedir}/@{platform}/innosetup" />
</sequential>
</for>
<echo file="${project.build.basedir}/win32-win32-x86/innosetup/${project.artifactId}.iss">
[Setup]
AppName=${project.name}
AppVersion=${project.version}
VersionInfoVersion=${project.version}
AppId=${innoSetup.AppId.x86}
AppPublisherURL=${innoSetup.AppPublisherURL}
AppSupportURL=${innoSetup.AppSupportURL}
AppUpdatesURL=${innoSetup.AppUpdatesURL}
AppMutex=${gui.mainClass}
TimeStampsInUTC=yes
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
DefaultDirName={autopf32}\${project.name}
DefaultGroupName=${project.name}
UninstallDisplayIcon={app}\${windows.gui.exeFileName}
Compression=lzma2
SolidCompression=yes
CloseApplications=no
ArchitecturesAllowed=x86
[Languages]
Name: "English"; MessagesFile: "compiler:Default.isl"; LicenseFile: "${project.name}\LICENSE.txt"
Name: "Italiano"; MessagesFile: "compiler:Languages\Italian.isl"; LicenseFile: "${project.name}\LICENSE.txt"
[Run]
Filename: "{app}\${windows.gui.exeFileName}"; Description: "{cm:LaunchProgram,${project.name}}"; Flags: nowait postinstall skipifsilent
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Icons]
Name: "{group}\${project.name}"; Filename: "{app}\${windows.gui.exeFileName}"
Name: "{group}\{cm:UninstallProgram,${project.name}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\${project.name}"; Filename: "{app}\${windows.gui.exeFileName}"; Tasks: desktopicon
[Files]
Source: "${project.name}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
Source: "${innoSetup.dependencies.logFileName}"; DestDir: "{autoappdata}\${project.name}"; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: hidden readonly
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
var
jarFileNames: TArrayOfString;
i: Integer;
begin
if (CurStep = ssInstall) and (LoadStringsFromFile(ExpandConstant('{autoappdata}\${project.name}\${innoSetup.dependencies.logFileName}'), jarFileNames)) then
begin
for i := 0 to GetArrayLength(jarFileNames) - 1 do
DeleteFile(ExpandConstant('{app}\${dependencies.directory}\' + jarFileNames[i]));
end;
end;
</echo>
<echo file="${project.build.basedir}/win32-win32-x86_64/innosetup/${project.artifactId}.iss">
[Setup]
AppName=${project.name}
AppVersion=${project.version}
VersionInfoVersion=${project.version}
AppId=${innoSetup.AppId.x64}
AppPublisherURL=${innoSetup.AppPublisherURL}
AppSupportURL=${innoSetup.AppSupportURL}
AppUpdatesURL=${innoSetup.AppUpdatesURL}
AppMutex=${gui.mainClass}
TimeStampsInUTC=yes
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
DefaultDirName={autopf64}\${project.name}
DefaultGroupName=${project.name}
UninstallDisplayIcon={app}\${windows.gui.exeFileName}
Compression=lzma2
SolidCompression=yes
CloseApplications=no
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
[Languages]
Name: "English"; MessagesFile: "compiler:Default.isl"; LicenseFile: "${project.name}\LICENSE.txt"
Name: "Italiano"; MessagesFile: "compiler:Languages\Italian.isl"; LicenseFile: "${project.name}\LICENSE.txt"
[Run]
Filename: "{app}\${windows.gui.exeFileName}"; Description: "{cm:LaunchProgram,${project.name}}"; Flags: nowait postinstall skipifsilent
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Icons]
Name: "{group}\${project.name}"; Filename: "{app}\${windows.gui.exeFileName}"
Name: "{group}\{cm:UninstallProgram,${project.name}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\${project.name}"; Filename: "{app}\${windows.gui.exeFileName}"; Tasks: desktopicon
[Files]
Source: "${project.name}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
Source: "${innoSetup.dependencies.logFileName}"; DestDir: "{autoappdata}\${project.name}"; Flags: ignoreversion overwritereadonly uninsremovereadonly; Attribs: hidden readonly
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
var
jarFileNames: TArrayOfString;
i: Integer;
begin
if (CurStep = ssInstall) and (LoadStringsFromFile(ExpandConstant('{autoappdata}\${project.name}\${innoSetup.dependencies.logFileName}'), jarFileNames)) then
begin
for i := 0 to GetArrayLength(jarFileNames) - 1 do
DeleteFile(ExpandConstant('{app}\${dependencies.directory}\' + jarFileNames[i]));
end;
end;
</echo>
<for trim="true" list="${build.platforms.windows}" param="platform" parallel="${build.parallel}">
<sequential>
<pathconvert pathsep=" " property="dependencies.log.@{platform}">
<fileset dir="${project.build.basedir}/@{platform}/innosetup/${project.name}/${dependencies.directory}">
<include name="*.jar" />
</fileset>
<mapper>
<flattenmapper />
</mapper>
</pathconvert>
<echo file="${project.build.basedir}/@{platform}/innosetup/${innoSetup.dependencies.logFileName}">${dependencies.log.@{platform}}</echo>
</sequential>
</for>
<for trim="true" list="${build.platforms.windows}" param="platform" parallel="false">
<sequential>
<exec osfamily="windows" executable="${innoSetup.directory}/ISCC.exe" failonerror="true">
<arg value="${project.build.basedir}/@{platform}/innosetup/${project.artifactId}.iss" />
<arg value="/O${project.build.basedir}" />
<arg value="/F${project.artifactId}-${project.version}-@{platform}-setup" />
</exec>
<exec osfamily="unix" executable="wine" failonerror="false" failifexecutionfails="false">
<arg value="${innoSetup.directory}/ISCC.exe" />
<arg value="${project.build.basedir}/@{platform}/innosetup/${project.artifactId}.iss" />
<arg value="/O${project.build.basedir}" />
<arg value="/F${project.artifactId}-${project.version}-@{platform}-setup" />
</exec>
</sequential>
</for>
</target>
<target name="checksums">
<property name="checksums.file" value="${project.build.basedir}/checksums.md" />
<property name="checksums.directory" value="${project.build.basedir}/checksums" />
<delete file="${checksums.file}" />
<checksum algorithm="SHA-256" todir="${checksums.directory}" forceoverwrite="yes" fileext=".sha256" pattern="* {1} [`{0}`](https://www.virustotal.com/it/file/{0}/analysis/)">
<fileset dir="${project.build.basedir}">
<include name="*" />
</fileset>
</checksum>
<echo file="${checksums.file}" message="### Checksums SHA-256 " />
<concat destfile="${checksums.file}" append="true">
<fileset dir="${checksums.directory}" />
</concat>
<loadfile property="checksums.file.contents" srcFile="${checksums.file}" />
<echo level="info" message="${checksums.file.contents}" />
<delete dir="${checksums.directory}" />
</target>
</project>