Skip to content

Commit

Permalink
Merge pull request #2413 from neilccbrown/fix-greenfoot-mic
Browse files Browse the repository at this point in the history
Update mic branch
  • Loading branch information
neilccbrown authored Nov 2, 2024
2 parents e7ffd35 + a817f2b commit e1dd811
Show file tree
Hide file tree
Showing 33 changed files with 512 additions and 1,918 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
java_version='21.0.3'
java_version='21.0.4'
12 changes: 6 additions & 6 deletions .github/workflows/build-and-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/dotenv@v2
uses: xom9ikk/dotenv@v2.3.0
- name: Install Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.java_version }}
Expand All @@ -26,11 +26,11 @@ jobs:
DISPLAY=:42.0 icewm &
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Gradle Build and Test
- name: Gradle Setup
uses: gradle/actions/setup-gradle@v3
- name: Build and Test
env:
DISPLAY: ":42.0"
with:
arguments: build test -Pheadless=false --info --stacktrace --no-daemon
run: ./gradlew build test -Pheadless=false --info --stacktrace --no-daemon
- name: Check copyright
run: bash check-copyright.sh
163 changes: 119 additions & 44 deletions .github/workflows/build-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ on:
- 'greenfoot/build.gradle'
- 'bluej/package/build.xml'
- 'bluej/package/greenfoot-build.xml'
- '.env'
workflow_dispatch:
jobs:
Build-Windows-Installers:
runs-on: windows-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/dotenv@v2
uses: xom9ikk/dotenv@v2.3.0
- name: Install Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.java_version }}
Expand Down Expand Up @@ -47,20 +48,20 @@ jobs:
(Get-Content $propfile) -replace 'mingw_root=.*', "mingw_root=C:/ProgramData/mingw64/mingw64" | Set-Content $propfile
(Get-Content $propfile) -replace 'wix_bin=.*', "wix_bin=C:/Program Files (x86)/WiX Toolset v3.14/bin" | Set-Content $propfile
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@859c33240bd026ce8d5f711f5adcc65c2f8eafc1
- name: Gradle Build and Test
uses: gradle/gradle-build-action@0842a550d10f5211be8c8295f6888889e1fca291
with:
arguments: :bluej:packageBlueJWindows :greenfoot:packageGreenfootWindows --info --stacktrace --no-daemon
uses: gradle/actions/wrapper-validation@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew :bluej:packageBlueJWindows :greenfoot:packageGreenfootWindows --info --stacktrace --no-daemon
- name: Archive BlueJ Windows installers
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bluej-installers-windows
path: |
bluej/package/BlueJ-windows*.msi
bluej/package/BlueJ-windows*.zip
- name: Archive Greenfoot Windows installers
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: greenfoot-installers-windows
path: |
Expand All @@ -70,11 +71,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/dotenv@v2
uses: xom9ikk/dotenv@v2.3.0
- name: Install Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.java_version }}
Expand All @@ -90,35 +91,35 @@ jobs:
run: |
find . -name 'build.gradle' -exec sed -i '/javafx_version_setting/c\version = '\''20.0.2'\''' {} +
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@859c33240bd026ce8d5f711f5adcc65c2f8eafc1
- name: Gradle Build and Test
uses: gradle/gradle-build-action@0842a550d10f5211be8c8295f6888889e1fca291
with:
arguments: :bluej:packageBlueJLinux :greenfoot:packageGreenfootLinux --info --stacktrace --no-daemon
uses: gradle/actions/wrapper-validation@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew :bluej:packageBlueJLinux :greenfoot:packageGreenfootLinux --info --stacktrace --no-daemon
- name: Archive BlueJ Ubuntu installers
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bluej-installers-other
path: |
bluej/package/BlueJ-linux*.deb
bluej/package/BlueJ-generic*.jar
- name: Archive Greenfoot Ubuntu installers
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: greenfoot-installers-other
path: |
bluej/package/Greenfoot-linux*.deb
bluej/package/Greenfoot-generic*.jar
Build-Mac-Installers:
Build-Mac-Installers-Intel:
runs-on: macos-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/dotenv@v2
uses: xom9ikk/dotenv@v2.3.0
- name: Install Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.java_version }}
Expand Down Expand Up @@ -159,11 +160,11 @@ jobs:
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@859c33240bd026ce8d5f711f5adcc65c2f8eafc1
- name: Gradle Build and Test
uses: gradle/gradle-build-action@0842a550d10f5211be8c8295f6888889e1fca291
with:
arguments: :bluej:packageBlueJMac :greenfoot:packageGreenfootMac --info --stacktrace --no-daemon
uses: gradle/actions/wrapper-validation@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew :bluej:packageBlueJMacIntel :greenfoot:packageGreenfootMacIntel --info --stacktrace --no-daemon
- name: Sign and package
run: |
cd ${{ github.workspace }}
Expand All @@ -173,15 +174,89 @@ jobs:
bash ../sign-mac.sh ${{ secrets.DEVELOPER_NAME }} ../BlueJ-mac*.zip ${{ secrets.APPLEID_EMAIL }} ${{ secrets.APPLEID_PASSWORD }} ${{ secrets.APPLEID_TEAMID }} `basename ../BlueJ-mac*.zip .zip`.dmg bluej_appdmg.json bluej-installer-icon
bash ../sign-mac.sh ${{ secrets.DEVELOPER_NAME }} ../Greenfoot-mac*.zip ${{ secrets.APPLEID_EMAIL }} ${{ secrets.APPLEID_PASSWORD }} ${{ secrets.APPLEID_TEAMID }} `basename ../Greenfoot-mac*.zip .zip`.dmg greenfoot_appdmg.json greenfoot-installer-icon com.apple.security.device.audio-input com.apple.security.device.microphone
- name: Archive BlueJ Mac installers
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bluej-installers-mac-intel
path: |
bluej/package/BlueJ*.dmg
- name: Archive Greenfoot Mac installers
uses: actions/upload-artifact@v4
with:
name: greenfoot-installers-mac-intel
path: |
bluej/package/Greenfoot*.dmg
Build-Mac-Installers-Aarch:
runs-on: macos-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/[email protected]
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.java_version }}
java-package: jdk
architecture: aarch64
- name: Check install locations
run: |
ls $JAVA_HOME
- name: Run setup
run: |
brew install grep
brew install imagemagick
brew install [email protected]
export PATH=/usr/local/opt/[email protected]/libexec/bin:$PATH
brew install npm && npm install -g appdmg
cd ${{ github.workspace }}
echo 'ant_exe=ant' > tools.properties
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: Vh4o2zhsnBE5f
run: |
# From https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew :bluej:packageBlueJMacAarch :greenfoot:packageGreenfootMacAarch --info --stacktrace --no-daemon
- name: Sign and package
run: |
cd ${{ github.workspace }}
cd bluej/package
mkdir tmpsign
cd tmpsign
bash ../sign-mac.sh ${{ secrets.DEVELOPER_NAME }} ../BlueJ-mac*.zip ${{ secrets.APPLEID_EMAIL }} ${{ secrets.APPLEID_PASSWORD }} ${{ secrets.APPLEID_TEAMID }} `basename ../BlueJ-mac*.zip .zip`.dmg bluej_appdmg.json bluej-installer-icon
bash ../sign-mac.sh ${{ secrets.DEVELOPER_NAME }} ../Greenfoot-mac*.zip ${{ secrets.APPLEID_EMAIL }} ${{ secrets.APPLEID_PASSWORD }} ${{ secrets.APPLEID_TEAMID }} `basename ../Greenfoot-mac*.zip .zip`.dmg greenfoot_appdmg.json greenfoot-installer-icon
- name: Archive BlueJ Mac installers
uses: actions/upload-artifact@v4
with:
name: bluej-installers-mac
name: bluej-installers-mac-aarch
path: |
bluej/package/BlueJ*.dmg
- name: Archive Greenfoot Mac installers
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: greenfoot-installers-mac
name: greenfoot-installers-mac-aarch
path: |
bluej/package/Greenfoot*.dmg
Expand All @@ -190,11 +265,11 @@ jobs:
runs-on: LinuxARM64
steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Load .env file
uses: xom9ikk/dotenv@v2
uses: xom9ikk/dotenv@v2.3.0
- name: Install Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.java_version }}
Expand All @@ -208,24 +283,24 @@ jobs:
ls $JAVA_HOME
- name: Adjust JavaFX version on Linux
run: |
find . -name 'build.gradle' -exec sed -i '/javafx_version_setting/c\version = '\''20.0.2'\''' {} +
find . -name 'build.gradle' -exec sed -i '/javafx_version_setting/c\version = '\''22.0.1'\''' {} +
- name: Adjust architecture target on ARM64
run: |
find . -name 'control' -exec sed -i '/Architecture:/c\Architecture: arm64' {} +
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@859c33240bd026ce8d5f711f5adcc65c2f8eafc1
- name: Gradle Build and Test
uses: gradle/gradle-build-action@0842a550d10f5211be8c8295f6888889e1fca291
with:
arguments: :bluej:packageBlueJLinux :greenfoot:packageGreenfootLinux --info --stacktrace --no-daemon
uses: gradle/actions/wrapper-validation@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew :bluej:packageBlueJLinux :greenfoot:packageGreenfootLinux --info --stacktrace --no-daemon
- name: Archive BlueJ Ubuntu installers
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bluej-installers-arm64
path: |
bluej/package/BlueJ-linux*.deb
- name: Archive Greenfoot Ubuntu installers
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: greenfoot-installers-arm64
path: |
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ The installers are built automatically on Github. If you want to build them man
```
./gradlew packageBlueJWindows
./gradlew packageBlueJLinux
./gradlew packageBlueJMac
./gradlew packageBlueJMacIntel
./gradlew packageBlueJMacAarch
./gradlew packageGreenfootWindows
./gradlew packageGreenfootLinux
./gradlew packageGreenfootMac
./gradlew packageGreenfootMacIntel
./gradlew packageGreenfootMacAarch
```

