Skip to content

Commit 8f2ab20

Browse files
authored
Merge pull request #660 from tonihele/feature/issue-611
Closes #611
2 parents 7a10475 + 6ad90ff commit 8f2ab20

File tree

111 files changed

+368
-13520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+368
-13520
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,32 @@ jobs:
1414
with:
1515
distribution: temurin
1616
java-version: 21
17+
- name: Install wine
18+
run: sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt install -y xorg xvfb xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic wine32:i386 wine makepkg
1719
- name: Grant execute permission for gradle
1820
run: chmod +x gradlew
1921
- name: Build the SDK
2022
run: ./gradlew buildSdk -Ptag_name=${{ github.ref_name }}
21-
- name: Build the JDKs
22-
run: bash download-jdks.sh
23-
working-directory: jdks
2423
- name: Override Harness (custom icon)
2524
run: ./gradlew overrideHarness -Ptag_name=${{ github.ref_name }}
2625
- name: Build Installers
27-
run: ant -Dstorepass="$NBM_SIGN_PASS" -Dpack200.enabled=false set-spec-version build-installers unset-spec-version
28-
env:
29-
BUILD_X86: false
30-
BUILD_X64: true
31-
BUILD_OTHER: true
26+
run: ant -Dstorepass="$NBM_SIGN_PASS" -Dpack200.enabled=false set-spec-version build-zip unset-spec-version
3227
- name: Fix Platform Independent Build
3328
run: ./gradlew fixPlatformIndependent -Ptag_name=${{ github.ref_name }}
29+
- name: Download JDKs for the installers
30+
run: bash download-jdks.sh
31+
working-directory: installers
32+
- name: Build the installers
33+
run: bash build-installers.sh ${{ github.ref_name }} headless
34+
working-directory: installers
3435
- name: Create Release
3536
uses: softprops/action-gh-release@v1
3637

3738
with:
38-
files: dist/jmonkeyplatform*.*
39+
files: |
40+
dist/jmonkeyplatform*.*
41+
dist/jmonkeyengine-sdk*.*
42+
dist/jMonkeyEngine-SDK*.*
3943
tag_name: ${{ github.ref }}
4044
name: Release ${{ github.ref }}
4145
env:

