Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
22 changes: 13 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,32 @@ 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*.*
files: |
dist/jmonkeyplatform*.*
dist/jmonkeyengine-sdk*.*
dist/jMonkeyEngine-SDK*.*
tag_name: ${{ github.ref }}
name: Release ${{ github.ref }}
env:
Expand Down
13 changes: 9 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ build/*
netbeans/*
*/nbproject/private/*
ant-jme/dist
jdks/local/*
jdks/*.bin
jdks/*.exe
jdks/*.zip
dist/
/.nb-gradle/MATERIAL_EDITOR_CHANGES.md
/.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
installers/linux-aarch64/jdk-aarch64_linux.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>
129 changes: 129 additions & 0 deletions installers/build-installers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#!/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_nbpackage {
echo ">> Building the nbpackage installer for $1-$2"

./nbpackage/nbpackage-$nbpackage_version/bin/nbpackage --input ../dist/jmonkeyplatform.zip --config "$1-$2/$3" --output ../dist/ -v -Ppackage.version="$4"

echo "<< OK!"
}


function build_linux_deb {
echo "> Building the Linux DEB"

build_nbpackage linux x64 jmonkeyengine-x64-deb.properties "$1"
build_nbpackage linux aarch64 jmonkeyengine-aarch64-deb.properties "$1"

echo "< OK!"
}

function build_windows_installer {
echo "> Building the Windows installer"

setup_inno_setup "$2"

build_nbpackage windows x64 jmonkeyengine-windows-x64.properties "$1"

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_nbpackage macos x64 jmonkeyengine-macos-x64.properties "$1"
build_nbpackage macos aarch64 jmonkeyengine-macos-aarch64.properties "$1"

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"
build_windows_installer "$versionString" "$2"
# MACOS needs signed packages etc. So disabled
#build_macos_pgk "$versionString"
Loading