None of the installers can be cross-built, so you must build Windows on Windows, Mac on Mac and Linux on Debian/Ubuntu. Windows requires an installation of WiX 3.10 and MinGW64 to build the installer.
None of the installers can be cross-built, so you must build Windows on Windows, Mac on Mac and Linux on Debian/Ubuntu. Windows requires an installation of WiX 3.10 and MinGW64 to build the installer. On Mac, JAVA_HOME must point to an Intel JDK for the Intel build, and an Aarch/ARM JDK for the Aarch build, so you cannot run them in the same command.

25 changes: 21 additions & 4 deletions bluej/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ dependencies {
implementation project(':boot')
implementation project(':lang-stride')

implementation 'com.google.guava:guava:33.0.0-jre'
implementation 'com.google.guava:guava:33.3.1-jre'
implementation 'com.google.guava:failureaccess:1.0.2'
implementation 'com.googlecode.java-diff-utils:diffutils:1.2.1'
implementation 'de.jangassen:nsmenufx:3.1.0'
implementation 'io.github.classgraph:classgraph:4.8.90'
Expand Down Expand Up @@ -129,17 +130,33 @@ test.dependsOn copyLibToTestBuild
group = 'org.bluej'
description = 'bluej'

task packageBlueJMac(type: Exec) {
task packageBlueJMacIntel(type: Exec) {
workingDir "package"
environment JAVA_HOME: System.getProperty('java.home')
commandLine toolProps["ant_exe"], "mac-dist",
"-Dbuild_java_home=" + System.getProperty('java.home'),
"-Dmac_bundled_jdk_path=" + System.getProperty('java.home'),
"-Dbluej.version=" + bluejVersion,
"-Dbluej.rcsuffix=" + bluejRCSuffix,
"-Dbluej_home=" + projectDir.getAbsoluteFile()
"-Dbluej_home=" + projectDir.getAbsoluteFile(),
"-Dmac_arch=x86_64",
"-Dmac_bundler_arch_dir=x64"

}
task packageBlueJMacAarch(type: Exec) {
workingDir "package"
environment JAVA_HOME: System.getProperty('java.home')
commandLine toolProps["ant_exe"], "mac-dist",
"-Dbuild_java_home=" + System.getProperty('java.home'),
"-Dmac_bundled_jdk_path=" + System.getProperty('java.home'),
"-Dbluej.version=" + bluejVersion,
"-Dbluej.rcsuffix=" + bluejRCSuffix,
"-Dbluej_home=" + projectDir.getAbsoluteFile(),
"-Dmac_arch=arm64",
"-Dmac_bundler_arch_dir=aarch64"
}
packageBlueJMac.dependsOn assemble
packageBlueJMacIntel.dependsOn assemble
packageBlueJMacAarch.dependsOn assemble

task packageBlueJWindows(type: Exec) {
workingDir "package"
Expand Down
Binary file modified bluej/lib/extensions2/submitter.jar
Binary file not shown.
Loading

0 comments on commit e1dd811

Please sign in to comment.