├── .github
├── ISSUE_TEMPLATE
│ ├── bug-report.md
│ └── feature-request.md
├── pull_request_template.md
├── release-drafter.yml
├── scripts
│ └── release-plugins.sh
└── workflows
│ ├── build.yml
│ └── release.yml
├── .gitignore
├── LICENSE
├── README.md
├── build.gradle
├── external-licenses.md
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── run-tests.sh
├── settings.gradle
├── src
├── main
│ ├── java
│ │ ├── com
│ │ │ └── gluonhq
│ │ │ │ └── substrate
│ │ │ │ ├── Constants.java
│ │ │ │ ├── ProjectConfiguration.java
│ │ │ │ ├── SubstrateDispatcher.java
│ │ │ │ ├── config
│ │ │ │ ├── AndroidResolver.java
│ │ │ │ └── ConfigResolver.java
│ │ │ │ ├── feature
│ │ │ │ └── GluonFeature.java
│ │ │ │ ├── model
│ │ │ │ ├── ClassPath.java
│ │ │ │ ├── InternalProjectConfiguration.java
│ │ │ │ ├── ProcessPaths.java
│ │ │ │ ├── ReleaseConfiguration.java
│ │ │ │ └── Triplet.java
│ │ │ │ ├── target
│ │ │ │ ├── AbstractTargetConfiguration.java
│ │ │ │ ├── AndroidTargetConfiguration.java
│ │ │ │ ├── DarwinTargetConfiguration.java
│ │ │ │ ├── IosTargetConfiguration.java
│ │ │ │ ├── LinuxTargetConfiguration.java
│ │ │ │ ├── MacOSTargetConfiguration.java
│ │ │ │ ├── PosixTargetConfiguration.java
│ │ │ │ ├── TargetConfiguration.java
│ │ │ │ ├── WebTargetConfiguration.java
│ │ │ │ └── WindowsTargetConfiguration.java
│ │ │ │ └── util
│ │ │ │ ├── FileDeps.java
│ │ │ │ ├── FileOps.java
│ │ │ │ ├── Lib.java
│ │ │ │ ├── Logger.java
│ │ │ │ ├── ProcessRunner.java
│ │ │ │ ├── Strings.java
│ │ │ │ ├── Version.java
│ │ │ │ ├── VersionParser.java
│ │ │ │ ├── XcodeUtils.java
│ │ │ │ ├── ios
│ │ │ │ ├── CodeSigning.java
│ │ │ │ ├── Deploy.java
│ │ │ │ ├── Identity.java
│ │ │ │ ├── InfoPlist.java
│ │ │ │ ├── MobileProvision.java
│ │ │ │ └── Simulator.java
│ │ │ │ ├── linux
│ │ │ │ ├── LinuxFlavor.java
│ │ │ │ └── LinuxLinkerFlags.java
│ │ │ │ ├── macos
│ │ │ │ ├── CodeSigning.java
│ │ │ │ ├── Identity.java
│ │ │ │ ├── InfoPlist.java
│ │ │ │ ├── Packager.java
│ │ │ │ └── ProvisionProfile.java
│ │ │ │ ├── plist
│ │ │ │ ├── NSArrayEx.java
│ │ │ │ ├── NSDictionaryEx.java
│ │ │ │ └── NSObjectEx.java
│ │ │ │ ├── web
│ │ │ │ └── AheadOfTimeBase.java
│ │ │ │ └── windows
│ │ │ │ └── MSIBundler.java
│ │ └── module-info.java
│ └── resources
│ │ ├── config
│ │ ├── jniconfig-java.json
│ │ ├── jniconfig-java11.json
│ │ ├── jniconfig-javafxsw.json
│ │ ├── reflectionconfig-java.json
│ │ └── reflectionconfig-javafxsw.json
│ │ ├── native
│ │ ├── android
│ │ │ ├── android_project
│ │ │ │ ├── app
│ │ │ │ │ ├── build.gradle
│ │ │ │ │ ├── keystore.properties
│ │ │ │ │ └── src
│ │ │ │ │ │ └── main
│ │ │ │ │ │ ├── AndroidManifest.xml
│ │ │ │ │ │ ├── java
│ │ │ │ │ │ ├── com
│ │ │ │ │ │ │ └── gluonhq
│ │ │ │ │ │ │ │ └── helloandroid
│ │ │ │ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ │ │ │ ├── NativeWebView.java
│ │ │ │ │ │ │ │ └── PermissionRequestActivity.java
│ │ │ │ │ │ └── javafx
│ │ │ │ │ │ │ └── scene
│ │ │ │ │ │ │ └── input
│ │ │ │ │ │ │ └── KeyCode.java
│ │ │ │ │ │ └── res
│ │ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ ├── mipmap-ldpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ │ └── mipmap-xxxhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── build.gradle
│ │ │ │ ├── gradle.properties
│ │ │ │ ├── gradle
│ │ │ │ │ └── wrapper
│ │ │ │ │ │ ├── gradle-wrapper.jar
│ │ │ │ │ │ └── gradle-wrapper.properties
│ │ │ │ ├── gradlew
│ │ │ │ ├── gradlew.bat
│ │ │ │ ├── project.properties
│ │ │ │ └── settings.gradle
│ │ │ ├── c
│ │ │ │ ├── attach_adapter.c
│ │ │ │ ├── bridge_webview.c
│ │ │ │ ├── bridge_webview.h
│ │ │ │ ├── dummy.c
│ │ │ │ ├── glibc_shim.c
│ │ │ │ ├── grandroid.h
│ │ │ │ ├── grandroid_ext.h
│ │ │ │ ├── javafx_adapter.c
│ │ │ │ ├── launcher.c
│ │ │ │ ├── logger.c
│ │ │ │ └── touch_events.c
│ │ │ └── cap
│ │ │ │ ├── AArch64LibCHelperDirectives.cap
│ │ │ │ ├── AMD64LibCHelperDirectives.cap
│ │ │ │ ├── BuiltinDirectives.cap
│ │ │ │ ├── JNIHeaderDirectives.cap
│ │ │ │ ├── JNIHeaderDirectivesJDK19OrLater.cap
│ │ │ │ ├── LLVMDirectives.cap
│ │ │ │ ├── LibFFIHeaderDirectives.cap
│ │ │ │ ├── PosixDirectives.cap
│ │ │ │ └── RISCV64LibCHelperDirectives.cap
│ │ ├── ios
│ │ │ ├── AppDelegate.m
│ │ │ ├── Default-Info.plist
│ │ │ ├── Entitlements.plist
│ │ │ ├── JvmFuncsFallbacks.c
│ │ │ ├── PrivacyInfo.xcprivacy
│ │ │ ├── assets
│ │ │ │ ├── Assets.xcassets
│ │ │ │ │ ├── AppIcon.appiconset
│ │ │ │ │ │ ├── Contents.json
│ │ │ │ │ │ ├── Gluon-app-store-icon-1024@1x.png
│ │ │ │ │ │ ├── Gluon-ipad-app-icon-76@1x.png
│ │ │ │ │ │ ├── Gluon-ipad-app-icon-76@2x.png
│ │ │ │ │ │ ├── Gluon-ipad-notifications-icon-20@1x.png
│ │ │ │ │ │ ├── Gluon-ipad-notifications-icon-20@2x.png
│ │ │ │ │ │ ├── Gluon-ipad-pro-app-icon-83.5@2x.png
│ │ │ │ │ │ ├── Gluon-ipad-settings-icon-29@1x.png
│ │ │ │ │ │ ├── Gluon-ipad-settings-icon-29@2x.png
│ │ │ │ │ │ ├── Gluon-ipad-spotlight-icon-40@1x.png
│ │ │ │ │ │ ├── Gluon-ipad-spotlight-icon-40@2x.png
│ │ │ │ │ │ ├── Gluon-iphone-app-icon-60@2x.png
│ │ │ │ │ │ ├── Gluon-iphone-app-icon-60@3x.png
│ │ │ │ │ │ ├── Gluon-iphone-notification-icon-20@2x.png
│ │ │ │ │ │ ├── Gluon-iphone-notification-icon-20@3x.png
│ │ │ │ │ │ ├── Gluon-iphone-spotlight-icon-40@2x.png
│ │ │ │ │ │ ├── Gluon-iphone-spotlight-icon-40@3x.png
│ │ │ │ │ │ ├── Gluon-iphone-spotlight-settings-icon-29@2x.png
│ │ │ │ │ │ └── Gluon-iphone-spotlight-settings-icon-29@3x.png
│ │ │ │ │ └── Contents.json
│ │ │ │ ├── Base.lproj
│ │ │ │ │ ├── LaunchScreen.storyboard
│ │ │ │ │ └── MainScreen.storyboard
│ │ │ │ ├── Default-375w-667h@2x~iphone.png
│ │ │ │ ├── Default-375w-812h-landscape@3x~iphone.png
│ │ │ │ ├── Default-375w-812h@3x~iphone.png
│ │ │ │ ├── Default-414w-736h-landscape@3x~iphone.png
│ │ │ │ ├── Default-414w-736h@3x~iphone.png
│ │ │ │ ├── Default-414w-896h-landscape@3x~iphone.png
│ │ │ │ ├── Default-414w-896h@3x~iphone.png
│ │ │ │ ├── Default-568h@2x~iphone.png
│ │ │ │ ├── Default-landscape@2x~ipad.png
│ │ │ │ ├── Default-landscape~ipad.png
│ │ │ │ ├── Default-portrait@2x~ipad.png
│ │ │ │ ├── Default-portrait~ipad.png
│ │ │ │ ├── Default@2x~iphone.png
│ │ │ │ ├── iTunesArtwork
│ │ │ │ └── iTunesArtwork@2x
│ │ │ ├── cap
│ │ │ │ ├── AArch64LibCHelperDirectives.cap
│ │ │ │ ├── AMD64LibCHelperDirectives.cap
│ │ │ │ ├── BuiltinDirectives.cap
│ │ │ │ ├── JNIHeaderDirectives.cap
│ │ │ │ ├── JNIHeaderDirectivesJDK19OrLater.cap
│ │ │ │ ├── LLVMDirectives.cap
│ │ │ │ ├── LibFFIHeaderDirectives.cap
│ │ │ │ ├── PosixDirectives.cap
│ │ │ │ └── RISCV64LibCHelperDirectives.cap
│ │ │ └── dummy.c
│ │ ├── linux-aarch64
│ │ │ └── cap
│ │ │ │ ├── AArch64LibCHelperDirectives.cap
│ │ │ │ ├── AMD64LibCHelperDirectives.cap
│ │ │ │ ├── BuiltinDirectives.cap
│ │ │ │ ├── JNIHeaderDirectives.cap
│ │ │ │ ├── LibFFIHeaderDirectives.cap
│ │ │ │ └── PosixDirectives.cap
│ │ ├── linux
│ │ │ └── launcher.c
│ │ ├── macosx
│ │ │ ├── AppDelegate.m
│ │ │ ├── assets
│ │ │ │ ├── AppIcon.iconset
│ │ │ │ │ ├── icon_128@1x.png
│ │ │ │ │ ├── icon_128@2x.png
│ │ │ │ │ ├── icon_16@1x.png
│ │ │ │ │ ├── icon_16@2x.png
│ │ │ │ │ ├── icon_256@1x.png
│ │ │ │ │ ├── icon_256@2x.png
│ │ │ │ │ ├── icon_32@1x.png
│ │ │ │ │ ├── icon_32@2x.png
│ │ │ │ │ ├── icon_512@1x.png
│ │ │ │ │ └── icon_512@2x.png
│ │ │ │ ├── Entitlements.plist
│ │ │ │ ├── Info.plist
│ │ │ │ ├── PkgInfo
│ │ │ │ ├── background.png
│ │ │ │ ├── background.tiff
│ │ │ │ ├── license.plist
│ │ │ │ ├── postinstall.sh
│ │ │ │ ├── preinstall.sh
│ │ │ │ ├── productInfo.plist
│ │ │ │ └── setup.scpt
│ │ │ └── launcher.c
│ │ └── windows
│ │ │ ├── assets
│ │ │ ├── IconGroup.rc
│ │ │ └── icon.ico
│ │ │ ├── launcher.c
│ │ │ └── wix
│ │ │ └── main.wxs
│ │ └── thirdparty
│ │ └── ios-deploy
│ │ ├── ios-deploy.rb
│ │ └── lldbpatch.diff
└── test
│ ├── java
│ └── com
│ │ └── gluonhq
│ │ └── substrate
│ │ ├── HelloFXMLTest.java
│ │ ├── HelloFXTest.java
│ │ ├── HelloGluonTest.java
│ │ ├── HelloWorldTest.java
│ │ ├── IOSTest.java
│ │ ├── SubstrateTest.java
│ │ ├── TestUtils.java
│ │ ├── config
│ │ └── ConfigTests.java
│ │ ├── model
│ │ ├── ClassPathTests.java
│ │ └── InternalProjectConfigurationTest.java
│ │ └── util
│ │ ├── FileOpsTests.java
│ │ ├── LibTest.java
│ │ ├── PlistTests.java
│ │ ├── ProcessTest.java
│ │ ├── StringsTests.java
│ │ ├── VersionParserTest.java
│ │ └── VersionTest.java
│ └── resources
│ ├── substrate-test.jar
│ ├── test-ops.xml
│ ├── test-resource.txt
│ ├── test1.plist
│ └── test2.plist
└── test-project
├── build.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── helloFX
├── build.gradle
└── src
│ └── main
│ └── java
│ └── com
│ └── gluonhq
│ └── substrate
│ └── test
│ └── Main.java
├── helloFXML
├── build.gradle
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── gluonhq
│ │ └── substrate
│ │ └── test
│ │ ├── Main.java
│ │ └── MainController.java
│ └── resources
│ └── com
│ └── gluonhq
│ └── substrate
│ └── test
│ ├── bundle.properties
│ ├── main.fxml
│ └── style.css
├── helloGluon
├── build.gradle
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── gluonhq
│ │ └── substrate
│ │ └── test
│ │ └── Main.java
│ └── resources
│ └── com
│ └── gluonhq
│ └── substrate
│ └── test
│ ├── openduke.png
│ └── styles.css
├── helloWorld
├── build.gradle
└── src
│ └── main
│ └── java
│ └── com
│ └── gluonhq
│ └── substrate
│ └── test
│ └── Main.java
└── settings.gradle
/.github/ISSUE_TEMPLATE/bug-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 'Bug report'
3 | about: 'Create a report to help us improve'
4 | labels: 'bug'
5 | ---
6 |
7 |
8 |
9 | ### Expected Behavior
10 |
11 |
12 | ### Current Behavior
13 |
14 |
15 | ### Steps to Reproduce
16 |
17 |
18 | ### Your Environment
19 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 'Feature request'
3 | about: 'Suggest an idea for this project'
4 | labels: 'enhancement'
5 | ---
6 |
7 |
8 |
9 | ### Expected Behavior
10 |
11 |
12 | ### Current Behavior
13 |
14 |
15 | ### Context
16 |
17 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ### Issue
4 |
5 |
6 | Fixes #
7 |
8 | ### Progress
9 |
10 | - [ ] Change must not contain extraneous whitespace
11 | - [ ] License header year is updated, if required
12 | - [ ] Verify the contributor has signed [Gluon Individual Contributor License Agreement (CLA)](https://docs.google.com/forms/d/16aoFTmzs8lZTfiyrEm8YgMqMYaGQl0J8wA0VJE2LCCY)
--------------------------------------------------------------------------------
/.github/release-drafter.yml:
--------------------------------------------------------------------------------
1 | exclude-labels:
2 | - 'housekeeping'
3 | template: |
4 | ## What’s Changed
5 | $CHANGES
--------------------------------------------------------------------------------
/.github/scripts/release-plugins.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | echo "Wait for a minute for Maven Central to sync and make the artifact available to gluonfx plugins"
4 | counter=1
5 | while [ $counter -le 60 ]
6 | do
7 | printf "."
8 | sleep 1s
9 | ((counter++))
10 | done
11 |
12 | git config --global user.email "githubbot@gluonhq.com"
13 | git config --global user.name "Gluon Bot"
14 |
15 | GLUONFX_MAVEN_REPO_SLUG=gluonhq/gluonfx-maven-plugin
16 | GLUONFX_GRADLE_REPO_SLUG=gluonhq/gluonfx-gradle-plugin
17 |
18 | cd $HOME
19 | git clone --depth 5 https://github.com/$GLUONFX_MAVEN_REPO_SLUG
20 | git clone --depth 5 https://github.com/$GLUONFX_GRADLE_REPO_SLUG
21 |
22 | ###############################
23 | #
24 | # Release gluonfx-maven-plugin
25 | #
26 | ###############################
27 | cd $HOME/gluonfx-maven-plugin
28 | # Update Substrate
29 | mvn versions:set-property -Dproperty=substrate.version -DnewVersion=$1 -DgenerateBackupPoms=false
30 | git commit pom.xml -m "Update Substrate version to $1"
31 | # Remove SNAPSHOT
32 | mvn versions:set -DremoveSnapshot
33 | GLUONFX_PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
34 | # Commit and push tag
35 | git commit pom.xml -m "Release $GLUONFX_PROJECT_VERSION"
36 | git tag $GLUONFX_PROJECT_VERSION
37 | git push https://gluon-bot:$2@github.com/$GLUONFX_MAVEN_REPO_SLUG $GLUONFX_PROJECT_VERSION
38 |
39 | ###############################
40 | #
41 | # Release gluonfx-gradle-plugin
42 | #
43 | ###############################
44 | cd $HOME/gluonfx-gradle-plugin
45 | # Update Substrate version
46 | sed -i "0,/com.gluonhq:substrate:.*/s//com.gluonhq:substrate:$1'/" build.gradle
47 | git commit build.gradle -m "Update Substrate version to $1"
48 | # Remove SNAPSHOT
49 | sed -i "0,/^version '.*'/s//version '$GLUONFX_PROJECT_VERSION'/" build.gradle
50 | # Commit and push tag
51 | git commit build.gradle -m "Release $GLUONFX_PROJECT_VERSION"
52 | git tag $GLUONFX_PROJECT_VERSION
53 | git push https://gluon-bot:$2@github.com/$GLUONFX_GRADLE_REPO_SLUG $GLUONFX_PROJECT_VERSION
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Substrate Build
2 | on:
3 | push:
4 | branches:
5 | - master
6 | pull_request:
7 | branches:
8 | - master
9 |
10 | jobs:
11 | build:
12 | name: Build
13 | runs-on: ${{ matrix.os }}
14 | strategy:
15 | fail-fast: false
16 | matrix:
17 | os: [ubuntu-latest, macos-latest, windows-latest]
18 | include:
19 | - os: ubuntu-latest
20 | ARCH: "x86_64"
21 | - os: macos-latest
22 | ARCH: "aarch64"
23 | - os: windows-latest
24 | ARCH: "x86_64"
25 |
26 | steps:
27 | - name: Install packages (Linux)
28 | if: runner.os == 'Linux'
29 | run: |
30 | sudo apt-get update
31 | sudo apt-get install at-spi2-core build-essential libgtk-3-dev libxtst-dev libavcodec-dev libavformat-dev libasound2-dev libgl-dev
32 |
33 | - uses: actions/checkout@v4
34 |
35 | - name: Add msbuild to PATH (Windows)
36 | if: runner.os == 'Windows'
37 | uses: microsoft/setup-msbuild@v1.0.2
38 |
39 | - name: Visual Studio shell (Windows)
40 | if: runner.os == 'Windows'
41 | uses: egor-tensin/vs-shell@v1
42 |
43 | - name: Setup Gluon's GraalVM
44 | uses: gluonhq/setup-graalvm@master
45 | with:
46 | graalvm: '22.1.0.1-Final'
47 | jdk: 'java17'
48 | arch: ${{ matrix.ARCH }}
49 | env:
50 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51 |
52 | - name: Shutdown and Reset all Simulators (MacOS)
53 | if: runner.os == 'macOS'
54 | run: sudo xcrun simctl shutdown all && sudo xcrun simctl erase all
55 |
56 | - name: Checkout
57 | uses: actions/checkout@v4
58 |
59 | - name: Setup Java 11
60 | uses: actions/setup-java@v4
61 | with:
62 | distribution: 'temurin'
63 | java-version: 11
64 |
65 | - name: Grant execute permission for gradlew
66 | run: chmod +x gradlew
67 |
68 | - name: Run Tests (Linux)
69 | if: runner.os == 'Linux'
70 | run: |
71 | export DISPLAY=:90
72 | Xvfb -ac :90 -screen 0 1280x1024x24 > /dev/null 2>&1 &
73 | ./gradlew -i test
74 |
75 | - name: Run Tests (MacOS)
76 | if: runner.os == 'macOS'
77 | run: |
78 | ./gradlew -i test
79 |
80 | - name: Run Tests (Windows)
81 | if: runner.os == 'Windows'
82 | run: |
83 | ./gradlew -i test
84 |
85 | - name: Build project
86 | run: ./gradlew -i build -x test
87 |
88 | - name: Deploy Snapshot
89 | if: runner.os == 'Linux' && github.ref == 'refs/heads/master'
90 | run: ./gradlew publish -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD
91 | env:
92 | SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
93 | SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
94 |
95 | - name: Draft release
96 | if: runner.os == 'Linux' && github.ref == 'refs/heads/master'
97 | # Drafts your next Release notes as Pull Requests are merged into "master"
98 | uses: release-drafter/release-drafter@v5
99 | env:
100 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 | on:
3 | push:
4 | tags:
5 | - '*'
6 |
7 | jobs:
8 | release:
9 | runs-on: ubuntu-latest
10 | outputs:
11 | deployment: ${{ steps.deploy.outputs.exit_code }}
12 | steps:
13 | - name: Checkout
14 | uses: actions/checkout@v4
15 | with:
16 | fetch-depth: 5
17 | persist-credentials: false
18 |
19 | - name: Setup Java 11
20 | uses: actions/setup-java@v4
21 | with:
22 | distribution: 'temurin'
23 | java-version: 11
24 |
25 | - name: Grant execute permission for gradlew
26 | run: chmod +x gradlew
27 |
28 | - name: Import GPG keys
29 | run: |
30 | gpg --import --batch <(echo "$GPG_PRIVATE_KEY") &> /dev/null
31 | # Gradle doesn't support GPG 2.1 and later: https://github.com/gradle/gradle/issues/888
32 | gpg --export-secret-keys --pinentry-mode loopback --passphrase="$GPG_PASSPHRASE" > ~/.gnupg/secring.gpg
33 | rm -rf /tmp/secret
34 | env:
35 | GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
36 | GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
37 |
38 | - name: Deploy to Sonatype Nexus
39 | id: deploy
40 | run: |
41 | ./gradlew publish closeAndReleaseSonatypeStagingRepository --info -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD -Psigning.keyId=$GPG_KEYNAME -Psigning.password=$GPG_PASSPHRASE -Psigning.secretKeyRingFile=$HOME/.gnupg/secring.gpg
42 | echo ::set-output name=exit_code::$?
43 | env:
44 | SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
45 | SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
46 | GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
47 | GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
48 |
49 | commit-development-version:
50 | runs-on: ubuntu-latest
51 | needs: [ release ]
52 | steps:
53 | - name: Checkout
54 | uses: actions/checkout@v4
55 | with:
56 | fetch-depth: 5
57 | persist-credentials: false
58 | - name: Commit next development version
59 | if: needs.release.outputs.deployment == 0
60 | run: |
61 | git config user.email "githubbot@gluonhq.com"
62 | git config user.name "Gluon Bot"
63 | TAG=${GITHUB_REF/refs\/tags\//}
64 | newVersion=${TAG%.*}.$((${TAG##*.} + 1)) # Update version by 1
65 | sed -i -z "0,/version = $TAG/s//version = $newVersion-SNAPSHOT/" gradle.properties
66 | git commit gradle.properties -m "Prepare development of $newVersion"
67 | git push https://gluon-bot:$PAT@github.com/$GITHUB_REPOSITORY HEAD:master
68 | env:
69 | PAT: ${{ secrets.GITHUB_TOKEN }}
70 |
71 | release-notes:
72 | runs-on: ubuntu-latest
73 | needs: [ release ]
74 | steps:
75 | - name: Create GitHub release
76 | uses: softprops/action-gh-release@v2
77 | with:
78 | generate_release_notes: true
79 |
80 | release-gluonfx-plugins:
81 | runs-on: ubuntu-latest
82 | needs: [ release ]
83 | steps:
84 | - name: Checkout
85 | uses: actions/checkout@v4
86 | with:
87 | fetch-depth: 5
88 | persist-credentials: false
89 | - run: |
90 | TAG=${GITHUB_REF/refs\/tags\//}
91 | bash $GITHUB_WORKSPACE/.github/scripts/release-plugins.sh $TAG $PAT
92 | env:
93 | PAT: ${{ secrets.PAT }}
94 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 | !src/main/resources/native/android/dalvik/precompiled/**/*.class
4 |
5 | # Log file
6 | *.log
7 |
8 | # BlueJ files
9 | *.ctxt
10 |
11 | # Mobile Tools for Java (J2ME)
12 | .mtj.tmp/
13 |
14 | # Package Files #
15 | #*.jar
16 | *.war
17 | *.nar
18 | *.ear
19 | *.zip
20 | *.tar.gz
21 | *.rar
22 |
23 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
24 | hs_err_pid*
25 | .gradle
26 | .idea
27 | build
28 | out
29 | libs
30 | bin
31 | .project
32 | .classpath
33 | .vscode
34 | .settings
35 | local.properties
36 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Gluon Substrate
2 |
3 | [](https://search.maven.org/#search|ga|1|com.gluonhq.substrate)
4 | [](https://github.com/gluonhq/substrate/actions?query=workflow%3A%22Substrate+Build%22)
5 |
6 | Gluon Substrate is a tool that converts Java(FX) Client applications into
7 | native executables for desktop, mobile and embedded devices.
8 | It uses the [GraalVM](https://www.graalvm.org/) GraalVM native-image tool to
9 | compile the required Java bytecode into code that can be executed on the
10 | target system (e.g. your desktop, on iOS, on a Raspberry Pi).
11 |
12 | Gluon Substrate deals with JavaFX resources (e.g. FXML, shader code,...)
13 | and with platform-specific Java and native code that is part of the
14 | JavaFX platform.
15 |
16 | While Gluon Substrate has an API that allows direct access to it, it
17 | is recommended to use the [Maven plugin](https://github.com/gluonhq/client-maven-plugin.git) which simply requires some configuration in the `pom.xml`
18 | file of your project. The plugin will then invoke the Substrate API
19 | which in turn will use GraalVM native-image to compile the Java code,
20 | and it will link the result with the required libraries and configuration
21 | into a native executable.
22 |
23 | There are a number of [samples](https://github.com/gluonhq/gluon-samples)
24 | available that show you how to get started
25 | with Gluon Substrate. We recommend using your favourite IDE to run those
26 | samples.
27 |
28 | ## Compilation
29 |
30 | ### Linux hosts
31 |
32 | To compile Gluon Substrate on Linux you need to install these development packages:
33 |
34 | # on ubuntu (debian flavors)
35 | apt-get install libasound2-dev libavcodec-dev libavformat-dev libavutil-dev libfreetype6-dev
36 | apt-get install libgl-dev libglib2.0-dev libgtk-3-dev libpango1.0-dev libx11-dev libxtst-dev zlib1g-dev
37 |
38 | # on fedora (redhat flavors), requires https://rpmfusion.org/
39 | dnf install alsa-lib-devel freetype-devel glib2-devel gtk3-devel libX11-devel
40 | dnf install libXtst-devel mesa-libGL-devel pango-devel zlib-devel
41 | dnf install ffmpeg-devel
42 |
43 |
44 | ## Issues and Contributions ##
45 |
46 | Issues can be reported to the [Issue tracker](https://github.com/gluonhq/substrate/issues)
47 |
48 | Contributions can be submitted via [Pull requests](https://github.com/gluonhq/substrate/pulls),
49 | providing you have signed the [Gluon Individual Contributor License Agreement (CLA)](https://docs.google.com/forms/d/16aoFTmzs8lZTfiyrEm8YgMqMYaGQl0J8wA0VJE2LCCY).
50 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | import java.time.Duration
2 |
3 | plugins {
4 | id 'java'
5 | id 'signing'
6 | id 'maven-publish'
7 | id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
8 | }
9 |
10 | group = "com.gluonhq"
11 |
12 | sourceCompatibility = JavaVersion.VERSION_11
13 |
14 | repositories {
15 | mavenCentral()
16 | }
17 |
18 | test {
19 | dependsOn publishToMavenLocal
20 | useJUnitPlatform()
21 |
22 | testLogging {
23 | events 'PASSED', 'FAILED', 'SKIPPED'
24 | stackTraceFilters = []
25 | }
26 | }
27 |
28 | dependencies {
29 | implementation 'com.googlecode.plist:dd-plist:1.23'
30 | implementation 'org.bouncycastle:bcpkix-jdk15on:1.49'
31 | implementation 'org.graalvm.nativeimage:svm:21.1.0'
32 | implementation 'org.apidesign.bck2brwsr:aot:0.53'
33 |
34 | testImplementation gradleTestKit()
35 | testImplementation "org.junit.jupiter:junit-jupiter-api:$jUnitVersion"
36 | testImplementation "org.junit.jupiter:junit-jupiter-params:$jUnitVersion"
37 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$jUnitVersion"
38 | }
39 |
40 | compileJava {
41 | doFirst {
42 | options.compilerArgs = ['--module-path', classpath.filter { f -> !f.name.endsWith(".tar.gz") }.asPath]
43 | classpath = files()
44 | }
45 | }
46 |
47 | javadoc {
48 | options.addStringOption("Xdoclint:none", "-quiet")
49 | options.addBooleanOption('html5', true)
50 | options.addBooleanOption('javafx', true)
51 | doFirst {
52 | options.modulePath = classpath.filter { f -> !f.name.endsWith(".tar.gz") }.flatten()
53 | }
54 | }
55 |
56 | build.dependsOn javadoc
57 |
58 | task sourcesJar(type: Jar) {
59 | from sourceSets.main.allJava
60 | archiveClassifier = 'sources'
61 | }
62 |
63 | task javadocJar(type: Jar) {
64 | from javadoc
65 | archiveClassifier = 'javadoc'
66 | }
67 |
68 | publishing {
69 | publications {
70 | maven(MavenPublication) {
71 | artifactId = 'substrate'
72 | from components.java
73 | artifact sourcesJar
74 | artifact javadocJar
75 | pom {
76 | name = 'Gluon Substrate'
77 | description = 'Create native Java(FX) apps for desktop, mobile and embedded'
78 | url = 'https://github.com/gluonhq/substrate'
79 | licenses {
80 | license {
81 | name = 'GNU General Public License v2.0'
82 | url = 'https://www.gnu.org/licenses/old-licenses/lgpl-2.0.html'
83 | }
84 | }
85 | developers {
86 | developer {
87 | name = 'Johan Vos'
88 | email = 'johan.vos@gluonhq.com'
89 | }
90 | }
91 | scm {
92 | connection = 'scm:git:git://github.com:gluonhq/substrate.git'
93 | developerConnection = 'scm:git:ssh://github.com:gluonhq/substrate.git'
94 | url = 'https://github.com/gluonhq/substrate'
95 | }
96 | }
97 | }
98 | }
99 | }
100 |
101 | signing {
102 | required = { gradle.taskGraph.hasTask(publish) && !version.endsWith("SNAPSHOT") }
103 | sign publishing.publications.maven
104 | }
105 |
106 | nexusPublishing {
107 | repositories {
108 | sonatype {
109 | username = project.hasProperty('sonatypeUsername') ? project.property('sonatypeUsername') : ''
110 | password = project.hasProperty('sonatypePassword') ? project.property('sonatypePassword') : ''
111 | }
112 | }
113 | transitionCheckOptions {
114 | maxRetries = 100
115 | delayBetween = Duration.ofSeconds(10)
116 | }
117 | }
--------------------------------------------------------------------------------
/external-licenses.md:
--------------------------------------------------------------------------------
1 | LICENSES FOR THIRD-PARTY COMPONENTS
2 |
3 | ===============================================================================
4 |
5 | The following sections contain licensing information for libraries that we have
6 | included with the Substrate source. We are thankful to all individuals that
7 | have created these.
8 |
9 | The following software may be included in this product:
10 |
11 | com.dd.plist
12 |
13 | https://github.com/3breadt/dd-plist/blob/master/LICENSE.txt
14 |
15 | dd-plist - An open source library to parse and generate property lists
16 | Copyright (C) 2016 Daniel Dreibrodt
17 |
18 | Permission is hereby granted, free of charge, to any person obtaining a copy
19 | of this software and associated documentation files (the "Software"), to deal
20 | in the Software without restriction, including without limitation the rights
21 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22 | copies of the Software, and to permit persons to whom the Software is
23 | furnished to do so, subject to the following conditions:
24 |
25 | The above copyright notice and this permission notice shall be included in
26 | all copies or substantial portions of the Software.
27 |
28 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 | SOFTWARE.
35 | ---------------------------------------------------------------------------
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Substrate Version
2 | version = 0.0.67-SNAPSHOT
3 |
4 | jUnitVersion = 5.3.1
5 |
6 | # disable publish of sha256, sha512
7 | systemProp.org.gradle.internal.publish.checksums.insecure=true
8 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem http://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 |
35 | @rem Find java.exe
36 | if defined JAVA_HOME goto findJavaFromJavaHome
37 |
38 | set JAVA_EXE=java.exe
39 | %JAVA_EXE% -version >NUL 2>&1
40 | if "%ERRORLEVEL%" == "0" goto init
41 |
42 | echo.
43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44 | echo.
45 | echo Please set the JAVA_HOME variable in your environment to match the
46 | echo location of your Java installation.
47 |
48 | goto fail
49 |
50 | :findJavaFromJavaHome
51 | set JAVA_HOME=%JAVA_HOME:"=%
52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53 |
54 | if exist "%JAVA_EXE%" goto init
55 |
56 | echo.
57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58 | echo.
59 | echo Please set the JAVA_HOME variable in your environment to match the
60 | echo location of your Java installation.
61 |
62 | goto fail
63 |
64 | :init
65 | @rem Get command-line arguments, handling Windows variants
66 |
67 | if not "%OS%" == "Windows_NT" goto win9xME_args
68 |
69 | :win9xME_args
70 | @rem Slurp the command line arguments.
71 | set CMD_LINE_ARGS=
72 | set _SKIP=2
73 |
74 | :win9xME_args_slurp
75 | if "x%~1" == "x" goto execute
76 |
77 | set CMD_LINE_ARGS=%*
78 |
79 | :execute
80 | @rem Setup the command line
81 |
82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83 |
84 | @rem Execute Gradle
85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86 |
87 | :end
88 | @rem End local scope for the variables with windows NT shell
89 | if "%ERRORLEVEL%"=="0" goto mainEnd
90 |
91 | :fail
92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93 | rem the _cmd.exe /c_ return code!
94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95 | exit /b 1
96 |
97 | :mainEnd
98 | if "%OS%"=="Windows_NT" endlocal
99 |
100 | :omega
101 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'substrate'
2 |
--------------------------------------------------------------------------------
/src/main/java/com/gluonhq/substrate/feature/GluonFeature.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2021, 2023, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.feature;
29 |
30 | import com.oracle.svm.core.jdk.NativeLibrarySupport;
31 | import com.oracle.svm.core.jdk.PlatformNativeLibrarySupport;
32 | import org.graalvm.nativeimage.hosted.Feature;
33 |
34 |
35 | /**
36 | *
37 | * GraalVM feature that deals with adding specific native libraries.
38 | * For those libs, JNI_OnLoad_"libname" invocations are generated.
39 | * A list of symbols is added that are marked as "U" in the compiled
40 | * objectfile, so that the linker knows which symbols to take from the
41 | * provided linklibs (as opposed to include the whole linked libs).
42 | */
43 | // We want this to be working on all platforms, but for now, it is linux-
44 | // supported only, so we include the feature in LinuxTargetConfiguration
45 | // @AutomaticFeature
46 | public class GluonFeature implements Feature {
47 | @Override
48 | public boolean isInConfiguration(IsInConfigurationAccess access) {
49 | System.err.println("[GluonFeature] enabled for config " + access);
50 | return true;
51 | }
52 |
53 | @Override
54 | public void duringSetup(DuringSetupAccess access) {
55 | System.err.println("GluonFeature enabled in setup " + access);
56 | NativeLibrarySupport.singleton().preregisterUninitializedBuiltinLibrary("prism_sw");
57 | NativeLibrarySupport.singleton().preregisterUninitializedBuiltinLibrary("prism_es2");
58 | NativeLibrarySupport.singleton().preregisterUninitializedBuiltinLibrary("glass");
59 | NativeLibrarySupport.singleton().preregisterUninitializedBuiltinLibrary("glass_monocle");
60 | NativeLibrarySupport.singleton().preregisterUninitializedBuiltinLibrary("glassgtk3");
61 |
62 | }
63 |
64 | @Override
65 | public void beforeAnalysis(BeforeAnalysisAccess a) {
66 |
67 | PlatformNativeLibrarySupport pnls = PlatformNativeLibrarySupport.singleton();
68 | pnls.addBuiltinPkgNativePrefix("com_sun_javafx_iio_jpeg");
69 | pnls.addBuiltinPkgNativePrefix("com_sun_javafx_font_FontConfigManager");
70 | pnls.addBuiltinPkgNativePrefix("com_sun_javafx_font_freetype");
71 | pnls.addBuiltinPkgNativePrefix("com_sun_prism");
72 | pnls.addBuiltinPkgNativePrefix("com_sun_glass");
73 | pnls.addBuiltinPkgNativePrefix("com_sun_pisces");
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/src/main/java/com/gluonhq/substrate/target/DarwinTargetConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020, 2025, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.target;
29 |
30 | import com.gluonhq.substrate.model.InternalProjectConfiguration;
31 | import com.gluonhq.substrate.model.ProcessPaths;
32 | import com.gluonhq.substrate.util.Logger;
33 | import com.gluonhq.substrate.util.ProcessRunner;
34 |
35 | import java.io.IOException;
36 | import java.nio.file.Path;
37 | import java.util.function.Predicate;
38 |
39 | abstract class DarwinTargetConfiguration extends PosixTargetConfiguration {
40 |
41 | DarwinTargetConfiguration(ProcessPaths paths, InternalProjectConfiguration configuration) {
42 | super(paths, configuration);
43 | }
44 |
45 | @Override
46 | public boolean createSharedLib() throws IOException, InterruptedException {
47 | if (!super.createSharedLib()) {
48 | return false;
49 | }
50 | Path lib = getSharedLibPath();
51 | String libName = lib.getName(lib.getNameCount() - 1).toString();
52 | ProcessRunner process = new ProcessRunner("install_name_tool", "-id", "@rpath/" + libName, libName);
53 | return process.runProcess("install name", lib.getParent().toFile()) == 0;
54 | }
55 |
56 | @Override
57 | Predicate getTargetSpecificNativeLibsFilter() {
58 | return this::checkFileArchitecture;
59 | }
60 |
61 | private boolean checkFileArchitecture(Path path) {
62 | try {
63 | ProcessRunner pr = new ProcessRunner("lipo", "-info", path.toFile().getAbsolutePath());
64 | pr.showSevereMessage(false);
65 | int op = pr.runProcess("lipo");
66 | if (op == 0) {
67 | return true;
68 | }
69 | } catch (IOException | InterruptedException e) {
70 | Logger.logSevere("Unrecoverable error checking file " + path + ": " + e);
71 | }
72 | Logger.logDebug("Ignore file " + path + " since lipo failed on it");
73 | return false;
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/src/main/java/com/gluonhq/substrate/target/PosixTargetConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, 2022, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.target;
29 |
30 | import com.gluonhq.substrate.model.InternalProjectConfiguration;
31 | import com.gluonhq.substrate.model.ProcessPaths;
32 | import com.gluonhq.substrate.util.Logger;
33 |
34 | import java.io.IOException;
35 | import java.nio.file.Files;
36 | import java.nio.file.Path;
37 |
38 | abstract class PosixTargetConfiguration extends AbstractTargetConfiguration {
39 |
40 | PosixTargetConfiguration(ProcessPaths paths, InternalProjectConfiguration configuration) {
41 | super(paths, configuration);
42 | }
43 |
44 | @Override
45 | void checkPlatformSpecificClibs(Path clibPath) throws IOException {
46 | Path libjvmPath = clibPath.resolve("libjvm.a");
47 | if (!Files.exists(libjvmPath)) throw new IOException("Missing library libjvm.a not in linkpath "+clibPath);
48 | }
49 |
50 | @Override
51 | public boolean createSharedLib() throws IOException, InterruptedException {
52 | if (!compile()) {
53 | Logger.logSevere("Error building a shared image: error compiling the native image");
54 | return false;
55 | }
56 | if (!link()) {
57 | Logger.logSevere("Error building a shared image: error linking the native image");
58 | return false;
59 | }
60 | return Files.exists(getSharedLibPath());
61 | }
62 |
63 | abstract Path getSharedLibPath();
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/com/gluonhq/substrate/util/Lib.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.util;
29 |
30 | /**
31 | * This class represents a java library constrained to the optional lower and upper bounds.
32 | */
33 | public class Lib {
34 | /**
35 | * lower bound of the applicable version range, inclusive
36 | */
37 | private final Integer lowerBound;
38 | /**
39 | * upper bound of the applicable version range, inclusive
40 | */
41 | private final Integer upperBound;
42 | private final String libName;
43 |
44 | private Lib(Integer lowerBound, Integer upperBound, String libName) {
45 | this.lowerBound = lowerBound;
46 | this.upperBound = upperBound;
47 | this.libName = libName;
48 | }
49 |
50 | public String getLibName() {
51 | return libName;
52 | }
53 |
54 | public boolean inRange(int javaMajorVersion) {
55 | // Java version is lower than the lower bound
56 | if (lowerBound != null && javaMajorVersion < lowerBound) return false;
57 | // Java version is higher than the upper bound
58 | if (upperBound != null && upperBound < javaMajorVersion) return false;
59 | return true;
60 | }
61 |
62 | public static Lib of(String libName) {
63 | return new Lib(null, null, libName);
64 | }
65 |
66 | public static Lib range(int lowerBound, int upperBound, String libName) {
67 | return new Lib(lowerBound, upperBound, libName);
68 | }
69 |
70 | public static Lib from(int lowerBound, String libName) {
71 | return new Lib(lowerBound, null, libName);
72 | }
73 |
74 | public static Lib upTo(int upperBound, String libName) {
75 | return new Lib(null, upperBound, libName);
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/main/java/com/gluonhq/substrate/util/Version.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.util;
29 |
30 | import java.util.Comparator;
31 |
32 | public class Version implements Comparable {
33 |
34 | private int major;
35 | private int minor;
36 | private int patch;
37 |
38 | public Version(int major) {
39 | this.major = major;
40 | }
41 |
42 | public Version(int major, int minor) {
43 | this.major = major;
44 | this.minor = minor;
45 | }
46 |
47 | public Version(int major, int minor, int patch) {
48 | this.major = major;
49 | this.minor = minor;
50 | this.patch = patch;
51 | }
52 |
53 | public Version(String version) {
54 | String[] parts = version.split("\\.");
55 | if (parts.length >= 1) {
56 | this.major = Integer.parseInt(parts[0]);
57 | }
58 | if (parts.length >= 2) {
59 | this.minor = Integer.parseInt(parts[1]);
60 | }
61 | if (parts.length >= 3) {
62 | this.patch = Integer.parseInt(parts[2]);
63 | }
64 | }
65 |
66 | public int getMajor() {
67 | return major;
68 | }
69 |
70 | public void setMajor(int major) {
71 | this.major = major;
72 | }
73 |
74 | public int getMinor() {
75 | return minor;
76 | }
77 |
78 | public void setMinor(int minor) {
79 | this.minor = minor;
80 | }
81 |
82 | public int getPatch() {
83 | return patch;
84 | }
85 |
86 | public void setPatch(int patch) {
87 | this.patch = patch;
88 | }
89 |
90 | @Override
91 | public String toString() {
92 | String version = "" + major;
93 | if (minor != 0 || patch != 0) {
94 | version += "." + minor;
95 | }
96 | if (patch != 0) {
97 | version += "." + patch;
98 | }
99 | return version;
100 | }
101 |
102 | @Override
103 | public int compareTo(Version version) {
104 | return Comparator.comparingInt(Version::getMajor)
105 | .thenComparingInt(Version::getMinor)
106 | .thenComparingInt(Version::getPatch)
107 | .compare(this, version);
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/src/main/java/com/gluonhq/substrate/util/VersionParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.util;
29 |
30 | import java.util.regex.Matcher;
31 | import java.util.regex.Pattern;
32 |
33 | public class VersionParser {
34 |
35 | private static final Pattern versionPattern = Pattern.compile("((\\d+\\.*)+)[\\D\\-]*.*");
36 |
37 | public Version parseVersion(String input) {
38 | Matcher matcher = versionPattern.matcher(input);
39 | if (matcher.find() && matcher.groupCount() >= 1) {
40 | return new Version(matcher.group(1));
41 | }
42 | return null;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/com/gluonhq/substrate/util/ios/Identity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.util.ios;
29 |
30 | import java.util.regex.Pattern;
31 |
32 | public class Identity {
33 |
34 | static final Pattern IDENTITY_PATTERN = Pattern.compile("^\\d+\\)\\s+([0-9A-F]+)\\s+\"([^\"]*)\"\\s*(.*)");
35 | static final Pattern IDENTITY_NAME_PATTERN = Pattern.compile("(?i)iPhone Developer|Apple Development|iOS Development|iPhone Distribution|Apple Distribution");
36 |
37 | static final String IDENTITY_ERROR_FLAG = "CSSMERR";
38 |
39 | private final String commonName;
40 | private final String sha1;
41 |
42 | public Identity(String sha1, String commonName) {
43 | this.sha1 = sha1;
44 | this.commonName = commonName;
45 | }
46 |
47 | public String getCommonName() {
48 | return commonName;
49 | }
50 |
51 | public String getSha1() {
52 | return sha1;
53 | }
54 |
55 | @Override
56 | public String toString() {
57 | return "SigningIdentity{" +
58 | "name='" + commonName + '\'' +
59 | ", sha1='" + sha1 + '\'' +
60 | '}';
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/com/gluonhq/substrate/util/macos/Identity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, 2021, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.util.macos;
29 |
30 | import java.util.regex.Pattern;
31 |
32 | public class Identity {
33 |
34 | static final Pattern IDENTITY_PATTERN = Pattern.compile("^\\d+\\)\\s+([0-9A-F]+)\\s+\"([^\"]*)\"\\s*(.*)");
35 | static final Pattern IDENTITY_NAME_PATTERN = Pattern.compile("Apple Development|Apple Distribution|Mac Developer|3rd Party Mac Developer Application|Developer ID Application");
36 | static final String IDENTITY_ERROR_FLAG = "CSSMERR";
37 |
38 | private final String commonName;
39 | private final String sha1;
40 |
41 | public Identity(String sha1, String commonName) {
42 | this.sha1 = sha1;
43 | this.commonName = commonName;
44 | }
45 |
46 | public String getCommonName() {
47 | return commonName;
48 | }
49 |
50 | public String getSha1() {
51 | return sha1;
52 | }
53 |
54 | @Override
55 | public String toString() {
56 | return "SigningIdentity{" +
57 | "name='" + commonName + '\'' +
58 | ", sha1='" + sha1 + '\'' +
59 | '}';
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/com/gluonhq/substrate/util/plist/NSArrayEx.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2021, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.util.plist;
29 |
30 | import com.dd.plist.NSArray;
31 | import com.dd.plist.NSDictionary;
32 | import com.dd.plist.NSObject;
33 | import com.dd.plist.PropertyListFormatException;
34 | import com.dd.plist.PropertyListParser;
35 | import org.xml.sax.SAXException;
36 |
37 | import javax.xml.parsers.ParserConfigurationException;
38 | import java.io.IOException;
39 | import java.nio.file.Path;
40 | import java.text.ParseException;
41 | import java.util.Objects;
42 | import java.util.Optional;
43 | import java.util.stream.Stream;
44 |
45 | public class NSArrayEx {
46 |
47 | private final NSArray array;
48 |
49 | public NSArrayEx() {
50 | this(new NSArray());
51 | }
52 |
53 | NSArrayEx(NSArray array) {
54 | this.array = Objects.requireNonNull(array);
55 | }
56 |
57 | public NSArrayEx(Path path) throws ParserConfigurationException, ParseException, SAXException, PropertyListFormatException, IOException {
58 | this((NSArray) PropertyListParser.parse(path.toFile()));
59 | }
60 |
61 | public NSObject[] getArray() {
62 | return array.getArray();
63 | }
64 |
65 | public void saveAsXML(Path destination) throws IOException {
66 | PropertyListParser.saveAsXML(array, destination.toFile());
67 | }
68 |
69 | public void saveAsBinary(Path destination) throws IOException {
70 | PropertyListParser.saveAsBinary(array, destination.toFile());
71 | }
72 |
73 | public Optional getFirstDictionaryEx() {
74 | return Stream.of(array.getArray())
75 | .filter(NSDictionary.class::isInstance)
76 | .map(NSDictionary.class::cast)
77 | .map(NSDictionaryEx::new)
78 | .findFirst();
79 | }
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | module com.gluonhq.substrate {
2 | requires java.logging;
3 | requires dd.plist;
4 | requires java.xml;
5 | requires bcpkix.jdk15on;
6 | requires org.graalvm.sdk;
7 | requires svm;
8 | requires aot;
9 | requires vm4brwsr;
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/resources/config/jniconfig-javafxsw.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name" : "com.sun.pisces.AbstractSurface",
4 | "fields" : [
5 | {"name":"nativePtr" }
6 | ]
7 | }
8 | ,
9 | {
10 | "name" : "com.sun.pisces.JavaSurface",
11 | "fields" : [
12 | {"name":"dataInt" }
13 | ]
14 | }
15 | ,
16 | {
17 | "name" : "com.sun.pisces.PiscesRenderer",
18 | "fields" : [
19 | {"name":"nativePtr" },
20 | {"name":"surface" }
21 | ]
22 | }
23 | ,
24 | {
25 | "name" : "com.sun.pisces.Transform6",
26 | "fields" : [
27 | {"name":"m00" },
28 | {"name":"m01" },
29 | {"name":"m10" },
30 | {"name":"m11" },
31 | {"name":"m02" },
32 | {"name":"m12" }
33 | ]
34 | }
35 | ]
--------------------------------------------------------------------------------
/src/main/resources/config/reflectionconfig-java.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name":"java.lang.Character",
4 | "methods":[{"name":"isIdeographic","parameterTypes":["int"] }]
5 | },
6 | {
7 | "name":"java.lang.Class",
8 | "methods":[
9 | {"name":"getFields","parameterTypes":[] },
10 | {"name":"getMethods","parameterTypes":[] }
11 | ]
12 | },
13 | {
14 | "name":"java.lang.Deprecated",
15 | "allDeclaredMethods":true
16 | },
17 | {
18 | "name":"java.lang.Integer"
19 | },
20 | {
21 | "name":"java.lang.Long"
22 | },
23 | {
24 | "name":"java.lang.Object",
25 | "allDeclaredMethods":true
26 | },
27 | {
28 | "name":"java.lang.Runnable"
29 | },
30 | {
31 | "name":"java.lang.String",
32 | "fields":[
33 | {"name":"coder"},
34 | {"name":"value"}
35 | ]
36 | },
37 | {
38 | "name":"java.lang.StringConcatHelper"
39 | },
40 | {
41 | "name":"java.lang.System"
42 | }
43 | ,
44 | {
45 | "name":"java.lang.System$Logger$Level",
46 | "methods":[{"name":"values","parameterTypes":[] }]
47 | }
48 | ,
49 | {
50 | "name":"java.util.logging.ConsoleHandler",
51 | "methods":[{"name":"","parameterTypes":[] }]
52 | }
53 | ,
54 | {
55 | "name":"java.util.logging.SimpleFormatter",
56 | "methods":[{"name":"","parameterTypes":[] }]
57 | }
58 | ,
59 | {
60 | "name":"java.lang.Thread",
61 | "fields":[
62 | {"name":"parkBlocker", "allowUnsafeAccess":true},
63 | {"name":"threadLocalRandomSecondarySeed", "allowUnsafeAccess":true},
64 | {"name":"tid", "allowUnsafeAccess":true}
65 | ]
66 | },
67 | {
68 | "name":"java.lang.annotation.Documented"
69 | },
70 | {
71 | "name":"java.lang.annotation.Retention",
72 | "allDeclaredMethods":true
73 | },
74 | {
75 | "name":"java.lang.annotation.RetentionPolicy",
76 | "methods":[{"name":"values","parameterTypes":[] }]
77 | },
78 | {
79 | "name":"java.lang.annotation.Target"
80 | },
81 | {
82 | "name":"java.lang.invoke.BoundMethodHandle",
83 | "methods":[{"name":"","parameterTypes":["java.lang.invoke.MethodType","java.lang.invoke.LambdaForm"] }]
84 | },
85 | {
86 | "name":"java.nio.ByteBuffer",
87 | "methods":[{"name":"order","parameterTypes":["java.nio.ByteOrder"] }]
88 | },
89 | {
90 | "name":"java.nio.ByteOrder",
91 | "methods":[{"name":"nativeOrder","parameterTypes":[] }]
92 | }
93 | ,
94 | {
95 | "name":"java.nio.file.attribute.PosixFilePermission",
96 | "methods":[{"name":"values","parameterTypes":[] }]
97 | }
98 | ,
99 | {
100 | "name":"java.security.SecureRandomParameters"
101 | }
102 | ,
103 | {
104 | "name":"java.util.Random",
105 | "fields":[{"name":"seed", "allowUnsafeAccess":true}]
106 | }
107 | ,
108 | {
109 | "name":"com.sun.crypto.provider.HmacSHA1",
110 | "methods":[{"name":"","parameterTypes":[] }]
111 | }
112 | ,
113 | {
114 | "name":"com.sun.security.sasl.gsskerb.JdkSASL",
115 | "methods":[{"name":"","parameterTypes":[] }]
116 | }
117 | ,
118 | {
119 | "name":"java.net.Inet6Address",
120 | "fields":[{"name":"holder6", "allowUnsafeAccess":true}]
121 | }
122 | ,
123 | {
124 | "name":"java.net.Inet6AddressImpl",
125 | "methods":[{"name":"","parameterTypes":[] }]
126 | }
127 | ,
128 | {
129 | "name":"java.net.InetAddress",
130 | "fields":[{"name":"holder", "allowUnsafeAccess":true}]
131 | }
132 | ,
133 | {
134 | "name":"java.net.InetSocketAddress",
135 | "fields":[{"name":"holder", "allowUnsafeAccess":true}]
136 | }
137 | ]
--------------------------------------------------------------------------------
/src/main/resources/config/reflectionconfig-javafxsw.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name" : "com.sun.prism.sw.SWPipeline",
4 | "methods":[{"name":"getInstance","parameterTypes":[] }]
5 | }
6 | ,
7 | {
8 | "name" : "com.sun.prism.sw.SWResourceFactory"
9 | }
10 | ,
11 | {
12 | "name" : "com.sun.scenario.effect.impl.prism.sw.PSWRenderer",
13 | "methods":[
14 | {"name":"createRenderer","parameterTypes":["com.sun.scenario.effect.FilterContext"] },
15 | {"name":"createJSWInstance","parameterTypes":["com.sun.scenario.effect.FilterContext"] },
16 | {"name":"createJSWInstance","parameterTypes":["com.sun.glass.ui.Screen"] }
17 | ]
18 | }
19 | ,
20 | {
21 | "name" : "com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_INPeer",
22 | "methods":[{"name":"","parameterTypes":["com.sun.scenario.effect.FilterContext","com.sun.scenario.effect.impl.Renderer","java.lang.String"] }]
23 | }
24 | ,
25 | {
26 | "name" : "com.sun.scenario.effect.impl.sw.sse.SSEBoxBlurPeer",
27 | "methods":[{"name":"","parameterTypes":["com.sun.scenario.effect.FilterContext","com.sun.scenario.effect.impl.Renderer","java.lang.String"] }]
28 | }
29 | ,
30 | {
31 | "name" : "com.sun.scenario.effect.impl.sw.sse.SSEBoxShadowPeer",
32 | "methods":[{"name":"","parameterTypes":["com.sun.scenario.effect.FilterContext","com.sun.scenario.effect.impl.Renderer","java.lang.String"] }]
33 | }
34 | ,
35 | {
36 | "name" : "com.sun.scenario.effect.impl.sw.sse.SSELinearConvolvePeer",
37 | "methods":[{"name":"","parameterTypes":["com.sun.scenario.effect.FilterContext","com.sun.scenario.effect.impl.Renderer","java.lang.String"] }]
38 | }
39 | ,
40 | {
41 | "name" : "com.sun.scenario.effect.impl.sw.sse.SSELinearConvolveShadowPeer",
42 | "methods":[{"name":"","parameterTypes":["com.sun.scenario.effect.FilterContext","com.sun.scenario.effect.impl.Renderer","java.lang.String"] }]
43 | }
44 | ,
45 | {
46 | "name" : "com.sun.scenario.effect.impl.sw.sse.SSERendererDelegate",
47 | "methods":[{"name":"","parameterTypes":[] }]
48 | }
49 | ,
50 | {
51 | "name" : "com.sun.scenario.effect.impl.sw.java.JSWRendererDelegate",
52 | "methods":[{"name":"","parameterTypes":[] }]
53 | }
54 | ,
55 | {
56 | "name" : "com.sun.scenario.effect.impl.sw.java.JSWBlend_SRC_INPeer",
57 | "methods":[{"name":"","parameterTypes":["com.sun.scenario.effect.FilterContext","com.sun.scenario.effect.impl.Renderer","java.lang.String"] }]
58 | }
59 | ,
60 | {
61 | "name" : "com.sun.scenario.effect.impl.sw.java.JSWBoxBlurPeer",
62 | "methods":[{"name":"","parameterTypes":["com.sun.scenario.effect.FilterContext","com.sun.scenario.effect.impl.Renderer","java.lang.String"] }]
63 | }
64 | ,
65 | {
66 | "name" : "com.sun.scenario.effect.impl.sw.java.JSWBoxShadowPeer",
67 | "methods":[{"name":"","parameterTypes":["com.sun.scenario.effect.FilterContext","com.sun.scenario.effect.impl.Renderer","java.lang.String"] }]
68 | }
69 | ,
70 | {
71 | "name" : "com.sun.scenario.effect.impl.sw.java.JSWLinearConvolvePeer",
72 | "methods":[{"name":"","parameterTypes":["com.sun.scenario.effect.FilterContext","com.sun.scenario.effect.impl.Renderer","java.lang.String"] }]
73 | }
74 | ,
75 | {
76 | "name" : "com.sun.scenario.effect.impl.sw.java.JSWLinearConvolveShadowPeer",
77 | "methods":[{"name":"","parameterTypes":["com.sun.scenario.effect.FilterContext","com.sun.scenario.effect.impl.Renderer","java.lang.String"] }]
78 | }
79 | ]
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | namespace 'com.gluonhq.helloandroid'
5 | compileSdkVersion 34
6 |
7 | compileOptions {
8 | sourceCompatibility 1.8
9 | targetCompatibility 1.8
10 | }
11 |
12 | defaultConfig {
13 | minSdkVersion 21
14 | targetSdkVersion 34
15 | }
16 |
17 | repositories {
18 | mavenCentral()
19 | google()
20 | maven {
21 | url "https://oss.sonatype.org/content/repositories/snapshots/"
22 | }
23 | mavenLocal()
24 | }
25 |
26 | dependencies {
27 | implementation 'com.android.support:support-v4:28.0.0'
28 | annotationProcessor 'com.android.support:support-annotations:28.0.0'
29 | // OTHER_ANDROID_DEPENDENCIES
30 | api fileTree(dir: '../libs', include: '*.aar')
31 | api fileTree(dir: '../libs', include: '*.jar')
32 | }
33 |
34 | signingConfigs {
35 | release {
36 | if (file("keystore.properties").exists()) {
37 | Properties keystoreSettings = new Properties()
38 | keystoreSettings.load(new FileInputStream(file("keystore.properties")))
39 |
40 | storeFile = file(keystoreSettings['storeFile'])
41 | storePassword = keystoreSettings['storePassword']
42 | keyAlias = keystoreSettings['keyAlias']
43 | keyPassword = keystoreSettings['keyPassword']
44 | }
45 | }
46 | }
47 |
48 | buildTypes {
49 | release {
50 | signingConfig signingConfigs.release
51 | }
52 | }
53 | }
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/app/keystore.properties:
--------------------------------------------------------------------------------
1 | storeFile=KEYSTORE_FILE
2 | storePassword=KEYSTORE_PASSWORD
3 | keyAlias=KEY_ALIAS
4 | keyPassword=KEY_PASSWORD
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/android/android_project/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/app/src/main/res/mipmap-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/android/android_project/app/src/main/res/mipmap-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/android/android_project/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/android/android_project/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/android/android_project/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/android/android_project/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | mavenLocal()
5 | google()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:8.5.0'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | mavenCentral()
16 | mavenLocal()
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/gradle.properties:
--------------------------------------------------------------------------------
1 | android.useAndroidX=true
2 | android.enableJetifier=true
3 | org.gradle.daemon=false
4 | org.gradle.jvmargs=-Xms512M -Xmx4g -XX:MaxMetaspaceSize=1g -Dkotlin.daemon.jvm.options="-Xmx1g" --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
5 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/android/android_project/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
6 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/project.properties:
--------------------------------------------------------------------------------
1 | # Project target.
2 | target=android-21
3 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/android_project/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/c/attach_adapter.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | #include "grandroid.h"
29 |
30 | // Lifecycle
31 | JNIEXPORT void JNICALL Java_com_gluonhq_helloandroid_MainActivity_nativeDispatchLifecycleEvent(JNIEnv *env, jobject activity, jstring event)
32 | {
33 | const char *chars = (*env)->GetStringUTFChars(env, event, NULL);
34 | LOGE(stderr, "Dispatching lifecycle event from native Dalvik layer: %s", chars);
35 | attach_setLifecycleEvent(chars);
36 | (*env)->ReleaseStringUTFChars(env, event, chars);
37 | }
38 |
39 | // Intent
40 | JNIEXPORT void JNICALL Java_com_gluonhq_helloandroid_MainActivity_nativeDispatchActivityResult(JNIEnv *env, jobject activity, jint requestCode, jint resultCode, jobject intent)
41 | {
42 | LOGE(stderr, "Dispatching activity result from native Dalvik layer: %d %d", requestCode, resultCode);
43 | attach_setActivityResult(requestCode, resultCode, intent);
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/c/bridge_webview.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2021, 2024, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #ifndef BRIDGE_WEBVIEW_H
30 | #define BRIDGE_WEBVIEW_H
31 |
32 | #include
33 | #include
34 |
35 | JavaVM* getWebViewGraalVM();
36 |
37 | #define ATTACH_GRAAL() \
38 | JNIEnv *graalEnv; \
39 | JavaVM* graalVM = getWebViewGraalVM(); \
40 | int tid = gettid(); \
41 | int attach_graal_det = ((*graalVM)->GetEnv(graalVM, (void **)&graalEnv, JNI_VERSION_1_6) == JNI_OK); \
42 | (*graalVM)->AttachCurrentThreadAsDaemon(graalVM, (void **) &graalEnv, NULL);
43 |
44 | #define DETACH_GRAAL() \
45 | int tid_detach = gettid(); \
46 | if (attach_graal_det == 0) (*graalVM)->DetachCurrentThread(graalVM);
47 |
48 | #define ATTACH_DALVIK() \
49 | JNIEnv *dalvikEnv; \
50 | JavaVM* dalvikVM = substrateGetAndroidVM(); \
51 | int dalviktid = gettid(); \
52 | int attach_dalvik_det = ((*dalvikVM)->GetEnv(dalvikVM, (void **)&dalvikEnv, JNI_VERSION_1_6) == JNI_OK); \
53 | (*dalvikVM)->AttachCurrentThreadAsDaemon(dalvikVM, (void **) &dalvikEnv, NULL);
54 |
55 | #define DETACH_DALVIK() \
56 | int dalviktid_detach = gettid(); \
57 | if (attach_dalvik_det == 0) (*dalvikVM)->DetachCurrentThread(dalvikVM);
58 |
59 | void androidJfx_startURL(const char *url);
60 | void androidJfx_finishURL(const char *url, const char *html);
61 | void androidJfx_failedURL(const char *url);
62 | void androidJfx_javaCallURL(const char *url);
63 |
64 | #endif /* BRIDGE_WEBVIEW_H */
65 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/c/dummy.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | #include
29 |
30 | #ifdef GVM_17
31 | // dummy symbols only for JDK17
32 | void Java_java_net_AbstractPlainDatagramSocketImpl_isReusePortAvailable0() {}
33 | void Java_java_net_AbstractPlainSocketImpl_isReusePortAvailable0() {}
34 | void Java_java_net_DatagramPacket_init() {}
35 | #else
36 | // dummy symbols only for JDK11
37 | void Java_java_net_PlainDatagramSocketImpl_send0() {}
38 | #endif
39 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/c/glibc_shim.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | #include
29 | #include
30 | #include
31 | #include
32 |
33 | int __xstat(int ver, const char * path, struct stat64 * stat_buf)
34 | {
35 | return stat64(path, stat_buf);
36 | }
37 |
38 | int __lxstat(int ver, const char * path, struct stat64 * stat_buf)
39 | {
40 | return lstat64(path, stat_buf);
41 | }
42 |
43 | int __fxstat(int ver, int fildes, struct stat64 * stat_buf)
44 | {
45 | return fstat64(fildes, stat_buf);
46 | }
47 |
48 | int __xstat64(int ver, const char * path, struct stat64 * stat_buf)
49 | {
50 | return stat64(path, stat_buf);
51 | }
52 |
53 | int __lxstat64(int ver, const char * path, struct stat64 * stat_buf)
54 | {
55 | return lstat64(path, stat_buf);
56 | }
57 |
58 | int __fxstat64(int ver, int fildes, struct stat64 * stat_buf)
59 | {
60 | return fstat64(fildes, stat_buf);
61 | }
62 |
63 | char * __xpg_strerror_r(int errnum, char * buf, size_t buflen)
64 | {
65 | strerror_r(errnum, buf, buflen);
66 | return buf;
67 | }
68 |
69 | size_t __getdelim(char **lineptr, size_t *n, int delim, FILE * stream)
70 | {
71 | return getdelim(lineptr, n, delim, stream);
72 | }
73 |
74 | int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev)
75 | {
76 | return mknod(path, mode, *dev);
77 | }
78 |
79 | int __xmknodat(int ver, int fd, const char *path, mode_t mode, dev_t *dev)
80 | {
81 | return mknodat(fd, path, mode, *dev);
82 | }
83 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/c/grandroid.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020, 2021, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | #include "grandroid_ext.h"
29 |
30 | #include
31 | #include
32 |
33 | #undef com_sun_glass_events_TouchEvent_TOUCH_PRESSED
34 | #define com_sun_glass_events_TouchEvent_TOUCH_PRESSED 811L
35 | #undef com_sun_glass_events_TouchEvent_TOUCH_MOVED
36 | #define com_sun_glass_events_TouchEvent_TOUCH_MOVED 812L
37 | #undef com_sun_glass_events_TouchEvent_TOUCH_RELEASED
38 | #define com_sun_glass_events_TouchEvent_TOUCH_RELEASED 813L
39 | #undef com_sun_glass_events_TouchEvent_TOUCH_STILL
40 | #define com_sun_glass_events_TouchEvent_TOUCH_STILL 814L
41 |
42 | extern jmethodID activity_showIME;
43 | extern jmethodID activity_hideIME;
44 |
45 | extern ANativeWindow *window;
46 | extern jfloat density;
47 |
48 | void __attribute__((weak)) androidJfx_requestGlassToRedraw() {}
49 | void __attribute__((weak)) androidJfx_setNativeWindow(ANativeWindow *nativeWindow) {}
50 | void __attribute__((weak)) androidJfx_setDensity(float nativeDensity) {}
51 | void __attribute__((weak)) androidJfx_gotTouchEvent(int count, int *actions, int *ids, int *xs, int *ys, int primary) {}
52 | void __attribute__((weak)) androidJfx_gotKeyEvent(int action, int key, jchar *chars, int count, int mods) {}
53 | void __attribute__((weak)) androidJfx_gotMenuEvent(int x, int y, int xAbs, int yAbs, bool isKeyboardTrigger) {}
54 | int __attribute__((weak)) to_jfx_touch_action(int state) { return 0; }
55 |
56 | void __attribute__((weak)) androidJfx_startURL(const char *url) {}
57 | void __attribute__((weak)) androidJfx_finishURL(const char *url, const char *html) {}
58 | void __attribute__((weak)) androidJfx_failedURL(const char *url) {}
59 | void __attribute__((weak)) androidJfx_javaCallURL(const char *url) {}
60 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/c/grandroid_ext.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 |
35 | #define ENABLE_DEBUG_LOG 1
36 | #define LOG_TAG "GraalGluon"
37 |
38 | #if ENABLE_DEBUG_LOG == 1
39 | #define LOGD(ignore, ...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
40 | #define LOGE(ignore, ...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
41 | #else
42 | #define LOGD(ignore, ...)
43 | #define LOGE(ignore, ...)
44 | #endif
45 |
46 |
47 | extern jclass activityClass;
48 | extern jobject activity;
49 |
50 | // expose AndroidVM, MainActivity and its class
51 | JavaVM* substrateGetAndroidVM();
52 | jclass substrateGetActivityClass();
53 | jclass substrateGetPermissionActivityClass();
54 | jobject substrateGetActivity();
55 |
56 | // Attach
57 |
58 | #ifdef SUBSTRATE
59 | void __attribute__((weak)) attach_setActivityResult(jint requestCode, jint resultCode, jobject intent) {}
60 | void __attribute__((weak)) attach_setLifecycleEvent(const char *event) {}
61 | #else
62 | void attach_setActivityResult(jint requestCode, jint resultCode, jobject intent);
63 | void attach_setLifecycleEvent(const char *event);
64 | #endif
65 |
66 | #define ATTACH_GRAAL() \
67 | JNIEnv *graalEnv; \
68 | JavaVM* graalVM = getGraalVM(); \
69 | int attach_graal_det = ((*graalVM)->GetEnv(graalVM, (void **)&graalEnv, JNI_VERSION_1_6) == JNI_OK); \
70 | (*graalVM)->AttachCurrentThreadAsDaemon(graalVM, (void **) &graalEnv, NULL); \
71 | LOGD(stderr, "ATTACH_GRAAL, tid = %d, existed? %d, graalEnv at %p\n", gettid(), attach_graal_det, graalEnv);
72 |
73 | #define DETACH_GRAAL() \
74 | LOGD(stderr, "DETACH_GRAAL, tid = %d, graalVM = %p, existed = %d, env at %p\n", gettid(), graalVM, attach_graal_det, graalEnv); \
75 | if (attach_graal_det == 0) (*graalVM)->DetachCurrentThread(graalVM);
76 |
77 | #define ATTACH_DALVIK() \
78 | JNIEnv *dalvikEnv; \
79 | JavaVM* dalvikVM = substrateGetAndroidVM(); \
80 | int attach_dalvik_det = ((*dalvikVM)->GetEnv(dalvikVM, (void **)&dalvikEnv, JNI_VERSION_1_6) == JNI_OK); \
81 | (*dalvikVM)->AttachCurrentThreadAsDaemon(dalvikVM, (void **) &dalvikEnv, NULL); \
82 | LOGD(stderr, "ATTACH_DALVIK, tid = %d, existed? %d, dalvikEnv at %p\n", gettid(), attach_dalvik_det, dalvikEnv);
83 |
84 | #define DETACH_DALVIK() \
85 | LOGD(stderr, "DETACH_DALVIK, tid = %d, existed = %d, env at %p\n", gettid(), attach_dalvik_det, dalvikEnv); \
86 | if (attach_dalvik_det == 0) (*dalvikVM)->DetachCurrentThread(dalvikVM);
87 |
88 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/c/logger.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | static int pfd[2];
9 | static pthread_t thr;
10 | static const char * tag;
11 | FILE * andr_out;
12 |
13 | // we need this and the start_logger since android eats fprintf
14 | static void *thread_func()
15 | {
16 | ssize_t rdsz;
17 | char buf[1024];
18 | while (fgets(buf, sizeof buf, andr_out)) {
19 | __android_log_write(ANDROID_LOG_DEBUG, tag, buf);
20 | }
21 | return 0;
22 | }
23 |
24 | int start_logger(const char *app_name)
25 | {
26 | tag = app_name;
27 |
28 | /* make stdout line-buffered and stderr unbuffered */
29 | setvbuf(stdout, 0, _IOLBF, 0);
30 | setvbuf(stderr, 0, _IONBF, 0);
31 |
32 | /* create the pipe and redirect stdout and stderr */
33 | pipe(pfd);
34 | dup2(pfd[1], 1);
35 | dup2(pfd[1], 2);
36 |
37 | andr_out = fdopen(pfd[0], "rb");
38 | /* spawn the logging thread */
39 | if (pthread_create(&thr, 0, thread_func, 0) == -1)
40 | return -1;
41 | pthread_detach(thr);
42 | return 0;
43 | }
--------------------------------------------------------------------------------
/src/main/resources/native/android/c/touch_events.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020, 2022, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | #include "grandroid.h"
29 |
30 | JNIEXPORT void JNICALL
31 | Java_javafx_scene_control_skin_TextFieldSkinAndroid_showSoftwareKeyboard();
32 |
33 | JNIEXPORT void JNICALL Java_com_gluonhq_helloandroid_MainActivity_nativeGotTouchEvent(JNIEnv *env, jobject activity, jint jcount, jintArray jactions, jintArray jids, jintArray jxs, jintArray jys)
34 | {
35 | // LOGE(stderr, "Native Dalvik layer got touch event, pass to native Graal layer...");
36 |
37 | jlong jlongids[jcount];
38 |
39 | int *actions = (*env)->GetIntArrayElements(env, jactions, 0);
40 | int *ids = (*env)->GetIntArrayElements(env, jids, 0);
41 | int *xs = (*env)->GetIntArrayElements(env, jxs, 0);
42 | int *ys = (*env)->GetIntArrayElements(env, jys, 0);
43 | int primary = 0;
44 | for (int i = 0; i < jcount; i++)
45 | {
46 | actions[i] = to_jfx_touch_action(actions[i]);
47 | jlongids[i] = (jlong)ids[i];
48 | if (actions[i] != com_sun_glass_events_TouchEvent_TOUCH_STILL)
49 | {
50 | primary = actions[i] == com_sun_glass_events_TouchEvent_TOUCH_RELEASED && jcount == 1 ? -1 : i;
51 | }
52 | }
53 | androidJfx_gotTouchEvent(jcount, actions, ids, xs, ys, primary);
54 |
55 | (*env)->ReleaseIntArrayElements(env, jactions, actions, 0);
56 | (*env)->ReleaseIntArrayElements(env, jids, ids, 0);
57 | (*env)->ReleaseIntArrayElements(env, jxs, xs, 0);
58 | (*env)->ReleaseIntArrayElements(env, jys, ys, 0);
59 |
60 | // LOGE(stderr, "Native Dalvik layer got touch event, passed to native Graal layer...");
61 | }
62 |
63 | JNIEXPORT void JNICALL Java_com_gluonhq_helloandroid_MainActivity_nativeDispatchKeyEvent(JNIEnv *env, jobject activity, jint action, jint keyCode, jcharArray jchars, jint cc, jint modifiers)
64 | {
65 | // LOGE(stderr, "Native Dalvik layer has to dispatch key event, pass to native Graal layer with %d chars...", cc);
66 | jchar *kars = (*env)->GetCharArrayElements(env, jchars, 0);
67 | androidJfx_gotKeyEvent(action, keyCode, kars, cc, modifiers);
68 | }
69 |
70 | JNIEXPORT void JNICALL Java_com_gluonhq_helloandroid_MainActivity_nativeNotifyMenu(JNIEnv *env, jobject activity, jint x, jint y, jint xAbs, jint yAbs, jboolean isKeyboardTrigger)
71 | {
72 | // LOGE(stderr, "Native Dalvik layer got notify menu, pass to native Graal layer...");
73 | androidJfx_gotMenuEvent(x, y, xAbs, yAbs, isKeyboardTrigger);
74 | }
--------------------------------------------------------------------------------
/src/main/resources/native/android/cap/JNIHeaderDirectivesJDK19OrLater.cap:
--------------------------------------------------------------------------------
1 | NativeCodeInfo:JNIHeaderDirectivesJDK19OrLater:ConstantInfo:JNI_VERSION_19:PropertyInfo:size=4
2 | NativeCodeInfo:JNIHeaderDirectivesJDK19OrLater:ConstantInfo:JNI_VERSION_19:PropertyInfo:signedness=$UNSIGNED$
3 | NativeCodeInfo:JNIHeaderDirectivesJDK19OrLater:ConstantInfo:JNI_VERSION_19:PropertyInfo:value=130000
4 | NativeCodeInfo:JNIHeaderDirectivesJDK19OrLater:StructInfo:struct_JNINativeInterface_:PropertyInfo:size=1880
5 | NativeCodeInfo:JNIHeaderDirectivesJDK19OrLater:StructInfo:struct_JNINativeInterface_:StructFieldInfo:IsVirtualThread:PropertyInfo:size=8
6 | NativeCodeInfo:JNIHeaderDirectivesJDK19OrLater:StructInfo:struct_JNINativeInterface_:StructFieldInfo:IsVirtualThread:PropertyInfo:offset=1872
7 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/cap/LLVMDirectives.cap:
--------------------------------------------------------------------------------
1 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_CLEANUP_PHASE:PropertyInfo:size=4
2 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_CLEANUP_PHASE:PropertyInfo:signedness=$UNSIGNED$
3 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_CLEANUP_PHASE:PropertyInfo:value=2
4 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_SEARCH_PHASE:PropertyInfo:size=4
5 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_SEARCH_PHASE:PropertyInfo:signedness=$UNSIGNED$
6 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_SEARCH_PHASE:PropertyInfo:value=1
7 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_CONTINUE_UNWIND:PropertyInfo:size=4
8 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_CONTINUE_UNWIND:PropertyInfo:signedness=$UNSIGNED$
9 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_CONTINUE_UNWIND:PropertyInfo:value=8
10 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_FATAL_PHASE1_ERROR:PropertyInfo:size=4
11 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_FATAL_PHASE1_ERROR:PropertyInfo:signedness=$UNSIGNED$
12 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_FATAL_PHASE1_ERROR:PropertyInfo:value=3
13 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_HANDLER_FOUND:PropertyInfo:size=4
14 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_HANDLER_FOUND:PropertyInfo:signedness=$UNSIGNED$
15 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_HANDLER_FOUND:PropertyInfo:value=6
16 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_INSTALL_CONTEXT:PropertyInfo:size=4
17 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_INSTALL_CONTEXT:PropertyInfo:signedness=$UNSIGNED$
18 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_INSTALL_CONTEXT:PropertyInfo:value=7
19 | NativeCodeInfo:LLVMDirectives:StructInfo:struct__Unwind_Exception:PropertyInfo:size=32
20 | NativeCodeInfo:LLVMDirectives:StructInfo:struct__Unwind_Exception:StructFieldInfo:exception_class:PropertyInfo:size=8
21 | NativeCodeInfo:LLVMDirectives:StructInfo:struct__Unwind_Exception:StructFieldInfo:exception_class:PropertyInfo:offset=0
22 | NativeCodeInfo:LLVMDirectives:StructInfo:struct__Unwind_Exception:StructFieldInfo:exception_cleanup:PropertyInfo:size=8
23 | NativeCodeInfo:LLVMDirectives:StructInfo:struct__Unwind_Exception:StructFieldInfo:exception_cleanup:PropertyInfo:offset=8
24 |
--------------------------------------------------------------------------------
/src/main/resources/native/android/cap/RISCV64LibCHelperDirectives.cap:
--------------------------------------------------------------------------------
1 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:PropertyInfo:size=7
2 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fA:PropertyInfo:size=1
3 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fA:PropertyInfo:offset=2
4 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fA:PropertyInfo:signedness=$UNSIGNED$
5 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fC:PropertyInfo:size=1
6 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fC:PropertyInfo:offset=5
7 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fC:PropertyInfo:signedness=$UNSIGNED$
8 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fD:PropertyInfo:size=1
9 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fD:PropertyInfo:offset=4
10 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fD:PropertyInfo:signedness=$UNSIGNED$
11 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fF:PropertyInfo:size=1
12 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fF:PropertyInfo:offset=3
13 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fF:PropertyInfo:signedness=$UNSIGNED$
14 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fI:PropertyInfo:size=1
15 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fI:PropertyInfo:offset=0
16 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fI:PropertyInfo:signedness=$UNSIGNED$
17 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fM:PropertyInfo:size=1
18 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fM:PropertyInfo:offset=1
19 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fM:PropertyInfo:signedness=$UNSIGNED$
20 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fV:PropertyInfo:size=1
21 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fV:PropertyInfo:offset=6
22 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fV:PropertyInfo:signedness=$UNSIGNED$
23 |
--------------------------------------------------------------------------------
/src/main/resources/native/ios/Default-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleIdentifier
6 | $packageName.$mainClassName
7 | CFBundleVersion
8 | $bundleVersion
9 | CFBundleShortVersionString
10 | $bundleShortVersion
11 | CFBundleExecutable
12 | $mainClassNameApp
13 | CFBundleIconName
14 | AppIcon
15 | CFBundleName
16 | $bundleName
17 | UILaunchStoryboardName
18 | LaunchScreen
19 | UIMainStoryboardFile
20 | MainScreen
21 | CFBundlePackageType
22 | APPL
23 | LSRequiresIPhoneOS
24 |
25 | UISupportedInterfaceOrientations
26 |
27 | UIInterfaceOrientationPortrait
28 | UIInterfaceOrientationLandscapeLeft
29 | UIInterfaceOrientationLandscapeRight
30 | UIInterfaceOrientationPortraitUpsideDown
31 |
32 | UISupportedInterfaceOrientations~ipad
33 |
34 | UIInterfaceOrientationPortrait
35 | UIInterfaceOrientationLandscapeLeft
36 | UIInterfaceOrientationLandscapeRight
37 | UIInterfaceOrientationPortraitUpsideDown
38 |
39 | UIRequiredDeviceCapabilities
40 |
41 | arm64
42 |
43 | UIDeviceFamily
44 |
45 | 1
46 | 2
47 |
48 | MinimumOSVersion
49 | 11.0
50 | UIRequiresFullScreen
51 | YES
52 |
53 |
54 |
--------------------------------------------------------------------------------
/src/main/resources/native/ios/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | get-task-allow
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/main/resources/native/ios/PrivacyInfo.xcprivacy:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSPrivacyAccessedAPITypes
6 |
7 |
8 | NSPrivacyAccessedAPIType
9 | NSPrivacyAccessedAPICategoryFileTimestamp
10 | NSPrivacyAccessedAPITypeReasons
11 |
12 | DDA9.1
13 |
14 |
15 |
16 | NSPrivacyAccessedAPIType
17 | NSPrivacyAccessedAPICategoryDiskSpace
18 | NSPrivacyAccessedAPITypeReasons
19 |
20 | E174.1
21 |
22 |
23 |
24 | NSPrivacyAccessedAPIType
25 | NSPrivacyAccessedAPICategorySystemBootTime
26 | NSPrivacyAccessedAPITypeReasons
27 |
28 | 35F9.1
29 | 8FFB.1
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "filename" : "Gluon-iphone-notification-icon-20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "idiom" : "iphone",
11 | "size" : "20x20",
12 | "filename" : "Gluon-iphone-notification-icon-20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "idiom" : "iphone",
17 | "size" : "29x29",
18 | "filename" : "Gluon-iphone-spotlight-settings-icon-29@2x.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "idiom" : "iphone",
23 | "size" : "29x29",
24 | "filename" : "Gluon-iphone-spotlight-settings-icon-29@3x.png",
25 | "scale" : "3x"
26 | },
27 | {
28 | "idiom" : "iphone",
29 | "size" : "40x40",
30 | "filename" : "Gluon-iphone-spotlight-icon-40@2x.png",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "40x40",
36 | "filename" : "Gluon-iphone-spotlight-icon-40@3x.png",
37 | "scale" : "3x"
38 | },
39 | {
40 | "idiom" : "iphone",
41 | "size" : "60x60",
42 | "filename" : "Gluon-iphone-app-icon-60@2x.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "idiom" : "iphone",
47 | "size" : "60x60",
48 | "filename" : "Gluon-iphone-app-icon-60@3x.png",
49 | "scale" : "3x"
50 | },
51 | {
52 | "idiom" : "ipad",
53 | "size" : "20x20",
54 | "filename" : "Gluon-ipad-notifications-icon-20@1x.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "idiom" : "ipad",
59 | "size" : "20x20",
60 | "filename" : "Gluon-ipad-notifications-icon-20@2x.png",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "29x29",
66 | "filename" : "Gluon-ipad-settings-icon-29@1x.png",
67 | "scale" : "1x"
68 | },
69 | {
70 | "idiom" : "ipad",
71 | "size" : "29x29",
72 | "filename" : "Gluon-ipad-settings-icon-29@2x.png",
73 | "scale" : "2x"
74 | },
75 | {
76 | "idiom" : "ipad",
77 | "size" : "40x40",
78 | "filename" : "Gluon-ipad-spotlight-icon-40@1x.png",
79 | "scale" : "1x"
80 | },
81 | {
82 | "idiom" : "ipad",
83 | "size" : "40x40",
84 | "filename" : "Gluon-ipad-spotlight-icon-40@2x.png",
85 | "scale" : "2x"
86 | },
87 | {
88 | "idiom" : "ipad",
89 | "size" : "76x76",
90 | "filename" : "Gluon-ipad-app-icon-76@1x.png",
91 | "scale" : "1x"
92 | },
93 | {
94 | "idiom" : "ipad",
95 | "size" : "76x76",
96 | "filename" : "Gluon-ipad-app-icon-76@2x.png",
97 | "scale" : "2x"
98 | },
99 | {
100 | "idiom" : "ipad",
101 | "size" : "83.5x83.5",
102 | "filename" : "Gluon-ipad-pro-app-icon-83.5@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "idiom" : "ios-marketing",
107 | "size" : "1024x1024",
108 | "filename" : "Gluon-app-store-icon-1024@1x.png",
109 | "scale" : "1x"
110 | }
111 | ],
112 | "info" : {
113 | "version" : 1,
114 | "author" : "xcode"
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-app-store-icon-1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-app-store-icon-1024@1x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-app-icon-76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-app-icon-76@1x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-app-icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-app-icon-76@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-notifications-icon-20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-notifications-icon-20@1x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-notifications-icon-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-notifications-icon-20@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-pro-app-icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-pro-app-icon-83.5@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-settings-icon-29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-settings-icon-29@1x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-settings-icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-settings-icon-29@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-spotlight-icon-40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-spotlight-icon-40@1x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-spotlight-icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-ipad-spotlight-icon-40@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-app-icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-app-icon-60@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-app-icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-app-icon-60@3x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-notification-icon-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-notification-icon-20@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-notification-icon-20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-notification-icon-20@3x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-spotlight-icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-spotlight-icon-40@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-spotlight-icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-spotlight-icon-40@3x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-spotlight-settings-icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-spotlight-settings-icon-29@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-spotlight-settings-icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Assets.xcassets/AppIcon.appiconset/Gluon-iphone-spotlight-settings-icon-29@3x.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Base.lproj/MainScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default-375w-667h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default-375w-667h@2x~iphone.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default-375w-812h-landscape@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default-375w-812h-landscape@3x~iphone.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default-375w-812h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default-375w-812h@3x~iphone.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default-414w-736h-landscape@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default-414w-736h-landscape@3x~iphone.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default-414w-736h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default-414w-736h@3x~iphone.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default-414w-896h-landscape@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default-414w-896h-landscape@3x~iphone.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default-414w-896h@3x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default-414w-896h@3x~iphone.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default-landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default-landscape@2x~ipad.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default-landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default-landscape~ipad.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default-portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default-portrait@2x~ipad.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default-portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default-portrait~ipad.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/Default@2x~iphone.png
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/iTunesArtwork:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/iTunesArtwork
--------------------------------------------------------------------------------
/src/main/resources/native/ios/assets/iTunesArtwork@2x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/ios/assets/iTunesArtwork@2x
--------------------------------------------------------------------------------
/src/main/resources/native/ios/cap/JNIHeaderDirectivesJDK19OrLater.cap:
--------------------------------------------------------------------------------
1 | NativeCodeInfo:JNIHeaderDirectivesJDK19OrLater:ConstantInfo:JNI_VERSION_19:PropertyInfo:size=4
NativeCodeInfo:JNIHeaderDirectivesJDK19OrLater:ConstantInfo:JNI_VERSION_19:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:JNIHeaderDirectivesJDK19OrLater:ConstantInfo:JNI_VERSION_19:PropertyInfo:value=130000
NativeCodeInfo:JNIHeaderDirectivesJDK19OrLater:StructInfo:struct_JNINativeInterface_:PropertyInfo:size=1880
NativeCodeInfo:JNIHeaderDirectivesJDK19OrLater:StructInfo:struct_JNINativeInterface_:StructFieldInfo:IsVirtualThread:PropertyInfo:size=8
NativeCodeInfo:JNIHeaderDirectivesJDK19OrLater:StructInfo:struct_JNINativeInterface_:StructFieldInfo:IsVirtualThread:PropertyInfo:offset=1872
--------------------------------------------------------------------------------
/src/main/resources/native/ios/cap/LLVMDirectives.cap:
--------------------------------------------------------------------------------
1 | NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_CLEANUP_PHASE:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_CLEANUP_PHASE:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_CLEANUP_PHASE:PropertyInfo:value=2
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_END_OF_STACK:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_END_OF_STACK:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_END_OF_STACK:PropertyInfo:value=10
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_FORCE_UNWIND:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_FORCE_UNWIND:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_FORCE_UNWIND:PropertyInfo:value=8
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_HANDLER_FRAME:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_HANDLER_FRAME:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_HANDLER_FRAME:PropertyInfo:value=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_SEARCH_PHASE:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_SEARCH_PHASE:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_UA_SEARCH_PHASE:PropertyInfo:value=1
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_CONTINUE_UNWIND:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_CONTINUE_UNWIND:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_CONTINUE_UNWIND:PropertyInfo:value=8
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_END_OF_STACK:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_END_OF_STACK:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_END_OF_STACK:PropertyInfo:value=5
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_FATAL_PHASE1_ERROR:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_FATAL_PHASE1_ERROR:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_FATAL_PHASE1_ERROR:PropertyInfo:value=3
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_FATAL_PHASE2_ERROR:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_FATAL_PHASE2_ERROR:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_FATAL_PHASE2_ERROR:PropertyInfo:value=2
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_FOREIGN_EXCEPTION_CAUGHT:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_FOREIGN_EXCEPTION_CAUGHT:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_FOREIGN_EXCEPTION_CAUGHT:PropertyInfo:value=1
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_HANDLER_FOUND:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_HANDLER_FOUND:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_HANDLER_FOUND:PropertyInfo:value=6
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_INSTALL_CONTEXT:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_INSTALL_CONTEXT:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_INSTALL_CONTEXT:PropertyInfo:value=7
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_NORMAL_STOP:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_NORMAL_STOP:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_NORMAL_STOP:PropertyInfo:value=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_NO_REASON:PropertyInfo:size=4
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_NO_REASON:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:LLVMDirectives:ConstantInfo:_URC_NO_REASON:PropertyInfo:value=0
NativeCodeInfo:LLVMDirectives:StructInfo:struct__Unwind_Exception:PropertyInfo:size=32
NativeCodeInfo:LLVMDirectives:StructInfo:struct__Unwind_Exception:StructFieldInfo:exception_class:PropertyInfo:size=8
NativeCodeInfo:LLVMDirectives:StructInfo:struct__Unwind_Exception:StructFieldInfo:exception_class:PropertyInfo:offset=0
NativeCodeInfo:LLVMDirectives:StructInfo:struct__Unwind_Exception:StructFieldInfo:exception_cleanup:PropertyInfo:size=8
NativeCodeInfo:LLVMDirectives:StructInfo:struct__Unwind_Exception:StructFieldInfo:exception_cleanup:PropertyInfo:offset=8
--------------------------------------------------------------------------------
/src/main/resources/native/ios/cap/RISCV64LibCHelperDirectives.cap:
--------------------------------------------------------------------------------
1 | NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:PropertyInfo:size=7
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fA:PropertyInfo:size=1
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fA:PropertyInfo:offset=2
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fA:PropertyInfo:signedness=$SIGNED$
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fC:PropertyInfo:size=1
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fC:PropertyInfo:offset=5
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fC:PropertyInfo:signedness=$SIGNED$
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fD:PropertyInfo:size=1
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fD:PropertyInfo:offset=4
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fD:PropertyInfo:signedness=$SIGNED$
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fF:PropertyInfo:size=1
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fF:PropertyInfo:offset=3
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fF:PropertyInfo:signedness=$SIGNED$
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fI:PropertyInfo:size=1
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fI:PropertyInfo:offset=0
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fI:PropertyInfo:signedness=$SIGNED$
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fM:PropertyInfo:size=1
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fM:PropertyInfo:offset=1
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fM:PropertyInfo:signedness=$SIGNED$
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fV:PropertyInfo:size=1
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fV:PropertyInfo:offset=6
NativeCodeInfo:RISCV64LibCHelperDirectives:StructInfo:CPUFeatures:StructFieldInfo:fV:PropertyInfo:signedness=$SIGNED$
--------------------------------------------------------------------------------
/src/main/resources/native/ios/dummy.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | #include
29 | #include
30 |
31 | typedef struct {
32 | #ifdef GVM_IOS_SIM
33 | char fCX8;
34 | char fCMOV;
35 | char fFXSR;
36 | char fHT;
37 | char fMMX;
38 | char fAMD3DNOWPREFETCH;
39 | char fSSE;
40 | char fSSE2;
41 | char fSSE3;
42 | char fSSSE3;
43 | char fSSE4A;
44 | char fSSE41;
45 | char fSSE42;
46 | char fPOPCNT;
47 | char fLZCNT;
48 | char fTSC;
49 | char fTSCINV;
50 | char fAVX;
51 | char fAVX2;
52 | char fAES;
53 | char fERMS;
54 | char fCLMUL;
55 | char fBMI1;
56 | char fBMI2;
57 | char fRTM;
58 | char fADX;
59 | char fAVX512F;
60 | char fAVX512DQ;
61 | char fAVX512PF;
62 | char fAVX512ER;
63 | char fAVX512CD;
64 | char fAVX512BW;
65 | char fAVX512VL;
66 | char fSHA;
67 | char fFMA;
68 | #else
69 | char fFP;
70 | char fASIMD;
71 | char fEVTSTRM;
72 | char fAES;
73 | char fPMULL;
74 | char fSHA1;
75 | char fSHA2;
76 | char fCRC32;
77 | char fLSE;
78 | char fSTXRPREFETCH;
79 | char fA53MAC;
80 | char fDMBATOMICS;
81 | #endif
82 | } CPUFeatures;
83 |
84 | void determineCPUFeatures(CPUFeatures* features)
85 | {
86 | fprintf(stderr, "\n\n\ndetermineCpuFeaures\n");
87 | #ifdef GVM_IOS_SIM
88 | features->fSSE = 1;
89 | features->fSSE2 = 1;
90 | #else
91 | features->fFP = 1;
92 | features->fASIMD = 1;
93 | #endif
94 | }
95 |
96 | #ifdef GVM_17
97 | // dummy symbols only for JDK17
98 | void Java_java_net_AbstractPlainDatagramSocketImpl_isReusePortAvailable0() {}
99 | void Java_java_net_AbstractPlainSocketImpl_isReusePortAvailable0() {}
100 | void Java_java_net_DatagramPacket_init() {}
101 | #else
102 | // dummy symbols only for JDK11
103 | void Java_java_net_PlainDatagramSocketImpl_send0() {}
104 | #endif
--------------------------------------------------------------------------------
/src/main/resources/native/linux-aarch64/cap/BuiltinDirectives.cap:
--------------------------------------------------------------------------------
1 | NativeCodeInfo:BuiltinDirectives:PointerToInfo:char:PropertyInfo:size=1
NativeCodeInfo:BuiltinDirectives:PointerToInfo:char:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:BuiltinDirectives:PointerToInfo:char_:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:PointerToInfo:double:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:PointerToInfo:float:PropertyInfo:size=4
NativeCodeInfo:BuiltinDirectives:PointerToInfo:graal_isolate_t_:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:PointerToInfo:graal_isolatethread_t_:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:PointerToInfo:int:PropertyInfo:size=4
NativeCodeInfo:BuiltinDirectives:PointerToInfo:int:PropertyInfo:signedness=$SIGNED$
NativeCodeInfo:BuiltinDirectives:PointerToInfo:int_:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:PointerToInfo:long_long:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:PointerToInfo:long_long:PropertyInfo:signedness=$SIGNED$
NativeCodeInfo:BuiltinDirectives:PointerToInfo:short:PropertyInfo:size=2
NativeCodeInfo:BuiltinDirectives:PointerToInfo:short:PropertyInfo:signedness=$SIGNED$
NativeCodeInfo:BuiltinDirectives:PointerToInfo:struct_JNIEnv__:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:PointerToInfo:struct_JNIEnv__:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:PointerToInfo:struct_JavaVM__:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:PointerToInfo:struct_JavaVM__:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:PointerToInfo:void:PropertyInfo:size=1
NativeCodeInfo:BuiltinDirectives:PointerToInfo:void_:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:PropertyInfo:size=56
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:_reserved_1:PropertyInfo:size=4
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:_reserved_1:PropertyInfo:offset=32
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:_reserved_1:PropertyInfo:signedness=$SIGNED$
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:_reserved_2:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:_reserved_2:PropertyInfo:offset=40
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:auxiliary_image_path:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:auxiliary_image_path:PropertyInfo:offset=16
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:auxiliary_image_reserved_space_size:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:auxiliary_image_reserved_space_size:PropertyInfo:offset=24
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:auxiliary_image_reserved_space_size:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:pkey:PropertyInfo:size=4
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:pkey:PropertyInfo:offset=48
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:pkey:PropertyInfo:signedness=$SIGNED$
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:reserved_address_space_size:PropertyInfo:size=8
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:reserved_address_space_size:PropertyInfo:offset=8
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:reserved_address_space_size:PropertyInfo:signedness=$UNSIGNED$
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:version:PropertyInfo:size=4
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:version:PropertyInfo:offset=0
NativeCodeInfo:BuiltinDirectives:StructInfo:graal_create_isolate_params_t:StructFieldInfo:version:PropertyInfo:signedness=$SIGNED$
--------------------------------------------------------------------------------
/src/main/resources/native/linux/launcher.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, 2021, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | #include
29 | #include
30 |
31 | double pow_old(double x, double y) {
32 | #ifdef __amd64__
33 | __asm__(".symver pow_old,pow@GLIBC_2.2.5");
34 | #elif defined(__aarch64__)
35 | __asm__(".symver pow_old,pow@GLIBC_2.17");
36 | #endif
37 | }
38 |
39 | double __wrap_pow(double x, double y) {
40 | return pow_old(x, y);
41 | }
42 |
43 | extern int *run_main(int argc, const char* argv[]);
44 |
45 | int main(int argc, const char* argv[]) {
46 | #ifdef GVM_VERBOSE
47 | fprintf(stderr, "Main\n");
48 | #endif
49 | (*run_main)(argc, argv);
50 | }
51 |
52 | // the following functions are used in Java 11 but not in 14
53 | // we use the native libs from 14.
54 | // in case they are still able to be called, we need to implement them
55 |
56 | void Java_java_io_ObjectOutputStream_floatsToBytes( ) {
57 | fprintf(stderr, "FloatsToBytesmismatch\n");
58 | }
59 |
60 | void Java_java_io_ObjectOutputStream_doublesToBytes() {
61 | fprintf(stderr, "DoublesToBytesmismatch\n");
62 | }
63 |
64 | #ifdef AARCH64
65 |
66 | typedef struct {
67 | char fFP;
68 | char fASIMD;
69 | char fEVTSTRM;
70 | char fAES;
71 | char fPMULL;
72 | char fSHA1;
73 | char fSHA2;
74 | char fCRC32;
75 | char fLSE;
76 | char fSTXRPREFETCH;
77 | char fA53MAC;
78 | char fDMBATOMICS;
79 | } CPUFeatures;
80 |
81 | void determineCPUFeatures(CPUFeatures* features) {
82 | fprintf(stderr, "\n\n\ndetermineCpuFeaures\n");
83 | features->fFP = 1;
84 | features->fASIMD = 1;
85 | }
86 |
87 | void JVM_NativePath() {
88 | fprintf(stderr, "We should never reach here (JVM_nativePath)\n");
89 | }
90 |
91 | void JVM_RawMonitorCreate() {
92 | fprintf(stderr, "We should never reach here (JVM_RawMonitorCreate)\n");
93 | }
94 |
95 | void JVM_RawMonitorDestroy() {
96 | fprintf(stderr, "We should never reach here (JVM_RawMonitorDestroy)\n");
97 | }
98 |
99 | void JVM_RawMonitorEnter() {
100 | fprintf(stderr, "We should never reach here (JVM_RawMonitorEnter)\n");
101 | }
102 |
103 | void JVM_RawMonitorExit() {
104 | fprintf(stderr, "We should never reach here (JVM_RawMonitorExit)\n");
105 | }
106 |
107 | // These functions come from unused glass-monocle code that should be removed from OpenJFX
108 | void getNativeWindowType() {
109 | fprintf(stderr, "NOT IMPLEMENTED\n");
110 | }
111 |
112 | void getNativeDisplayType() {
113 | fprintf(stderr, "NOT IMPLEMENTED\n");
114 | }
115 |
116 | void getLibGLEShandle() {
117 | fprintf(stderr, "NOT IMPLEMENTED\n");
118 | }
119 |
120 | #ifndef GVM_17
121 | // dummy symbols only for JDK11
122 | void Java_java_net_PlainDatagramSocketImpl_send0() {}
123 | #endif
124 |
125 | #endif // AARCH64
126 |
127 |
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_128@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_128@1x.png
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_128@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_128@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_16@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_16@1x.png
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_16@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_256@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_256@1x.png
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_256@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_256@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_32@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_32@1x.png
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_32@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_512@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_512@1x.png
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/macosx/assets/AppIcon.iconset/icon_512@2x.png
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleIdentifier
6 | $packageName.$mainClassName
7 | CFBundleVersion
8 | $bundleVersion
9 | CFBundleShortVersionString
10 | $bundleShortVersion
11 | CFBundleExecutable
12 | $mainClassNameApp
13 | CFBundleIconFile
14 | AppIcon.icns
15 | CFBundleFileName
16 | AppIcon
17 | CFBundleName
18 | $appName
19 | CFBundlePackageType
20 | APPL
21 | CFBundleSignature
22 | ????
23 | LSApplicationCategoryType
24 | $appCategory
25 | LSMinimumSystemVersion
26 | $minimumSystemVersion
27 | CFBundleDevelopmentRegion
28 | English
29 | CFBundleAllowMixedLocalizations
30 |
31 | NSHighResolutionCapable
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/PkgInfo:
--------------------------------------------------------------------------------
1 | APPL????
2 |
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/macosx/assets/background.png
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/background.tiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/macosx/assets/background.tiff
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/postinstall.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | chown root:wheel "InstallLocation"
4 | chmod a+rX "InstallLocation"
5 |
6 | exit 0
7 |
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/preinstall.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | if [ ! -d "InstallLocation" ]
4 | then
5 | mkdir -p "InstallLocation"
6 | fi
7 |
8 | exit 0
9 |
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/productInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/assets/setup.scpt:
--------------------------------------------------------------------------------
1 | tell application "Finder"
2 | set theDisk to a reference to (disks whose URL = "DeployVolumeURL")
3 | open theDisk
4 |
5 | set theWindow to a reference to (container window of disks whose URL = "DeployVolumeURL")
6 |
7 | set current view of theWindow to icon view
8 | set toolbar visible of theWindow to false
9 | set statusbar visible of theWindow to false
10 |
11 | -- size of window should fit the size of background
12 | set the bounds of theWindow to {400, 100, 917, 400}
13 |
14 | set theViewOptions to a reference to the icon view options of theWindow
15 | set arrangement of theViewOptions to not arranged
16 | set icon size of theViewOptions to 128
17 | set background picture of theViewOptions to POSIX file "DeployBackgroundFile"
18 |
19 | -- Create alias for install location
20 | make new alias file at POSIX file "DeployVolumePath" to POSIX file "DeployInstallLocation" with properties {name:"DeployInstallLocation"}
21 |
22 | set allTheFiles to the name of every item of theWindow
23 | set xpos to 120
24 | repeat with theFile in allTheFiles
25 | set theFilePath to POSIX path of theFile
26 | set appFilePath to POSIX path of "/DeployTarget"
27 | if theFilePath is "DeployInstallLocation" then
28 | -- Position install location
29 | set position of item theFile of theWindow to {390, 130}
30 | else if theFilePath ends with appFilePath then
31 | -- Position application or runtime
32 | set position of item theFile of theWindow to {120, 130}
33 | else
34 | -- Position all other items in a second row.
35 | set position of item theFile of theWindow to {xpos, 290}
36 | set xpos to xpos + 150
37 | end if
38 | end repeat
39 |
40 |
41 | update theDisk without registering applications
42 | delay 5
43 | close (get window of theDisk)
44 | end tell
45 |
--------------------------------------------------------------------------------
/src/main/resources/native/macosx/launcher.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | #include
29 | #include
30 | #include
31 |
32 | extern void outBox(int argc, const char** argv);
33 |
34 | int main(int argc, const char** argv) {
35 | #ifdef GVM_VERBOSE
36 | fprintf(stderr, "Hello, JAVA main, argc = %d, argv = %p\n", argc, argv);
37 | #endif
38 | outBox(argc, argv);
39 | }
40 |
41 | void Java_java_io_ObjectOutputStream_floatsToBytes( ) {
42 | fprintf(stderr, "FloatsToBytesmismatch\n");
43 | }
44 |
45 | void Java_java_io_ObjectOutputStream_doublesToBytes() {
46 | fprintf(stderr, "DoublesToBytesmismatch\n");
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/resources/native/windows/assets/IconGroup.rc:
--------------------------------------------------------------------------------
1 | LANGUAGE 0x00, 0x00
2 |
3 | 1 ICON "icon.ico"
4 |
--------------------------------------------------------------------------------
/src/main/resources/native/windows/assets/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/main/resources/native/windows/assets/icon.ico
--------------------------------------------------------------------------------
/src/main/resources/native/windows/launcher.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, 2020, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | #include
29 |
30 | extern int *run_main(int argc, const char* argv[]);
31 |
32 | int main(int argc, const char* argv[]) {
33 | #ifdef GVM_VERBOSE
34 | fprintf(stderr, "Main\n");
35 | #endif
36 | (*run_main)(argc, argv);
37 | }
38 |
39 | // the following functions are used in Java 11 but not in 14
40 | // we use the native libs from 14.
41 | // in case they are still able to be called, we need to implement them
42 |
43 | void Java_java_io_ObjectOutputStream_floatsToBytes( ) {
44 | fprintf(stderr, "FloatsToBytesmismatch\n");
45 | }
46 |
47 | void Java_java_io_ObjectOutputStream_doublesToBytes() {
48 | fprintf(stderr, "DoublesToBytesmismatch\n");
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/src/main/resources/thirdparty/ios-deploy/ios-deploy.rb:
--------------------------------------------------------------------------------
1 | class IosDeploy < Formula
2 | desc "Install and debug iPhone apps from the command-line"
3 | homepage "https://github.com/ios-control/ios-deploy"
4 | license all_of: ["GPL-3.0-or-later", "BSD-3-Clause"]
5 | head "https://github.com/ios-control/ios-deploy.git", branch: "master"
6 |
7 | stable do
8 | url "https://github.com/ios-control/ios-deploy/archive/1.12.1.tar.gz"
9 | sha256 "635cc36b027ec36cd9f5ebd4136f0e1274caa60049c1f6e4fd15d45d7bef5bc3"
10 | end
11 |
12 | bottle do
13 | sha256 cellar: :any_skip_relocation, arm64_ventura: "70ee426a92f9c051982e92df8d46723cc89b8fecb7d696b99720c13d3b98007b"
14 | sha256 cellar: :any_skip_relocation, arm64_monterey: "da920d213de78388f4dfeb2c87e8c93f188aaa3acc506eef86ce3e6762dec43a"
15 | sha256 cellar: :any_skip_relocation, arm64_big_sur: "5d047f57995db0f9c5897455967d85c8ddd8413b853ffda376467c04a8d47960"
16 | sha256 cellar: :any_skip_relocation, ventura: "96daffa7e01337c33d71ca1afdba51b34e100327d171a4c08a0b390b404237a9"
17 | sha256 cellar: :any_skip_relocation, monterey: "9b8206addd8b1d07a8b50fa2a88c9c9ebf8697a9fefa21835336019193ca9102"
18 | sha256 cellar: :any_skip_relocation, big_sur: "ea7341be8f08529d848ffe7fe7bfb75cbbb42e0d7d017667c704de1f0a12a4e0"
19 | end
20 |
21 | depends_on xcode: :build
22 | depends_on :macos
23 |
24 | patch do
25 | url "PATCH_PATH"
26 | sha256 "5f9db6c0049c23296ba5737e294aed5bcb7f14db367bb9877b7ef474a62ceff2"
27 | end
28 |
29 | def install
30 | xcodebuild "-configuration", "Release",
31 | "SYMROOT=build",
32 | "-arch", Hardware::CPU.arch
33 |
34 | xcodebuild "test",
35 | "-scheme", "ios-deploy-tests",
36 | "-configuration", "Release",
37 | "SYMROOT=build",
38 | "-arch", Hardware::CPU.arch
39 |
40 | bin.install "build/Release/ios-deploy"
41 | end
42 |
43 | test do
44 | system "#{bin}/ios-deploy", "-V"
45 | end
46 | end
--------------------------------------------------------------------------------
/src/main/resources/thirdparty/ios-deploy/lldbpatch.diff:
--------------------------------------------------------------------------------
1 | diff --git a/src/scripts/lldb.py b/src/scripts/lldb.py
2 | index 26d9a88..93e0262 100644
3 | --- a/src/scripts/lldb.py
4 | +++ b/src/scripts/lldb.py
5 | @@ -116,7 +116,8 @@ def autoexit_command(debugger, command, result, internal_dict):
6 | # This line prevents internal lldb listener from processing STDOUT/STDERR/StateChanged messages.
7 | # Without it, an order of log writes is incorrect sometimes
8 | debugger.GetListener().StopListeningForEvents(process.GetBroadcaster(),
9 | - lldb.SBProcess.eBroadcastBitSTDOUT | lldb.SBProcess.eBroadcastBitSTDERR | lldb.SBProcess.eBroadcastBitStateChanged )
10 | +# lldb.SBProcess.eBroadcastBitSTDOUT | lldb.SBProcess.eBroadcastBitSTDERR | lldb.SBProcess.eBroadcastBitStateChanged )
11 | + lldb.SBProcess.eBroadcastBitStateChanged )
12 |
13 | event = lldb.SBEvent()
14 |
15 |
--------------------------------------------------------------------------------
/src/test/java/com/gluonhq/substrate/HelloFXMLTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, 2021, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate;
29 |
30 | import org.gradle.testkit.runner.BuildResult;
31 | import org.gradle.testkit.runner.GradleRunner;
32 | import org.gradle.testkit.runner.TaskOutcome;
33 | import org.junit.jupiter.api.BeforeEach;
34 | import org.junit.jupiter.api.Test;
35 |
36 | import java.io.File;
37 |
38 | import static com.gluonhq.substrate.TestUtils.isCI;
39 | import static com.gluonhq.substrate.TestUtils.isCIWindows;
40 | import static org.junit.jupiter.api.Assertions.assertEquals;
41 | import static org.junit.jupiter.api.Assumptions.assumeTrue;
42 |
43 | class HelloFXMLTest {
44 |
45 | @BeforeEach
46 | void notForTravis() {
47 | assumeTrue(!isCIWindows());
48 | }
49 |
50 | @Test
51 | void helloFXTest() {
52 | String expected = "QuantumRenderer: shutdown";
53 | BuildResult result = GradleRunner.create()
54 | .withProjectDir(new File("test-project"))
55 | .withArguments(":helloFXML:clean", ":helloFXML:build",
56 | "-Dexpected=" + expected, "-DconsoleProcessLog=" + (isCI() ? "true" : "false"),
57 | "-Dskipsigning=" + (isCI() ? "true" : "false"),
58 | ":helloFXML:run", ":helloFXML:runScript", "--stacktrace")
59 | .forwardOutput()
60 | .build();
61 |
62 | assertEquals(TaskOutcome.SUCCESS, result.task(":helloFXML:run").getOutcome(), "Run failed!");
63 | assertEquals(TaskOutcome.SUCCESS, result.task(":helloFXML:runScript").getOutcome(), "RunScript failed!");
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/src/test/java/com/gluonhq/substrate/HelloFXTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate;
29 |
30 | import org.gradle.testkit.runner.BuildResult;
31 | import org.gradle.testkit.runner.GradleRunner;
32 | import org.gradle.testkit.runner.TaskOutcome;
33 | import org.junit.jupiter.api.Test;
34 |
35 | import java.io.File;
36 |
37 | import static com.gluonhq.substrate.TestUtils.isCI;
38 | import static com.gluonhq.substrate.TestUtils.isCIWindows;
39 | import static org.junit.jupiter.api.Assertions.assertEquals;
40 |
41 | class HelloFXTest {
42 |
43 | @Test
44 | void helloFXTest() {
45 | String expected = "QuantumRenderer: shutdown";
46 | BuildResult result = GradleRunner.create()
47 | .withProjectDir(new File("test-project"))
48 | .withArguments(":helloFX:clean", ":helloFX:build",
49 | "-Dexpected=" + expected, "-DconsoleProcessLog=" + (isCI() ? "true" : "false"),
50 | "-DnativeImageArgs=" + (isCIWindows() ? "-J-Xmx5G" : ""),
51 | "-Dskipsigning=" + (isCI() ? "true" : "false"),
52 | ":helloFX:run", ":helloFX:runScript", "--stacktrace")
53 | .forwardOutput()
54 | .build();
55 |
56 | assertEquals(TaskOutcome.SUCCESS, result.task(":helloFX:run").getOutcome(), "Run failed!");
57 | assertEquals(TaskOutcome.SUCCESS, result.task(":helloFX:runScript").getOutcome(), "RunScript failed!");
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/src/test/java/com/gluonhq/substrate/HelloGluonTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, 2021, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate;
29 |
30 | import org.gradle.testkit.runner.BuildResult;
31 | import org.gradle.testkit.runner.GradleRunner;
32 | import org.gradle.testkit.runner.TaskOutcome;
33 | import org.junit.jupiter.api.BeforeEach;
34 | import org.junit.jupiter.api.Test;
35 |
36 | import java.io.File;
37 |
38 | import static com.gluonhq.substrate.TestUtils.isCI;
39 | import static com.gluonhq.substrate.TestUtils.isCIWindows;
40 | import static com.gluonhq.substrate.TestUtils.isTravis;
41 | import static org.junit.jupiter.api.Assertions.assertEquals;
42 | import static org.junit.jupiter.api.Assumptions.assumeTrue;
43 |
44 | class HelloGluonTest {
45 |
46 | @BeforeEach
47 | void notForTravis() {
48 | assumeTrue(!isTravis());
49 | assumeTrue(!isCIWindows());
50 | }
51 |
52 | @Test
53 | void helloGluonTest() {
54 | String expected = "QuantumRenderer: shutdown";
55 | BuildResult result = GradleRunner.create()
56 | .withProjectDir(new File("test-project"))
57 | .withArguments(":helloGluon:clean", ":helloGluon:build",
58 | "-Dexpected=" + expected, "-DconsoleProcessLog=" + (isCI() ? "true" : "false"),
59 | "-Dskipsigning=" + (isCI() ? "true" : "false"),
60 | ":helloGluon:run", ":helloGluon:runScript", "--stacktrace")
61 | .forwardOutput()
62 | .build();
63 |
64 | assertEquals(TaskOutcome.SUCCESS, result.task(":helloGluon:run").getOutcome(), "Run failed!");
65 | assertEquals(TaskOutcome.SUCCESS, result.task(":helloGluon:runScript").getOutcome(), "RunScript failed!");
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/test/java/com/gluonhq/substrate/HelloWorldTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate;
29 |
30 | import org.gradle.testkit.runner.BuildResult;
31 | import org.gradle.testkit.runner.GradleRunner;
32 | import org.gradle.testkit.runner.TaskOutcome;
33 | import org.junit.jupiter.api.Test;
34 |
35 | import java.io.File;
36 |
37 | import static com.gluonhq.substrate.TestUtils.isCI;
38 | import static org.junit.jupiter.api.Assertions.assertEquals;
39 |
40 | class HelloWorldTest {
41 |
42 | @Test
43 | void helloWorldTest() {
44 | String expected = "Hello World";
45 | BuildResult result = GradleRunner.create()
46 | .withProjectDir(new File("test-project"))
47 | .withArguments(":helloWorld:clean", ":helloWorld:build", ":helloWorld:run",
48 | "-Dexpected=" + expected, "-DconsoleProcessLog=" + (isCI() ? "true" : "false"),
49 | "-Dskipsigning=" + (isCI() ? "true" : "false"),
50 | ":helloWorld:runScript", "--stacktrace")
51 | .forwardOutput()
52 | .build();
53 |
54 | assertEquals(TaskOutcome.SUCCESS, result.task(":helloWorld:run").getOutcome(), "Run failed!");
55 | assertEquals(TaskOutcome.SUCCESS, result.task(":helloWorld:runScript").getOutcome(), "RunScript failed!");
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/test/java/com/gluonhq/substrate/TestUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, 2020, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate;
29 |
30 | import com.gluonhq.substrate.model.Triplet;
31 |
32 | class TestUtils {
33 |
34 | /**
35 | * Checks if the test is running on Travis CI
36 | * @return true if on Travis CI
37 | */
38 | static boolean isTravis() {
39 | return System.getenv("TRAVIS") != null;
40 | }
41 |
42 | /**
43 | * Checks if the test is running on Github Actions CI
44 | * @return true if on Github Actions CI
45 | */
46 | static boolean isGithubActions() {
47 | return System.getenv("GITHUB_ACTIONS") != null;
48 | }
49 |
50 | /**
51 | * Checks if the test is running on CI server
52 | * @return true if on a CI server
53 | */
54 | static boolean isCI() {
55 | return isTravis() || isGithubActions();
56 | }
57 |
58 | /**
59 | * Checks if the test is running on Mac OS, but not on CI server
60 | * @return true if runs on a local Mac OS
61 | */
62 | static boolean isLocalMacOS() {
63 | return !isCI() && Triplet.isMacOSHost();
64 | }
65 |
66 | /**
67 | * Checks if the test is running on Windows, but not on CI server
68 | * @return true if runs on a local Windows
69 | */
70 | boolean isLocalWindows() {
71 | return !isCI() && Triplet.isWindowsHost();
72 | }
73 |
74 | /**
75 | * Checks if the test is running on Linux, but not on CI server
76 | * @return true if runs on a local Linux
77 | */
78 | boolean isLocalLinux() {
79 | return !isCI() && Triplet.isLinuxHost();
80 | }
81 |
82 | /**
83 | * Checks if the test is running on Mac OS over CI server
84 | * @return true if runs on Mac OS over CI server
85 | */
86 | static boolean isCIMacOS() {
87 | return isCI() && Triplet.isMacOSHost();
88 | }
89 |
90 | /**
91 | * Checks if the test is running on Linux over CI server
92 | * @return true if runs on Linux over CI server
93 | */
94 | static boolean isCILinux() {
95 | return isCI() && Triplet.isLinuxHost();
96 | }
97 |
98 | /**
99 | * Checks if the test is running on Windows over CI server
100 | * @return true if runs on Windows over CI server
101 | */
102 | static boolean isCIWindows() {
103 | return isCI() && Triplet.isWindowsHost();
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/src/test/java/com/gluonhq/substrate/util/LibTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.util;
29 |
30 | import org.junit.jupiter.api.Test;
31 |
32 | import static org.junit.jupiter.api.Assertions.*;
33 |
34 | class LibTest {
35 | @Test
36 | void testNoBound() {
37 | Lib lib = Lib.of("");
38 | assertTrue(lib.inRange(0));
39 | assertTrue(lib.inRange(100));
40 | }
41 |
42 | @Test
43 | void testLowerBound() {
44 | Lib lib = Lib.from(10, "");
45 | assertFalse(lib.inRange(9));
46 | assertTrue(lib.inRange(10));
47 | assertTrue(lib.inRange(11));
48 | }
49 |
50 | @Test
51 | void testUpperBound() {
52 | Lib lib = Lib.upTo(10, "");
53 | assertTrue(lib.inRange(9));
54 | assertTrue(lib.inRange(10));
55 | assertFalse(lib.inRange(11));
56 | }
57 |
58 | @Test
59 | void testRange() {
60 | Lib lib = Lib.range(10, 12, "");
61 | assertFalse(lib.inRange(9));
62 | assertTrue(lib.inRange(10));
63 | assertTrue(lib.inRange(11));
64 | assertTrue(lib.inRange(12));
65 | assertFalse(lib.inRange(13));
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/test/java/com/gluonhq/substrate/util/ProcessTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.util;
29 |
30 | import com.gluonhq.substrate.model.Triplet;
31 | import org.junit.jupiter.api.Test;
32 |
33 | import java.io.IOException;
34 | import java.nio.file.Files;
35 | import java.nio.file.Path;
36 |
37 | import static org.junit.jupiter.api.Assertions.assertEquals;
38 | import static org.junit.jupiter.api.Assertions.assertTrue;
39 |
40 | public class ProcessTest {
41 |
42 | private Path getTempDir() throws IOException {
43 | return Files.createTempDirectory("substrate-runner-tests");
44 | }
45 |
46 | @Test
47 | public void processTest() throws IOException, InterruptedException {
48 | ProcessRunner runner = new ProcessRunner();
49 | if (Triplet.isWindowsHost()) {
50 | runner.addArgs("cmd", "/c", "dir", "/b", "LICENSE");
51 | } else {
52 | runner.addArgs("ls", "LICENSE");
53 | }
54 | assertEquals(0, runner.runProcess("dir"));
55 | assertEquals(1, runner.getResponses().size());
56 | assertEquals("LICENSE", runner.getLastResponse());
57 | }
58 |
59 | @Test
60 | public void processLogTest() throws IOException, InterruptedException {
61 | Path tempDir = getTempDir();
62 | ProcessRunner runner = new ProcessRunner();
63 | String output;
64 | if (Triplet.isWindowsHost()) {
65 | runner.addArgs("cmd", "/c", "mkdir", "runner");
66 | output = "A subdirectory or file runner already exists.";
67 | } else {
68 | runner.addArgs("mkdir", "runner");
69 | output = "File exists";
70 | }
71 | assertEquals(0, runner.runProcess("mkdir", tempDir.toFile()));
72 | assertEquals(1, runner.getResponses().size());
73 | assertEquals("", runner.getLastResponse());
74 |
75 | assertEquals(1, runner.runProcess("mkdir", tempDir.toFile()));
76 | assertTrue(runner.getLastResponse().endsWith(output));
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/src/test/java/com/gluonhq/substrate/util/StringsTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, 2020, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.util;
29 |
30 | import org.junit.jupiter.api.Test;
31 |
32 | import java.util.Arrays;
33 | import java.util.Collections;
34 | import java.util.HashMap;
35 | import java.util.Map;
36 | import java.util.function.Function;
37 |
38 | import static org.junit.jupiter.api.Assertions.*;
39 |
40 | public class StringsTests {
41 |
42 | @Test
43 | void testSubstituteSuccess() {
44 | var vars = new HashMap();
45 | vars.put("var1", "VAR1");
46 | vars.put("var2", "VAR2");
47 |
48 | String result = Strings.substitute( "123 ${var1} 456 ${var2} 789", vars::get);
49 | assertEquals( "123 VAR1 456 VAR2 789", result );
50 |
51 | }
52 |
53 | @Test
54 | void testSubstituteFailure() {
55 | var vars = new HashMap();
56 | String template = "123 ${var1} 456 ${var2} 789";
57 |
58 | assertThrows( IllegalArgumentException.class,
59 | () -> Strings.substitute(template, vars::get) );
60 |
61 | assertThrows( NullPointerException.class,
62 | () -> Strings.substitute( null, vars::get) );
63 |
64 | assertThrows( NullPointerException.class,
65 | () -> Strings.substitute(template, (Function) null) );
66 |
67 | assertThrows( NullPointerException.class,
68 | () -> Strings.substitute(template, (Map) null) );
69 | }
70 |
71 | @Test
72 | void testSplit() {
73 |
74 | assertIterableEquals(
75 | Arrays.asList("aaa","bbb","ccc"),
76 | Strings.split( "aaa:bbb:ccc", ":" ));
77 |
78 | assertIterableEquals(
79 | Collections.emptyList(),
80 | Strings.split( "", ":" ));
81 |
82 | assertIterableEquals(
83 | Collections.emptyList(),
84 | Strings.split( null, ":" ));
85 |
86 | }
87 |
88 | @Test
89 | void testCommaSplit() {
90 |
91 | assertIterableEquals(
92 | Arrays.asList("aaa","bbb","ccc"),
93 | Strings.split( "aaa,bbb,ccc"));
94 |
95 | assertIterableEquals(
96 | Collections.emptyList(),
97 | Strings.split( "" ));
98 |
99 | assertIterableEquals(
100 | Collections.emptyList(),
101 | Strings.split( null ));
102 |
103 | }
104 |
105 | @Test
106 | void randomStringGeneration() {
107 | final String randomString = Strings.randomString(6);
108 | assertEquals(6, randomString.length());
109 | assertTrue(randomString.matches("^[a-z]*$"));
110 | }
111 |
112 |
113 | }
114 |
--------------------------------------------------------------------------------
/src/test/java/com/gluonhq/substrate/util/VersionParserTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.util;
29 |
30 | import org.junit.jupiter.api.Test;
31 | import static org.junit.jupiter.api.Assertions.assertNull;
32 | import static org.junit.jupiter.api.Assertions.assertEquals;
33 |
34 | public class VersionParserTest {
35 |
36 | @Test
37 | public void returnsSameInputWhenInputIsEmpty() {
38 | String input = "";
39 | VersionParser versionParser = new VersionParser();
40 | Version version = versionParser.parseVersion(input);
41 | assertNull(version);
42 | }
43 |
44 | @Test
45 | public void returnsSameInputWhenNoVersionPresent() {
46 | String input = "ld";
47 | VersionParser versionParser = new VersionParser();
48 | Version version = versionParser.parseVersion(input);
49 | assertNull(version);
50 | }
51 |
52 | @Test
53 | public void parsesVersionFromVersionWithoutMinorNumber() {
54 | String input = "ld 2";
55 | VersionParser versionParser = new VersionParser();
56 | Version version = versionParser.parseVersion(input);
57 | assertEquals(2, version.getMajor());
58 | }
59 |
60 | @Test
61 | public void parsesVersionFromVersionWithoutPatchNumber() {
62 | String input = "ld 2.26";
63 | VersionParser versionParser = new VersionParser();
64 | Version version = versionParser.parseVersion(input);
65 | assertEquals(2, version.getMajor());
66 | assertEquals(26, version.getMinor());
67 | }
68 |
69 | @Test
70 | public void parsesVersionFromFullVersionNumber() {
71 | String input = "ld 2.26.1";
72 | VersionParser versionParser = new VersionParser();
73 | Version version = versionParser.parseVersion(input);
74 | assertEquals(2, version.getMajor());
75 | assertEquals(26, version.getMinor());
76 | assertEquals(1, version.getPatch());
77 | }
78 |
79 | @Test
80 | public void parsesBaseVersionFromVersionWithExtraInfo() {
81 | String input = "GNU ld version 2.27-41.base.el7";
82 | VersionParser versionParser = new VersionParser();
83 | Version version = versionParser.parseVersion(input);
84 | assertEquals(2, version.getMajor());
85 | assertEquals(27, version.getMinor());
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/src/test/java/com/gluonhq/substrate/util/VersionTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, Gluon
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 |
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL GLUON BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.gluonhq.substrate.util;
29 |
30 | import org.junit.jupiter.api.Test;
31 |
32 | import static org.junit.jupiter.api.Assertions.assertEquals;
33 |
34 | public class VersionTest {
35 |
36 | @Test
37 | public void constructsVersionWithMajor() {
38 | Version version = new Version(5);
39 | assertEquals(5, version.getMajor());
40 | assertEquals(0, version.getMinor());
41 | assertEquals(0, version.getPatch());
42 | assertEquals("5", version.toString());
43 | }
44 |
45 | @Test
46 | public void constructsVersionWithMajorAndMinor() {
47 | Version version = new Version(5, 4);
48 | assertEquals(5, version.getMajor());
49 | assertEquals(4, version.getMinor());
50 | assertEquals(0, version.getPatch());
51 | assertEquals("5.4", version.toString());
52 | }
53 |
54 | @Test
55 | public void constructsVersionWithMajorAndMinorAndPatch() {
56 | Version version = new Version(5, 4, 28);
57 | assertEquals(5, version.getMajor());
58 | assertEquals(4, version.getMinor());
59 | assertEquals(28, version.getPatch());
60 | assertEquals("5.4.28", version.toString());
61 | }
62 |
63 | @Test
64 | public void constructsVersionWithMajorAndPatch() {
65 | Version version = new Version(5, 0, 1);
66 | assertEquals(5, version.getMajor());
67 | assertEquals(0, version.getMinor());
68 | assertEquals(1, version.getPatch());
69 | assertEquals("5.0.1", version.toString());
70 | }
71 |
72 | @Test
73 | public void comparesVersionsWithMajor() {
74 | Version version1 = new Version(2);
75 | Version version2 = new Version(5);
76 | assertEquals(-1, version1.compareTo(version2));
77 | assertEquals(1, version2.compareTo(version1));
78 | }
79 |
80 | @Test
81 | public void comparesVersionsWithMajorAndMinor() {
82 | Version version1 = new Version(2, 3);
83 | Version version2 = new Version(2, 6);
84 | assertEquals(-1, version1.compareTo(version2));
85 | assertEquals(1, version2.compareTo(version1));
86 | }
87 |
88 | @Test
89 | public void comparesVersionsWithMajorAndMinorAndPatch() {
90 | Version version1 = new Version(2, 3, 8);
91 | Version version2 = new Version(2, 3, 19);
92 | assertEquals(-1, version1.compareTo(version2));
93 | assertEquals(1, version2.compareTo(version1));
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/src/test/resources/substrate-test.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/src/test/resources/substrate-test.jar
--------------------------------------------------------------------------------
/src/test/resources/test-ops.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/test/resources/test-resource.txt:
--------------------------------------------------------------------------------
1 | This file exists strictly for unit testing
--------------------------------------------------------------------------------
/src/test/resources/test1.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | oneKey
6 | one
7 | twoKey
8 |
9 | test
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/test/resources/test2.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | one
7 |
8 | two
9 | test
10 |
11 | test2
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test-project/build.gradle:
--------------------------------------------------------------------------------
1 | def validateJavaHome() {
2 | def javaHome = hasProperty('org.gradle.java.home') ? getProperty('org.gradle.java.home') : System.getenv('JAVA_HOME')
3 | if (javaHome == null || !file(javaHome).exists()) {
4 | throw new GradleException("JAVA_HOME is not defined or is pointing to a non-existing directory: ${javaHome}")
5 | }
6 | return javaHome
7 | }
8 |
9 | def validateGraalvmHome() {
10 | def graalvmHome = System.getenv('GRAALVM_HOME')
11 | if (graalvmHome == null || !file(graalvmHome).exists()) {
12 | throw new GradleException("GRAALVM_HOME is not defined or is pointing to a non-existing directory: ${graalvmHome}")
13 | }
14 | return graalvmHome
15 | }
16 |
17 | def validateJavafxStaticSdk() {
18 | def javafxStaticSdk = hasProperty('javafx.static.sdk') ? getProperty('javafx.static.sdk') : System.getenv('JAVAFX_STATIC_SDK')
19 | if (javafxStaticSdk != null && !file(javafxStaticSdk).exists()) {
20 | throw new GradleException("JAVAFX_STATIC_SDK is pointing to a non-existing directory: ${javafxStaticSdk}")
21 | }
22 | return javafxStaticSdk
23 | }
24 |
25 | subprojects {
26 | apply plugin: 'application'
27 |
28 | ext.substrateVersion = "0.0.3"
29 | def propFile = file("$project.rootDir/../gradle.properties")
30 | if (propFile.canRead()) {
31 | def props = new Properties()
32 | props.load(new FileInputStream(propFile))
33 | if (props.containsKey('version')) {
34 | ext.substrateVersion = props['version']
35 | }
36 | }
37 |
38 | sourceCompatibility = 11
39 | targetCompatibility = 11
40 | }
41 |
--------------------------------------------------------------------------------
/test-project/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/test-project/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/test-project/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/test-project/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem http://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 |
35 | @rem Find java.exe
36 | if defined JAVA_HOME goto findJavaFromJavaHome
37 |
38 | set JAVA_EXE=java.exe
39 | %JAVA_EXE% -version >NUL 2>&1
40 | if "%ERRORLEVEL%" == "0" goto init
41 |
42 | echo.
43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44 | echo.
45 | echo Please set the JAVA_HOME variable in your environment to match the
46 | echo location of your Java installation.
47 |
48 | goto fail
49 |
50 | :findJavaFromJavaHome
51 | set JAVA_HOME=%JAVA_HOME:"=%
52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53 |
54 | if exist "%JAVA_EXE%" goto init
55 |
56 | echo.
57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58 | echo.
59 | echo Please set the JAVA_HOME variable in your environment to match the
60 | echo location of your Java installation.
61 |
62 | goto fail
63 |
64 | :init
65 | @rem Get command-line arguments, handling Windows variants
66 |
67 | if not "%OS%" == "Windows_NT" goto win9xME_args
68 |
69 | :win9xME_args
70 | @rem Slurp the command line arguments.
71 | set CMD_LINE_ARGS=
72 | set _SKIP=2
73 |
74 | :win9xME_args_slurp
75 | if "x%~1" == "x" goto execute
76 |
77 | set CMD_LINE_ARGS=%*
78 |
79 | :execute
80 | @rem Setup the command line
81 |
82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83 |
84 | @rem Execute Gradle
85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86 |
87 | :end
88 | @rem End local scope for the variables with windows NT shell
89 | if "%ERRORLEVEL%"=="0" goto mainEnd
90 |
91 | :fail
92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93 | rem the _cmd.exe /c_ return code!
94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95 | exit /b 1
96 |
97 | :mainEnd
98 | if "%OS%"=="Windows_NT" endlocal
99 |
100 | :omega
101 |
--------------------------------------------------------------------------------
/test-project/helloFX/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'org.openjfx.javafxplugin' version '0.1.0'
3 | }
4 |
5 | repositories {
6 | mavenCentral()
7 | }
8 |
9 | def target = System.getProperty("substrate.target")
10 |
11 | configurations {
12 | substrate
13 | }
14 |
15 | dependencies {
16 | substrate "com.gluonhq:substrate:$substrateVersion"
17 | }
18 |
19 | javafx {
20 | version = "17.0.10"
21 | modules = [ "javafx.controls" ]
22 | }
23 |
24 | mainClassName = "com.gluonhq.substrate.test.Main"
25 |
26 | task runScript(type: Exec) {
27 | dependsOn 'build'
28 |
29 | def javaHome = validateJavaHome()
30 | def graalvmHome = validateGraalvmHome()
31 | def javafxStaticSdk = validateJavafxStaticSdk()
32 |
33 | def expected = System.getProperty("expected")
34 | def skipsigning = System.getProperty("skipsigning")
35 | def consoleProcessLog = System.getProperty("consoleProcessLog")
36 | def nativeImageArgs = System.getProperty("nativeImageArgs")
37 |
38 | def imageClasspath = ""
39 | if (javafxStaticSdk != null) {
40 | imageClasspath = "${javafxStaticSdk}/lib/javafx.base.jar${File.pathSeparator}" +
41 | "${javafxStaticSdk}/lib/javafx.graphics.jar${File.pathSeparator}" +
42 | "${javafxStaticSdk}/lib/javafx.controls.jar${File.pathSeparator}" +
43 | project.sourceSets.main.runtimeClasspath.filter{!it.name.contains('javafx')}.asPath
44 | } else {
45 | imageClasspath = project.sourceSets.main.runtimeClasspath.asPath
46 | }
47 |
48 | def argsList = ["${javaHome}/bin/java", '-cp', project.configurations.substrate.asPath,
49 | "-Dimagecp=${imageClasspath}",
50 | "-Dgraalvm=${graalvmHome}"]
51 | if (javafxStaticSdk != null) {
52 | argsList += "-Djavafxsdk=${javafxStaticSdk}"
53 | }
54 | if (target != null) {
55 | argsList += ["-DtargetProfile=$target"]
56 | } else {
57 | argsList += ["-Dprism.sw=true"]
58 | }
59 | if (expected != null) {
60 | argsList += ["-Dexpected=$expected"]
61 | }
62 | if (skipsigning != null) {
63 | argsList += ["-Dskipsigning=$skipsigning"]
64 | }
65 | if (consoleProcessLog != null) {
66 | argsList += ["-DconsoleProcessLog=$consoleProcessLog", "-Dverbose=true"]
67 | }
68 | if (nativeImageArgs != null && nativeImageArgs != "") {
69 | argsList += ["-DnativeImageArgs=$nativeImageArgs"]
70 | }
71 | argsList += ["-Dmainclass=$mainClassName", 'com.gluonhq.substrate.SubstrateDispatcher']
72 | commandLine argsList
73 | }
74 |
--------------------------------------------------------------------------------
/test-project/helloFX/src/main/java/com/gluonhq/substrate/test/Main.java:
--------------------------------------------------------------------------------
1 | package com.gluonhq.substrate.test;
2 |
3 | import javafx.application.Application;
4 | import javafx.scene.Scene;
5 | import javafx.scene.control.Label;
6 | import javafx.scene.layout.StackPane;
7 | import javafx.stage.Stage;
8 | import javafx.animation.PauseTransition;
9 | import javafx.util.Duration;
10 |
11 | public class Main extends Application {
12 |
13 | @Override
14 | public void start(Stage stage) {
15 | String javaVersion = System.getProperty("java.version");
16 | String javafxVersion = System.getProperty("javafx.version");
17 | Label l = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
18 | Scene scene = new Scene(new StackPane(l), 640, 480);
19 | stage.setScene(scene);
20 | stage.show();
21 |
22 | if (System.getProperty("javafx.platform") == null) {
23 | PauseTransition pause = new PauseTransition(Duration.seconds(2));
24 | pause.setOnFinished(f -> System.exit(0));
25 | pause.play();
26 | }
27 | }
28 |
29 | public static void main(String[] args) {
30 | System.setProperty("prism.verbose", "true");
31 | launch(args);
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/test-project/helloFXML/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'org.openjfx.javafxplugin' version '0.1.0'
3 | }
4 |
5 | repositories {
6 | mavenCentral()
7 | }
8 |
9 | def target = System.getProperty("substrate.target")
10 |
11 | configurations {
12 | substrate
13 | }
14 |
15 | dependencies {
16 | substrate "com.gluonhq:substrate:$substrateVersion"
17 | }
18 |
19 | javafx {
20 | version = "17.0.10"
21 | modules = [ "javafx.controls", "javafx.fxml" ]
22 | }
23 |
24 | mainClassName = "com.gluonhq.substrate.test.Main"
25 |
26 | task runScript(type: Exec) {
27 | dependsOn 'build'
28 |
29 | def javaHome = validateJavaHome()
30 | def graalvmHome = validateGraalvmHome()
31 | def javafxStaticSdk = validateJavafxStaticSdk()
32 |
33 | def expected = System.getProperty("expected")
34 | def skipsigning = System.getProperty("skipsigning")
35 | def consoleProcessLog = System.getProperty("consoleProcessLog")
36 |
37 | def imageClasspath = ""
38 | if (javafxStaticSdk != null) {
39 | imageClasspath = "${javafxStaticSdk}/lib/javafx.base.jar${File.pathSeparator}" +
40 | "${javafxStaticSdk}/lib/javafx.graphics.jar${File.pathSeparator}" +
41 | "${javafxStaticSdk}/lib/javafx.controls.jar${File.pathSeparator}" +
42 | "${javafxStaticSdk}/lib/javafx.fxml.jar${File.pathSeparator}" +
43 | project.sourceSets.main.runtimeClasspath.filter{!it.name.contains('javafx')}.asPath
44 | } else {
45 | imageClasspath = project.sourceSets.main.runtimeClasspath.asPath
46 | }
47 |
48 | def argsList = ["${javaHome}/bin/java", '-cp', project.configurations.substrate.asPath,
49 | "-Dimagecp=${imageClasspath}",
50 | "-Dgraalvm=${graalvmHome}",
51 | "-Dbundleslist=com.gluonhq.substrate.test.bundle",
52 | "-Dreflectionlist=com.gluonhq.substrate.test.MainController"]
53 | if (javafxStaticSdk != null) {
54 | argsList += "-Djavafxsdk=${javafxStaticSdk}"
55 | }
56 | if (target != null) {
57 | argsList += ["-DtargetProfile=$target"]
58 | } else {
59 | argsList += ["-Dprism.sw=true"]
60 | }
61 | if (expected != null) {
62 | argsList += ["-Dexpected=$expected"]
63 | }
64 | if (skipsigning != null) {
65 | argsList += ["-Dskipsigning=$skipsigning"]
66 | }
67 | if (consoleProcessLog != null) {
68 | argsList += ["-DconsoleProcessLog=$consoleProcessLog", "-Dverbose=true"]
69 | }
70 | argsList += ["-Dmainclass=$mainClassName", 'com.gluonhq.substrate.SubstrateDispatcher']
71 | commandLine argsList
72 | }
73 |
--------------------------------------------------------------------------------
/test-project/helloFXML/src/main/java/com/gluonhq/substrate/test/Main.java:
--------------------------------------------------------------------------------
1 | package com.gluonhq.substrate.test;
2 |
3 | import javafx.application.Application;
4 | import javafx.geometry.Rectangle2D;
5 | import javafx.scene.Scene;
6 | import javafx.stage.Screen;
7 | import javafx.stage.Stage;
8 | import javafx.scene.layout.AnchorPane;
9 | import javafx.fxml.FXMLLoader;
10 | import javafx.animation.PauseTransition;
11 | import javafx.util.Duration;
12 | import java.util.Locale;
13 | import java.io.IOException;
14 | import java.util.ResourceBundle;
15 |
16 | public class Main extends Application {
17 |
18 | @Override
19 | public void start(Stage stage) throws IOException {
20 | AnchorPane root = FXMLLoader.load(Main.class.getResource("main.fxml"),
21 | ResourceBundle.getBundle("com.gluonhq.substrate.test.bundle"));
22 |
23 | String osName = System.getProperty("os.name").toLowerCase(Locale.ROOT);
24 |
25 | Scene scene;
26 | if (osName.contains("mac") || osName.contains("nux")) {
27 | scene = new Scene(root, 600, 400);
28 | } else {
29 | Rectangle2D bounds = Screen.getPrimary().getVisualBounds();
30 | scene = new Scene(root, bounds.getWidth(), bounds.getHeight());
31 | }
32 | stage.setScene(scene);
33 | stage.show();
34 |
35 | if (System.getProperty("javafx.platform") == null) {
36 | PauseTransition pause = new PauseTransition(Duration.seconds(5));
37 | pause.setOnFinished(f -> System.exit(0));
38 | pause.play();
39 | }
40 | }
41 |
42 | public static void main(String[] args) {
43 | System.setProperty("prism.verbose", "true");
44 | launch(args);
45 | }
46 |
47 | }
--------------------------------------------------------------------------------
/test-project/helloFXML/src/main/java/com/gluonhq/substrate/test/MainController.java:
--------------------------------------------------------------------------------
1 | package com.gluonhq.substrate.test;
2 |
3 | import javafx.fxml.FXML;
4 | import javafx.scene.control.Button;
5 | import javafx.scene.control.Label;
6 |
7 | import java.util.ResourceBundle;
8 |
9 | public class MainController {
10 |
11 | @FXML
12 | private Button button;
13 |
14 | @FXML
15 | private Label label;
16 |
17 | @FXML
18 | private ResourceBundle resources;
19 |
20 | public void initialize() {
21 | button.setOnAction(e -> {
22 | label.setText(resources.getString("label.text") + " " + System.getProperty("javafx.version"));
23 | label.setVisible(!label.isVisible());
24 | });
25 | }
26 |
27 | }
--------------------------------------------------------------------------------
/test-project/helloFXML/src/main/resources/com/gluonhq/substrate/test/bundle.properties:
--------------------------------------------------------------------------------
1 | button.text=Click Me!
2 | label.text=Hello JavaFXML
--------------------------------------------------------------------------------
/test-project/helloFXML/src/main/resources/com/gluonhq/substrate/test/main.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/test-project/helloFXML/src/main/resources/com/gluonhq/substrate/test/style.css:
--------------------------------------------------------------------------------
1 | .box {
2 | -fx-spacing: 50;
3 | -fx-alignment: center;
4 | }
5 |
6 | .box > .label {
7 | -fx-font-size: 1.3em;
8 | -fx-text-fill: #de2125;
9 | }
10 |
11 | .box > .button {
12 | -fx-font-size: 1.5em;
13 | -fx-text-fill: derive(#2125de, 30%);
14 | }
--------------------------------------------------------------------------------
/test-project/helloGluon/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'org.openjfx.javafxplugin' version '0.1.0'
3 | }
4 |
5 | repositories {
6 | mavenCentral()
7 | maven {
8 | url 'https://nexus.gluonhq.com/nexus/content/repositories/releases/'
9 | }
10 | }
11 |
12 | def attachVersion = "4.0.13"
13 | def target = System.getProperty("substrate.target")
14 | def classifier = "ios" == target ? target : "desktop"
15 |
16 | configurations {
17 | substrate
18 | }
19 |
20 | dependencies {
21 | substrate "com.gluonhq:substrate:$substrateVersion"
22 |
23 | implementation "com.gluonhq:charm-glisten:6.0.6"
24 | implementation ("com.gluonhq.attach:display:$attachVersion:$classifier") {
25 | exclude group:"org.openjfx"
26 | }
27 | implementation ("com.gluonhq.attach:lifecycle:$attachVersion:$classifier") {
28 | exclude group:"org.openjfx"
29 | }
30 | if ("ios" == target) {
31 | implementation ("com.gluonhq.attach:statusbar:$attachVersion:$classifier") {
32 | exclude group:"org.openjfx"
33 | }
34 | } else {
35 | implementation ("com.gluonhq.attach:statusbar:$attachVersion") {
36 | exclude group:"org.openjfx"
37 | }
38 | }
39 | implementation ("com.gluonhq.attach:storage:$attachVersion:$classifier") {
40 | exclude group:"org.openjfx"
41 | }
42 | implementation ("com.gluonhq.attach:util:$attachVersion") {
43 | exclude group:"org.openjfx"
44 | }
45 | }
46 |
47 | javafx {
48 | version = "17.0.10"
49 | modules = [ "javafx.controls" ]
50 | }
51 |
52 | mainClassName = "com.gluonhq.substrate.test.Main"
53 |
54 | task runScript(type: Exec) {
55 | dependsOn 'build'
56 |
57 | def javaHome = validateJavaHome()
58 | def graalvmHome = validateGraalvmHome()
59 | def javafxStaticSdk = validateJavafxStaticSdk()
60 |
61 | def expected = System.getProperty("expected")
62 | def skipsigning = System.getProperty("skipsigning")
63 | def consoleProcessLog = System.getProperty("consoleProcessLog")
64 |
65 | def imageClasspath = ""
66 | if (javafxStaticSdk != null) {
67 | imageClasspath = "${javafxStaticSdk}/lib/javafx.base.jar${File.pathSeparator}" +
68 | "${javafxStaticSdk}/lib/javafx.graphics.jar${File.pathSeparator}" +
69 | "${javafxStaticSdk}/lib/javafx.controls.jar${File.pathSeparator}" +
70 | project.sourceSets.main.runtimeClasspath.filter{!it.name.contains('javafx')}.asPath
71 | } else {
72 | imageClasspath = project.sourceSets.main.runtimeClasspath.asPath
73 | }
74 |
75 | def argsList = ["${javaHome}/bin/java", '-cp', project.configurations.substrate.asPath,
76 | "-Dimagecp=${imageClasspath}",
77 | "-Dgraalvm=${graalvmHome}"]
78 | if (javafxStaticSdk != null) {
79 | argsList += "-Djavafxsdk=${javafxStaticSdk}"
80 | }
81 | if (target != null) {
82 | argsList += ["-DtargetProfile=$target"]
83 | } else {
84 | argsList += ["-Dprism.sw=true"]
85 | }
86 | if (expected != null) {
87 | argsList += ["-Dexpected=$expected"]
88 | }
89 | if (skipsigning != null) {
90 | argsList += ["-Dskipsigning=$skipsigning"]
91 | }
92 | if (consoleProcessLog != null) {
93 | argsList += ["-DconsoleProcessLog=$consoleProcessLog", "-Dverbose=true"]
94 | }
95 | argsList += ["-Dmainclass=$mainClassName", 'com.gluonhq.substrate.SubstrateDispatcher']
96 | commandLine argsList
97 | }
98 |
--------------------------------------------------------------------------------
/test-project/helloGluon/src/main/java/com/gluonhq/substrate/test/Main.java:
--------------------------------------------------------------------------------
1 | package com.gluonhq.substrate.test;
2 |
3 | import com.gluonhq.attach.display.DisplayService;
4 | import com.gluonhq.attach.util.Platform;
5 | import com.gluonhq.charm.glisten.application.MobileApplication;
6 | import com.gluonhq.charm.glisten.control.AppBar;
7 | import com.gluonhq.charm.glisten.control.FloatingActionButton;
8 | import com.gluonhq.charm.glisten.mvc.View;
9 | import com.gluonhq.charm.glisten.visual.MaterialDesignIcon;
10 | import com.gluonhq.charm.glisten.visual.Swatch;
11 | import javafx.geometry.Dimension2D;
12 | import javafx.geometry.Pos;
13 | import javafx.scene.Scene;
14 | import javafx.scene.control.Label;
15 | import javafx.scene.image.Image;
16 | import javafx.scene.image.ImageView;
17 | import javafx.scene.layout.VBox;
18 | import javafx.animation.PauseTransition;
19 | import javafx.util.Duration;
20 |
21 | public class Main extends MobileApplication {
22 |
23 | @Override
24 | public void init() {
25 | addViewFactory(HOME_VIEW, () -> {
26 | FloatingActionButton fab = new FloatingActionButton(MaterialDesignIcon.SEARCH.text,
27 | e -> System.out.println("Search"));
28 |
29 | ImageView imageView = new ImageView(new Image(Main.class.getResourceAsStream("openduke.png")));
30 |
31 | imageView.setFitHeight(200);
32 | imageView.setPreserveRatio(true);
33 |
34 | Label label = new Label("Hello, Gluon Mobile!");
35 | VBox root = new VBox(20, imageView, label);
36 | root.setAlignment(Pos.CENTER);
37 |
38 | View view = new View(root) {
39 | @Override
40 | protected void updateAppBar(AppBar appBar) {
41 | appBar.setTitleText("Gluon Mobile");
42 | }
43 | };
44 |
45 | fab.showOn(view);
46 |
47 | return view;
48 | });
49 | }
50 |
51 | @Override
52 | public void postInit(Scene scene) {
53 | Swatch.LIGHT_GREEN.assignTo(scene);
54 | scene.getStylesheets().add(Main.class.getResource("styles.css").toExternalForm());
55 |
56 | if (Platform.isDesktop()) {
57 | Dimension2D dimension2D = DisplayService.create()
58 | .map(DisplayService::getDefaultDimensions)
59 | .orElse(new Dimension2D(640, 480));
60 | scene.getWindow().setWidth(dimension2D.getWidth());
61 | scene.getWindow().setHeight(dimension2D.getHeight());
62 | }
63 |
64 | if (System.getProperty("javafx.platform") == null) {
65 | PauseTransition pause = new PauseTransition(Duration.seconds(5));
66 | pause.setOnFinished(f -> System.exit(0));
67 | pause.play();
68 | }
69 | }
70 |
71 | public static void main(String[] args) {
72 | System.setProperty("prism.verbose", "true");
73 | launch(args);
74 | }
75 |
76 | }
--------------------------------------------------------------------------------
/test-project/helloGluon/src/main/resources/com/gluonhq/substrate/test/openduke.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gluonhq/substrate/51c966ac800bf02c712a1800004f7ee7f1eefdd9/test-project/helloGluon/src/main/resources/com/gluonhq/substrate/test/openduke.png
--------------------------------------------------------------------------------
/test-project/helloGluon/src/main/resources/com/gluonhq/substrate/test/styles.css:
--------------------------------------------------------------------------------
1 | .label {
2 | -fx-font-size: 2em;
3 | -fx-text-fill: -primary-swatch-700;
4 | }
--------------------------------------------------------------------------------
/test-project/helloWorld/build.gradle:
--------------------------------------------------------------------------------
1 | repositories {
2 | mavenCentral()
3 | }
4 |
5 | def target = System.getProperty("substrate.target")
6 |
7 | configurations {
8 | substrate
9 | }
10 |
11 | dependencies {
12 | substrate "com.gluonhq:substrate:$substrateVersion"
13 | }
14 |
15 | mainClassName = "com.gluonhq.substrate.test.Main"
16 |
17 | task runScript(type: Exec) {
18 | def javaHome = validateJavaHome()
19 | def graalvmHome = validateGraalvmHome()
20 |
21 | def skipsigning = System.getProperty("skipsigning")
22 | def expected = System.getProperty("expected")
23 | def consoleProcessLog = System.getProperty("consoleProcessLog")
24 |
25 | def argsList = ["${javaHome}/bin/java", '-cp', "${project.configurations.substrate.asPath}",
26 | "-Dimagecp=${project.sourceSets.main.runtimeClasspath.asPath}",
27 | "-Dgraalvm=${graalvmHome}"]
28 | if (target != null) {
29 | argsList += ["-DtargetProfile=$target"]
30 | }
31 | if (skipsigning != null) {
32 | argsList += ["-Dskipsigning=$skipsigning"]
33 | }
34 | if (expected != null) {
35 | argsList += ["-Dexpected=$expected"]
36 | }
37 | if (consoleProcessLog != null) {
38 | argsList += ["-DconsoleProcessLog=$consoleProcessLog", "-Dverbose=true"]
39 | }
40 | argsList += ["-Dmainclass=$mainClassName", 'com.gluonhq.substrate.SubstrateDispatcher']
41 | commandLine argsList
42 | }
43 |
--------------------------------------------------------------------------------
/test-project/helloWorld/src/main/java/com/gluonhq/substrate/test/Main.java:
--------------------------------------------------------------------------------
1 | package com.gluonhq.substrate.test;
2 |
3 | public class Main {
4 |
5 | public static void main(String[] args) {
6 | System.out.println("Hello World");
7 | System.exit(0);
8 | }
9 |
10 | }
--------------------------------------------------------------------------------
/test-project/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'substrateTests'
2 |
3 | include 'helloWorld'
4 | include 'helloFX'
5 | include 'helloGluon'
6 | include 'helloFXML'
7 |
8 | includeBuild '../'
--------------------------------------------------------------------------------