.gitignore

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@ build/*
2424
netbeans/*
2525
*/nbproject/private/*
2626
ant-jme/dist
27-
jdks/local/*
28-
jdks/*.bin
29-
jdks/*.exe
30-
jdks/*.zip
3127
dist/
3228
/.nb-gradle/MATERIAL_EDITOR_CHANGES.md
29+
/.nb-gradle/
30+
jdks/downloads/
31+
installers/downloads/
32+
installers/nbpackage/
33+
installers/linux-x64/jdk-x64_linux.tar.gz
34+
installers/macos-x64/jdk-x64_macos.tar.gz
35+
installers/windows-x64/jdk-x64_windows.zip
36+
installers/macos-aarch64/jdk-aarch64_macos.tar.gz
37+
installers/linux-aarch64/jdk-aarch64_linux.tar.gz

build.xml

Lines changed: 0 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -112,24 +112,6 @@
112112
byline="true"/>
113113
</target>
114114

115-
<!--
116-
****************************************************************
117-
Only Relevant for building nightly on Hudson server from here on
118-
****************************************************************
119-
-->
120-
121-
<!--creates update center version via hudson build server (update-help-sets, )-->
122-
<target name="hudson-nightly" depends="suite.clean, set-impl-version, suite.nbms, unset-impl-version">
123-
</target>
124-
125-
<!--to be used after release, sets version number sans svn revision-->
126-
<target name="hudson-stable" depends="suite.clean, set-spec-version, suite.nbms, unset-spec-version">
127-
</target>
128-
129-
<!--builds release installers-->
130-
<target name="hudson-release" depends="suite.clean, set-spec-version, build-installers, unset-spec-version">
131-
</target>
132-
133115
<target name="set-spec-version">
134116
<property file="nbproject/project.properties"/>
135117
<foreach target="-do-spec-version" list="${modules}" delimiter=":" param="module_dir" inheritall="true">
@@ -200,130 +182,10 @@
200182
</if>
201183
</target>
202184

203-
<target name="build-installers">
204-
<property environment="env" />
205-
<property file="nbproject/project.properties"/>
206-
207-
208-
<!-- handle different environment variables to split the long build-installers process -->
209-
<if>
210-
<and>
211-
<not>
212-
<isset property="env.BUILD_X64"/>
213-
</not>
214-
<not>
215-
<isset property="env.BUILD_X86"/>
216-
</not>
217-
<not>
218-
<isset property="env.BUILD_OTHER"/>
219-
</not>
220-
</and>
221-
<then>
222-
<echo message="No platform specified, building all platforms"/>
223-
<property name="generate.installer.for.platforms" value="windows-x64 linux-x64 macosx"/>
224-
</then>
225-
<else>
226-
<if>
227-
<equals arg1="${env.BUILD_X64}" arg2="true"/>
228-
<then>
229-
<property name="temp.platform1" value="windows-x64 linux-x64 "/>
230-
<echo message="Building for the X64 architecture"/>
231-
</then>
232-
<else>
233-
<property name="temp.platform1" value="" /> <!-- So it isn't undefined -->
234-
</else>
235-
</if>
236-
<if>
237-
<equals arg1="${env.BUILD_X86}" arg2="true"/>
238-
<then>
239-
<property name="temp.platform2" value="windows-x86 " />
240-
<echo message="Building for the X86 architecture "/>
241-
</then>
242-
<else>
243-
<property name="temp.platform2" value="" /> <!-- So it isn't undefined -->
244-
</else>
245-
</if>
246-
<if>
247-
<equals arg1="${env.BUILD_OTHER}" arg2="true"/>
248-
<then>
249-
<property name="temp.platform3" value="macosx"/>
250-
<echo message="Building for Mac OS X"/>
251-
</then>
252-
<else>
253-
<property name="temp.platform3" value="" /> <!-- So it isn't undefined -->
254-
</else>
255-
</if>
256-
<!-- Since properties are immutable we needed temporary values -->
257-
<property name="generate.installer.for.platforms" value="${temp.platform1}${temp.platform2}${temp.platform3}"/>
258-
</else>
259-
</if>
260-
261-
<ant antfile="template.xml" dir="nbi/stub">
262-
<property name="suite.location" value="${basedir}"/>
263-
<property name="suite.nbi.product.uid" value="${app.name}"/>
264-
<!--TODO: this is .0.2 because of the pre-release static 3.0.0, else the RCs could not be installed next to a beta-->
265-
<property name="suite.nbi.product.version" value="${plugins.version}.0.${nbm.revision}"/>
266-
<property name="nbi.stub.location" value="${basedir}/nbi/stub"/>
267-
<property name="nbi.stub.common.location" value="${basedir}/nbi/.common"/>
268-
<property name="nbi.ant.tasks.jar" value="${basedir}/nbi/antlib/nbi-ant-tasks.jar"/>
269-
<property name="nbi.registries.management.jar" value="${basedir}/nbi/antlib/nbi-registries-management.jar"/>
270-
<property name="nbi.engine.jar" value="${basedir}/nbi/antlib/nbi-engine.jar"/>
271-
<property name="nbi.license.file" value="${basedir}/licenses-sdk.txt"/>
272-
<!-- <property name="generate.installer.for.platforms" value="windows-x86 windows-x64 linux-x86 linux-x64 macosx"/> -->
273-
<property name="generator-jdk-location-forward-slashes" value="${java.home}"/>
274-
<property name="generated-installers-location-forward-slashes" value="${basedir}/build/installer"/>
275-
<property name="pack200.enabled" value="false"/>
276-
<property name="nbi.icon.file" value="${basedir}/jmonkeyplatform.png"/>
277-
<property name="nbi.dock.icon.file" value="${basedir}/jmonkeyplatform.icns"/>
278-
<property name="product.description" value="${app.description}"/>
279-
<property name="product.categories" value="${app.categories}"/>
280-
</ant>
281-
</target>
282-
283185
<target name="build-zip-for-installer" depends="-set-bundled-jdkhome, suite.build-zip"/>
284186

285187
<target name="-set-bundled-jdkhome">
286188
<property name="jdkhome.string" value='jdkhome="jdk"'/>
287189
</target>
288190

289-
<!--creates a debian package from the installer-->
290-
<target name="create-deb-package" depends="suite.build-zip">
291-
<unzip src="${dist.dir}/${app.name}.zip" dest="${dist.dir}/${app.name}">
292-
<globmapper from="${app.name}/*" to="*"/>
293-
</unzip>
294-
<desktopentry
295-
toFile="build/${app.name}.desktop"
296-
name="${app.title}"
297-
comment="${app.title}"
298-
exec="/opt/${app.name}/bin/${app.name}"
299-
icon="/opt/${app.name}/${app.name}.png"
300-
categories="Development;Java"
301-
/>
302-
<deb toDir="dist"
303-
package="jme3-sdk"
304-
version="${app.version}"
305-
section="devel"
306-
depends="sun-java6-jdk"
307-
maintainer="jMonkeyEngine"
308-
homepage="http://www.jmonkeyengine.org"
309-
postrm="debscripts/postrm"
310-
>
311-
<tarfileset dir="dist/${app.name}/" prefix="opt/${app.name}">
312-
<exclude name="bin/**"/>
313-
</tarfileset>
314-
<tarfileset dir="dist/${app.name}/bin" prefix="opt/${app.name}/bin" filemode="755">
315-
<exclude name="*.exe"/>
316-
</tarfileset>
317-
<tarfileset file="build/${app.name}.desktop" prefix="usr/share/applications"/>
318-
<tarfileset file="${app.name}.png" prefix="opt/${app.name}"/>
319-
<description synopsis="jMonkeyEngine3 SDK is a complete solution for Java OpenGL game development.">
320-
jMonkeyEngine 3 was rebuilt from the ground up to be a modern 3D game engine,
321-
compatible with OpenGL 2.0 and above.
322-
Its architecture is shader-based, making it fully capable of current and
323-
next generation graphics standards. The jMonkeyEngine SDK gives you a complete IDE
324-
for coding and for managing and creating game assets.
325-
</description>
326-
</deb>
327-
</target>
328-
329191
</project>

installers/build-installers.sh

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
#!/bin/bash
2+
#(c) jmonkeyengine.org
3+
4+
# Uses NBPackage to create installers for different platforms.
5+
# Prequisites for running this script:
6+
# - The SDK ZIP build must already exist
7+
# - JDKs must already been downloaded
8+
# Some quirks exist with the different platform installers:
9+
# - Linux DEPs are only created with current architecture
10+
# - Windows installer requires Inno Setup, this seems like an easy thing to break in this chain
11+
12+
set -e # Quit on Error
13+
14+
nbpackage_version="1.0-beta6"
15+
nbpackage_url="https://archive.apache.org/dist/netbeans/netbeans-nbpackage/$nbpackage_version/nbpackage-$nbpackage_version-bin.zip"
16+
inno_setup_url="https://files.jrsoftware.org/is/6/innosetup-6.5.1.exe"
17+
18+
function download_nbpackage {
19+
echo "> Downloading the nbpackage"
20+
21+
22+
if [ -f "downloads/nbpackage.zip" ];
23+
then
24+
echo "< Already existing, SKIPPING."
25+
else
26+
mkdir -p downloads
27+
28+
curl -# -o downloads/nbpackage.zip -L $nbpackage_url
29+
echo "< OK!"
30+
fi
31+
}
32+
33+
function prepare_nbpackage {
34+
echo "> Extracting the nbpackage"
35+
36+
37+
if [ -d "nbpackage" ];
38+
then
39+
echo "< Already existing, SKIPPING."
40+
else
41+
unzip -qq downloads/nbpackage.zip -d nbpackage
42+
echo "< OK!"
43+
fi
44+
}
45+
46+
function build_nbpackage {
47+
echo ">> Building the nbpackage installer for $1-$2"
48+
49+
./nbpackage/nbpackage-$nbpackage_version/bin/nbpackage --input ../dist/jmonkeyplatform.zip --config "$1-$2/$3" --output ../dist/ -v -Ppackage.version="$4"
50+
51+
echo "<< OK!"
52+
}
53+
54+
55+
function build_linux_deb {
56+
echo "> Building the Linux DEB"
57+
58+
build_nbpackage linux x64 jmonkeyengine-x64-deb.properties "$1"
59+
build_nbpackage linux aarch64 jmonkeyengine-aarch64-deb.properties "$1"
60+
61+
echo "< OK!"
62+
}
63+
64+
function build_windows_installer {
65+
echo "> Building the Windows installer"
66+
67+
setup_inno_setup "$2"
68+
69+
build_nbpackage windows x64 jmonkeyengine-windows-x64.properties "$1"
70+
71+
echo "< OK!"
72+
}
73+
74+
function setup_inno_setup {
75+
echo ">> Setting up Inno Setup"
76+
77+
download_inno_setup
78+
79+
# Needs Wine!!!
80+
if [ -z "$1" ];
81+
then
82+
wine downloads/innosetup.exe /VERYSILENT
83+
else
84+
echo "<< Trying headless mode"
85+
xvfb-run wine downloads/innosetup.exe /VERYSILENT
86+
fi
87+
88+
echo "<< OK!"
89+
}
90+
91+
function download_inno_setup {
92+
echo ">>> Downloading Inno Setup"
93+
94+
95+
if [ -f "downloads/innosetup.exe" ];
96+
then
97+
echo "<<< Already existing, SKIPPING."
98+
else
99+
mkdir -p downloads
100+
101+
curl -# -o downloads/innosetup.exe -L $inno_setup_url
102+
echo "<<< OK!"
103+
fi
104+
}
105+
106+
function build_macos_pgk {
107+
echo "> Building the MacOS pgk"
108+
109+
build_nbpackage macos x64 jmonkeyengine-macos-x64.properties "$1"
110+
build_nbpackage macos aarch64 jmonkeyengine-macos-aarch64.properties "$1"
111+
112+
echo "< OK!"
113+
}
114+
115+
echo "Building installers with version tag $1"
116+
117+
versionString=$1
118+
if [[ $versionString != [[:digit:]]* ]];
119+
then
120+
versionString=${versionString:1}
121+
echo "Stripped version tag to $versionString"
122+
fi
123+
124+
download_nbpackage
125+
prepare_nbpackage
126+
build_linux_deb "$versionString"
127+
build_windows_installer "$versionString" "$2"
128+
# MACOS needs signed packages etc. So disabled
129+
#build_macos_pgk "$versionString"

0 commit comments

Comments
 (0)