Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,31 @@ jobs:
with:
distribution: temurin
java-version: 21
- name: Install wine
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
- name: Grant execute permission for gradle
run: chmod +x gradlew
- name: Build the SDK
run: ./gradlew buildSdk -Ptag_name=${{ github.ref_name }}
- name: Build the JDKs
run: bash download-jdks.sh
working-directory: jdks
- name: Override Harness (custom icon)
run: ./gradlew overrideHarness -Ptag_name=${{ github.ref_name }}
- name: Build Installers
run: ant -Dstorepass="$NBM_SIGN_PASS" -Dpack200.enabled=false set-spec-version build-installers unset-spec-version
env:
BUILD_X86: false
BUILD_X64: true
BUILD_OTHER: true
run: ant -Dstorepass="$NBM_SIGN_PASS" -Dpack200.enabled=false set-spec-version build-zip unset-spec-version
- name: Fix Platform Independent Build
run: ./gradlew fixPlatformIndependent -Ptag_name=${{ github.ref_name }}
- name: Download JDKs for the installers
run: bash download-jdks.sh
working-directory: installers
- name: Build the installers
run: bash build-installers.sh ${{ github.ref_name }} headless
working-directory: installers
- name: Create Release
uses: softprops/action-gh-release@v1

with:
files: dist/jmonkeyplatform*.*
dist/jmonkeyengine-sdk*.*
dist/jMonkeyEngine-SDK*.*
tag_name: ${{ github.ref }}
name: Release ${{ github.ref }}
env:
Expand Down
13 changes: 8 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ build/*
netbeans/*
*/nbproject/private/*
ant-jme/dist
jdks/local/*
jdks/*.bin
jdks/*.exe
jdks/*.zip
dist/
/.nb-gradle/
/.nb-gradle/
jdks/downloads/
installers/downloads/
installers/nbpackage/
installers/linux-x64/jdk-x64_linux.tar.gz
installers/macos-x64/jdk-x64_macos.tar.gz
installers/windows-x64/jdk-x64_windows.zip
installers/macos-aarch64/jdk-aarch64_macos.tar.gz
138 changes: 0 additions & 138 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,6 @@
byline="true"/>
</target>

<!--
****************************************************************
Only Relevant for building nightly on Hudson server from here on
****************************************************************
-->

<!--creates update center version via hudson build server (update-help-sets, )-->
<target name="hudson-nightly" depends="suite.clean, set-impl-version, suite.nbms, unset-impl-version">
</target>

<!--to be used after release, sets version number sans svn revision-->
<target name="hudson-stable" depends="suite.clean, set-spec-version, suite.nbms, unset-spec-version">
</target>

<!--builds release installers-->
<target name="hudson-release" depends="suite.clean, set-spec-version, build-installers, unset-spec-version">
</target>

<target name="set-spec-version">
<property file="nbproject/project.properties"/>
<foreach target="-do-spec-version" list="${modules}" delimiter=":" param="module_dir" inheritall="true">
Expand Down Expand Up @@ -200,130 +182,10 @@
</if>
</target>

<target name="build-installers">
<property environment="env" />
<property file="nbproject/project.properties"/>


<!-- handle different environment variables to split the long build-installers process -->
<if>
<and>
<not>
<isset property="env.BUILD_X64"/>
</not>
<not>
<isset property="env.BUILD_X86"/>
</not>
<not>
<isset property="env.BUILD_OTHER"/>
</not>
</and>
<then>
<echo message="No platform specified, building all platforms"/>
<property name="generate.installer.for.platforms" value="windows-x64 linux-x64 macosx"/>
</then>
<else>
<if>
<equals arg1="${env.BUILD_X64}" arg2="true"/>
<then>
<property name="temp.platform1" value="windows-x64 linux-x64 "/>
<echo message="Building for the X64 architecture"/>
</then>
<else>
<property name="temp.platform1" value="" /> <!-- So it isn't undefined -->
</else>
</if>
<if>
<equals arg1="${env.BUILD_X86}" arg2="true"/>
<then>
<property name="temp.platform2" value="windows-x86 " />
<echo message="Building for the X86 architecture "/>
</then>
<else>
<property name="temp.platform2" value="" /> <!-- So it isn't undefined -->
</else>
</if>
<if>
<equals arg1="${env.BUILD_OTHER}" arg2="true"/>
<then>
<property name="temp.platform3" value="macosx"/>
<echo message="Building for Mac OS X"/>
</then>
<else>
<property name="temp.platform3" value="" /> <!-- So it isn't undefined -->
</else>
</if>
<!-- Since properties are immutable we needed temporary values -->
<property name="generate.installer.for.platforms" value="${temp.platform1}${temp.platform2}${temp.platform3}"/>
</else>
</if>

<ant antfile="template.xml" dir="nbi/stub">
<property name="suite.location" value="${basedir}"/>
<property name="suite.nbi.product.uid" value="${app.name}"/>
<!--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-->
<property name="suite.nbi.product.version" value="${plugins.version}.0.${nbm.revision}"/>
<property name="nbi.stub.location" value="${basedir}/nbi/stub"/>
<property name="nbi.stub.common.location" value="${basedir}/nbi/.common"/>
<property name="nbi.ant.tasks.jar" value="${basedir}/nbi/antlib/nbi-ant-tasks.jar"/>
<property name="nbi.registries.management.jar" value="${basedir}/nbi/antlib/nbi-registries-management.jar"/>
<property name="nbi.engine.jar" value="${basedir}/nbi/antlib/nbi-engine.jar"/>
<property name="nbi.license.file" value="${basedir}/licenses-sdk.txt"/>
<!-- <property name="generate.installer.for.platforms" value="windows-x86 windows-x64 linux-x86 linux-x64 macosx"/> -->
<property name="generator-jdk-location-forward-slashes" value="${java.home}"/>
<property name="generated-installers-location-forward-slashes" value="${basedir}/build/installer"/>
<property name="pack200.enabled" value="false"/>
<property name="nbi.icon.file" value="${basedir}/jmonkeyplatform.png"/>
<property name="nbi.dock.icon.file" value="${basedir}/jmonkeyplatform.icns"/>
<property name="product.description" value="${app.description}"/>
<property name="product.categories" value="${app.categories}"/>
</ant>
</target>

<target name="build-zip-for-installer" depends="-set-bundled-jdkhome, suite.build-zip"/>

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

<!--creates a debian package from the installer-->
<target name="create-deb-package" depends="suite.build-zip">
<unzip src="${dist.dir}/${app.name}.zip" dest="${dist.dir}/${app.name}">
<globmapper from="${app.name}/*" to="*"/>
</unzip>
<desktopentry
toFile="build/${app.name}.desktop"
name="${app.title}"
comment="${app.title}"
exec="/opt/${app.name}/bin/${app.name}"
icon="/opt/${app.name}/${app.name}.png"
categories="Development;Java"
/>
<deb toDir="dist"
package="jme3-sdk"
version="${app.version}"
section="devel"
depends="sun-java6-jdk"
maintainer="jMonkeyEngine"
homepage="http://www.jmonkeyengine.org"
postrm="debscripts/postrm"
>
<tarfileset dir="dist/${app.name}/" prefix="opt/${app.name}">
<exclude name="bin/**"/>
</tarfileset>
<tarfileset dir="dist/${app.name}/bin" prefix="opt/${app.name}/bin" filemode="755">
<exclude name="*.exe"/>
</tarfileset>
<tarfileset file="build/${app.name}.desktop" prefix="usr/share/applications"/>
<tarfileset file="${app.name}.png" prefix="opt/${app.name}"/>
<description synopsis="jMonkeyEngine3 SDK is a complete solution for Java OpenGL game development.">
jMonkeyEngine 3 was rebuilt from the ground up to be a modern 3D game engine,
compatible with OpenGL 2.0 and above.
Its architecture is shader-based, making it fully capable of current and
next generation graphics standards. The jMonkeyEngine SDK gives you a complete IDE
for coding and for managing and creating game assets.
</description>
</deb>
</target>

</project>
134 changes: 134 additions & 0 deletions installers/build-installers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#!/bin/bash
#(c) jmonkeyengine.org

# Uses NBPackage to create installers for different platforms.
# Prequisites for running this script:
# - The SDK ZIP build must already exist
# - JDKs must already been downloaded
# Some quirks exist with the different platform installers:
# - Linux DEPs are only created with current architecture
# - Windows installer requires Inno Setup, this seems like an easy thing to break in this chain

set -e # Quit on Error

nbpackage_version="1.0-beta6"
nbpackage_url="https://archive.apache.org/dist/netbeans/netbeans-nbpackage/$nbpackage_version/nbpackage-$nbpackage_version-bin.zip"
inno_setup_url="https://files.jrsoftware.org/is/6/innosetup-6.5.1.exe"

function download_nbpackage {
echo "> Downloading the nbpackage"


if [ -f "downloads/nbpackage.zip" ];
then
echo "< Already existing, SKIPPING."
else
mkdir -p downloads

curl -# -o downloads/nbpackage.zip -L $nbpackage_url
echo "< OK!"
fi
}

function prepare_nbpackage {
echo "> Extracting the nbpackage"


if [ -d "nbpackage" ];
then
echo "< Already existing, SKIPPING."
else
unzip -qq downloads/nbpackage.zip -d nbpackage
echo "< OK!"
fi
}

function build_linux_deb {
echo "> Building the Linux DEB"

./nbpackage/nbpackage-$nbpackage_version/bin/nbpackage --input ../dist/jmonkeyplatform.zip --config linux-x64/jmonkeyengine-x64-deb.properties --output ../dist/ -v -Ppackage.version=$1

Check warning on line 49 in installers/build-installers.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

installers/build-installers.sh#L49

Double quote to prevent globbing and word splitting.

echo "< OK!"
}

function build_windows_installer {
echo "> Building the Windows installer"

setup_inno_setup $2

Check warning on line 57 in installers/build-installers.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

installers/build-installers.sh#L57

Double quote to prevent globbing and word splitting.

./nbpackage/nbpackage-$nbpackage_version/bin/nbpackage --input ../dist/jmonkeyplatform.zip --config windows-x64/jmonkeyengine-windows-x64.properties --output ../dist/ -v -Ppackage.version=$1

Check warning on line 59 in installers/build-installers.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

installers/build-installers.sh#L59

Double quote to prevent globbing and word splitting.

echo "< OK!"
}

function setup_inno_setup {
echo ">> Setting up Inno Setup"

download_inno_setup

# Needs Wine!!!
if [ -z "$1" ];
then
wine downloads/innosetup.exe /VERYSILENT
else
echo "<< Trying headless mode"
xvfb-run wine downloads/innosetup.exe /VERYSILENT
fi

echo "<< OK!"
}

function download_inno_setup {
echo ">>> Downloading Inno Setup"


if [ -f "downloads/innosetup.exe" ];
then
echo "<<< Already existing, SKIPPING."
else
mkdir -p downloads

curl -# -o downloads/innosetup.exe -L $inno_setup_url
echo "<<< OK!"
fi
}

function build_macos_pgk {
echo "> Building the MacOS pgk"

build_macos_x64_pgk $1

Check warning on line 99 in installers/build-installers.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

installers/build-installers.sh#L99

Double quote to prevent globbing and word splitting.
build_macos_aarch64_pgk $1

Check warning on line 100 in installers/build-installers.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

installers/build-installers.sh#L100

Double quote to prevent globbing and word splitting.

echo "< OK!"
}

function build_macos_x64_pgk {
echo ">> Building the MacOS x64 pgk"

./nbpackage/nbpackage-$nbpackage_version/bin/nbpackage --input ../dist/jmonkeyplatform.zip --config macos-x64/jmonkeyengine-macos-x64.properties --output ../dist/ -v -Ppackage.version=$1

Check warning on line 108 in installers/build-installers.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

installers/build-installers.sh#L108

Double quote to prevent globbing and word splitting.

echo "<< OK!"
}

function build_macos_aarch64_pgk {
echo ">> Building the MacOS aarch64 pgk"

./nbpackage/nbpackage-$nbpackage_version/bin/nbpackage --input ../dist/jmonkeyplatform.zip --config macos-aarch64/jmonkeyengine-macos-aarch64.properties --output ../dist/ -v -Ppackage.version=$1

Check warning on line 116 in installers/build-installers.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

installers/build-installers.sh#L116

Double quote to prevent globbing and word splitting.

echo "<< OK!"
}

echo "Building installers with version tag $1"

versionString=$1
if [[ $versionString != [[:digit:]]* ]];
then
versionString=${versionString:1}
echo "Stripped version tag to $versionString"
fi

download_nbpackage
prepare_nbpackage
build_linux_deb $versionString

Check warning on line 132 in installers/build-installers.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

installers/build-installers.sh#L132

Double quote to prevent globbing and word splitting.
build_windows_installer $versionString $2

Check warning on line 133 in installers/build-installers.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

installers/build-installers.sh#L133

Double quote to prevent globbing and word splitting.
build_macos_pgk $versionString

Check warning on line 134 in installers/build-installers.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

installers/build-installers.sh#L134

Double quote to prevent globbing and word splitting.
Loading
Loading