diff --git a/.ci/build.bat b/.ci/build.bat deleted file mode 100644 index 7e4241f88..000000000 --- a/.ci/build.bat +++ /dev/null @@ -1,12 +0,0 @@ -echo "Executing gradle" - -call gradlew check shadowJar -PVERSION=%APPVEYOR_REPO_TAG_NAME% - -echo "TAG NAME" -echo %APPVEYOR_REPO_TAG_NAME% - -if NOT "%APPVEYOR_REPO_TAG_NAME%" == "" ( - set VERSION=%APPVEYOR_REPO_TAG_NAME% - echo %VERSION% - call .ci\windows.bat -) diff --git a/.ci/build.sh b/.ci/build.sh deleted file mode 100755 index d7a2825d6..000000000 --- a/.ci/build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -if [ "${TRAVIS_OS_NAME}" = "linux" ]; then - ./gradlew check shadowJar -PVERSION=${TRAVIS_TAG}; -else -# export JAVA_HOME="$(find /Library/Java/JavaVirtualMachines/ -type d -name jdk-11* | tail -n 1)/Contents/Home" - # Skip tests that fail on osx without xvfb - ./gradlew check shadowJar -PVERSION=${TRAVIS_TAG} -PexcludeTests="FXOMSaverUpdateImportInstructionsTest,StaticLoadTest,SkeletonBufferTest"; -fi - -# Check if tag is present and run bundle script -if [ -n "${TRAVIS_TAG}" ]; then - export VERSION=${TRAVIS_TAG}; - chmod +x .ci/${TRAVIS_OS_NAME}.sh; - sh .ci/${TRAVIS_OS_NAME}.sh; - - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then - mkdir -p deployment/${TRAVIS_TAG}/install/linux; - cp dist/bundles/*.deb deployment/${TRAVIS_TAG}/install/linux/; - cp dist/bundles/*.rpm deployment/${TRAVIS_TAG}/install/linux/; - else - mkdir -p deployment/${TRAVIS_TAG}/install/mac; - cp dist/bundles/*.dmg deployment/${TRAVIS_TAG}/install/mac/; - fi -fi diff --git a/.ci/linux.sh b/.ci/linux.sh deleted file mode 100755 index dae3e50b6..000000000 --- a/.ci/linux.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -java -version - -sudo apt-get update -sudo apt-get install fakeroot # deb -sudo apt-get install rpm # rpm - -${JAVA_HOME}/bin/javapackager -createjar -v \ - -appclass com.oracle.javafx.scenebuilder.app.SceneBuilderApp \ - -nocss2bin \ - -srcfiles app/build/libs/scenebuilder-${VERSION}-all.jar \ - -outdir dist \ - -outfile dist.jar - -cp app/src/main/resources/LICENSE dist - -${JAVA_HOME}/bin/javapackager -deploy -v \ - -native \ - -outdir dist \ - -outfile dist \ - -vendor Gluon \ - -description "Scene Builder" \ - -appclass com.oracle.javafx.scenebuilder.app.SceneBuilderApp \ - -name SceneBuilder \ - -srcdir dist \ - -srcfiles dist.jar:LICENSE \ - -BappVersion=${VERSION} \ - -Bcategory=Development \ - -Bemail=support@gluonhq.com \ - -Bicon=app/assets/linux/icon-linux.png \ - -BlicenseFile=LICENSE \ - -BlicenseType=BSD \ - -Bcopyright="Copyright (c) 2012, 2014, Oracle and/or its affiliates, 2016, Gluon." - -echo "Linux packager successfully created" - -# Rename bundles -mv dist/bundles/*-${VERSION}.deb dist/bundles/SceneBuilder-${VERSION}.deb -mv dist/bundles/*-${VERSION}-*.rpm dist/bundles/SceneBuilder-${VERSION}.rpm - -echo "Bundles directory contains..." -ls dist/bundles/ diff --git a/.ci/osx-add-key.sh b/.ci/osx-add-key.sh deleted file mode 100755 index 0c0945bf9..000000000 --- a/.ci/osx-add-key.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -KEY_CHAIN=ios-build.keychain - -# Create a custom keychain -security create-keychain -p travis $KEY_CHAIN - -# Make the custom keychain default, so xcodebuild will use it for signing -security default-keychain -s $KEY_CHAIN - -# Unlock the keychain -security unlock-keychain -p travis $KEY_CHAIN - -# Set keychain timeout to 1 hour for long builds -# see http://www.egeek.me/2013/02/23/jenkins-and-xcode-user-interaction-is-not-allowed/ -security set-keychain-settings -t 3600 -l ~/Library/Keychains/$KEY_CHAIN - -# Add certificates to keychain and allow codesign to access them -security import ./app/assets/osx/apple.cer -k ~/Library/Keychains/$KEY_CHAIN -T /usr/bin/codesign -security import ./app/assets/osx/codesign.cer -k ~/Library/Keychains/$KEY_CHAIN -T /usr/bin/codesign -security import ./app/assets/osx/codesign.p12 -k ~/Library/Keychains/$KEY_CHAIN -P $KEY_SECRET -T /usr/bin/codesign - -security set-key-partition-list -S apple-tool:,apple: -s -k travis $KEY_CHAIN diff --git a/.ci/osx.sh b/.ci/osx.sh deleted file mode 100755 index 95d7432ff..000000000 --- a/.ci/osx.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -chmod +x .ci/osx-add-key.sh -sh .ci/osx-add-key.sh - -export JAVA_HOME=$(/usr/libexec/java_home) -echo $JAVA_HOME - -${JAVA_HOME}/bin/java -version - -${JAVA_HOME}/bin/javapackager -createjar -v \ - -appclass com.oracle.javafx.scenebuilder.app.SceneBuilderApp \ - -nocss2bin \ - -srcfiles app/build/libs/scenebuilder-${VERSION}-all.jar \ - -outdir dist \ - -outfile dist.jar - -cp app/src/main/resources/LICENSE dist - -${JAVA_HOME}/bin/javapackager -deploy -v \ - -native \ - -outdir dist \ - -outfile dist \ - -vendor Gluon \ - -description "Scene Builder" \ - -appclass com.oracle.javafx.scenebuilder.app.SceneBuilderApp \ - -name SceneBuilder \ - -srcdir dist \ - -srcfiles dist.jar:LICENSE \ - -BappVersion=${VERSION} \ - -Bcategory=Development \ - -Bemail=support@gluonhq.com \ - -Bicon=app/assets/osx/icon-mac.icns \ - -BlicenseFile=LICENSE \ - -BlicenseType=BSD \ - -Bcopyright="Copyright (c) 2012, 2014, Oracle and/or its affiliates, 2016, 2018, Gluon." \ - -Bmac.category=Education \ - -Bmac.CFBundleIdentifier=com.gluonhq.scenebuilder \ - -Bmac.CFBundleName="Scene Builder" \ - -Bmac.CFBundleVersion=${VERSION} \ - -Bmac.signing-key-developer-id-app="Developer ID Application: Gluon Software BVBA (S7ZR395D8U)" \ - -Bmac.bundle-id-signing-prefix=S7ZR395D8U diff --git a/.ci/windows.bat b/.ci/windows.bat deleted file mode 100644 index 0a8c247be..000000000 --- a/.ci/windows.bat +++ /dev/null @@ -1,42 +0,0 @@ -java -version - -echo "Tag version" -echo %VERSION% - -sed -i -e "s/VERSION/%VERSION%/g" app\assets\windows\SceneBuilder-x64.iss - -mkdir package\windows -copy app\assets\windows\SceneBuilder-setup-icon.bmp package\windows\SceneBuilder-setup-icon.bmp -copy app\assets\windows\SceneBuilder-x64.iss package\windows\SceneBuilder.iss - -"%JAVA_HOME%\bin\javapackager.exe" -createjar^ - -appclass com.oracle.javafx.scenebuilder.app.SceneBuilderApp^ - -nocss2bin^ - -srcfiles app\build\libs\scenebuilder-%VERSION%-all.jar^ - -outdir dist^ - -outfile dist.jar - -copy app\src\main\resources\LICENSE dist\LICENSE - -"%JAVA_HOME%\bin\javapackager.exe" -deploy^ - -native exe^ - -outdir dist^ - -outfile dist^ - -vendor Gluon^ - -description "Scene Builder"^ - -appclass com.oracle.javafx.scenebuilder.app.SceneBuilderApp^ - -name SceneBuilder^ - -srcdir dist^ - -srcfiles dist.jar^ - -srcfiles dist.jar;LICENSE^ - -BappVersion=%VERSION%^ - -BlicenseFile=LICENSE^ - -Bicon=app\assets\windows\icon-windows.ico - -"%signtool%" sign /tr http://timestamp.comodoca.com /td sha256 /fd sha256 /f app\assets\windows\codesign.p12 /p %key_secret% dist\bundles\*.exe" - -echo "Bundles directory contains..." -dir dist\bundles\ - -md install\windows -copy dist\bundles\*.exe install\windows diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 000000000..5cc100d24 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,22 @@ +--- +name: 'Bug report' +about: 'Create a report to help us improve' +labels: 'bug' +--- + + + +### Expected Behavior + + +### Current Behavior + + +### Steps to Reproduce + + +### Your Environment + + +### Screenshots + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 000000000..b8e89bfab --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,17 @@ +--- +name: 'Feature request' +about: 'Suggest an idea for this project' +labels: 'enhancement' +--- + + + +### Expected Behavior + + +### Current Behavior + + +### Context + + \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..c6d87d094 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ + + +### Issue + + +Fixes # + +### Progress + +- [ ] Change must not contain extraneous whitespace +- [ ] License header year is updated, if required +- [ ] Verify the contributor has signed [Gluon Individual Contributor License Agreement (CLA)](https://docs.google.com/forms/d/16aoFTmzs8lZTfiyrEm8YgMqMYaGQl0J8wA0VJE2LCCY) \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..48eca1a06 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,37 @@ +name: SceneBuilder Build +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Install packages + run: | + sudo apt-get install xvfb tigervnc-standalone-server tigervnc-common + + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Java 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build project + run: | + export DISPLAY=:90 + mkdir /home/runner/.vnc + echo 123456 | vncpasswd -f > /home/runner/.vnc/passwd + chmod -v 600 /home/runner/.vnc/passwd + vncserver :90 -localhost -nolisten tcp + ./gradlew -i build + vncserver -kill :90 \ No newline at end of file diff --git a/.github/workflows/kit.yml b/.github/workflows/kit.yml new file mode 100644 index 000000000..1115b3ea4 --- /dev/null +++ b/.github/workflows/kit.yml @@ -0,0 +1,54 @@ +name: Scene Builder Kit +on: + push: + tags: + - '*' +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Install packages + run: sudo apt-get install xdg-utils xvfb tigervnc-standalone-server tigervnc-common + - uses: actions/checkout@v2 + - name: Setup java + uses: joschi/setup-jdk@v2 + with: + java-version: 16 + - name: Store Variables + id: variables + run: | + TAG=${GITHUB_REF/refs\/tags\//} + S3_PATH=${{ env.AWS_S3_BUCKET }}/scenebuilder/$TAG/ + if [[ "$TAG" == *-RC* ]]; then + S3_PATH=${{ env.AWS_S3_BUCKET }}/scenebuilder/RC/$TAG/ + fi + echo ::set-output name=SOURCE_TAG::$TAG + echo ::set-output name=S3_PATH::$S3_PATH + shell: bash + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + - name: Create Kit Jar + run: | + chmod +x gradlew + export DISPLAY=:90 + mkdir /home/runner/.vnc + echo 123456 | vncpasswd -f > /home/runner/.vnc/passwd + chmod -v 600 /home/runner/.vnc/passwd + vncserver :90 -localhost -nolisten tcp + ./gradlew -i clean :kit:build -PVERSION=$TAG + vncserver -kill :90 + env: + TAG: ${{ steps.variables.outputs.SOURCE_TAG }} + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: SceneBuilder-Kit-Jar + path: kit/build/libs/*.jar + - name: Upload to AWS S3 + run: | + aws s3 cp kit/build/libs/scenebuilder-kit-$TAG.jar $S3_PATH --acl public-read --region us-east-1 --debug + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + S3_PATH: ${{ steps.variables.outputs.S3_PATH }} + TAG: ${{ steps.variables.outputs.SOURCE_TAG }} \ No newline at end of file diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 000000000..5ff8e4fea --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,61 @@ +name: Scene Builder Linux Bundles +on: + push: + tags: + - '*' +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Install packages + run: sudo apt-get install xdg-utils + - uses: actions/checkout@v2 + - name: Setup java + uses: joschi/setup-jdk@v2 + with: + java-version: 16 + - name: Store Variables + id: variables + run: | + TAG=${GITHUB_REF/refs\/tags\//} + VERSION=$TAG + S3_PATH=${{ env.AWS_S3_BUCKET }}/scenebuilder/$TAG/install/linux/ + if [[ "$TAG" == *-RC* ]]; then + VERSION=`echo $TAG | cut -d- -f1` + S3_PATH=${{ env.AWS_S3_BUCKET }}/scenebuilder/RC/$TAG/install/linux/ + fi + echo ::set-output name=SOURCE_TAG::$TAG + echo ::set-output name=SOURCE_VERSION::$VERSION + echo ::set-output name=S3_PATH::$S3_PATH + shell: bash + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + - name: Create Bundle using JPackage + run: | + wget -P /tmp https://download2.gluonhq.com/openjfx/16/openjfx-16_linux-x64_bin-jmods.zip + unzip /tmp/openjfx-16_linux-x64_bin-jmods.zip -d /tmp + ./gradlew jlink jpackage -PVERSION=${{ env.VERSION }} + mv app/build/*.deb app/build/SceneBuilder-${{ env.TAG }}.deb + sed -i "s/'deb'/'rpm'/g" app/build.gradle + ./gradlew jpackage -PVERSION=${{ env.VERSION }} + mv app/build/*.rpm app/build/SceneBuilder-${{ env.TAG }}.rpm + ls app/build/ + env: + JAVAFX_HOME: /tmp/javafx-jmods-16/ + JPACKAGE_HOME: ${{ env.JAVA_HOME }} + TAG: ${{ steps.variables.outputs.SOURCE_TAG }} + VERSION: ${{ steps.variables.outputs.SOURCE_VERSION }} + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: SceneBuilder-${{ runner.os }} + path: | + app/build/*.deb + app/build/*.rpm + - name: Upload to AWS S3 + run: | + aws s3 cp app/build/ ${{ env.S3_PATH }} --exclude "**/*" --acl public-read --recursive --region us-east-1 --debug + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + S3_PATH: ${{ steps.variables.outputs.S3_PATH }} \ No newline at end of file diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml new file mode 100644 index 000000000..8d377dd23 --- /dev/null +++ b/.github/workflows/mac.yml @@ -0,0 +1,71 @@ +name: Scene Builder MacOS Bundles +on: + push: + tags: + - '*' +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Setup java + uses: joschi/setup-jdk@v2 + with: + java-version: 16 + - uses: Apple-Actions/import-codesign-certs@v1 + with: + p12-file-base64: ${{ secrets.CERTIFICATES_FILE_BASE64 }} + p12-password: ${{ secrets.CERTIFICATES_PASSWORD }} + - name: Store Variables + id: variables + run: | + TAG=${GITHUB_REF/refs\/tags\//} + VERSION=$TAG + S3_PATH=${{ env.AWS_S3_BUCKET }}/scenebuilder/$TAG/install/mac/ + if [[ "$TAG" == *-RC* ]]; then + VERSION=`echo $TAG | cut -d- -f1` + S3_PATH=${{ env.AWS_S3_BUCKET }}/scenebuilder/RC/$TAG/install/mac/ + fi + echo ::set-output name=SOURCE_TAG::$TAG + echo ::set-output name=SOURCE_VERSION::$VERSION + echo ::set-output name=S3_PATH::$S3_PATH + shell: bash + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + - name: Create Bundle using JPackage + id: outputfile + run: | + wget -P /tmp https://download2.gluonhq.com/openjfx/16/openjfx-16_osx-x64_bin-jmods-SIGNED.zip + unzip /tmp/openjfx-16_osx-x64_bin-jmods-SIGNED.zip -d /tmp + ./gradlew jlink jpackage -PVERSION=${{ env.VERSION }} -PsigningPrefix="$GLUON_MACSIGN_PREFIX" -PsigningKeyUsername="$GLUON_MACSIGN_USER" + mv app/build/SceneBuilder-${{ env.VERSION }}.dmg app/build/SceneBuilder-${{ env.TAG }}.dmg + echo ::set-output name=path::app/build/SceneBuilder-${{ env.TAG }}.dmg + env: + JAVAFX_HOME: /tmp/javafx-jmods-16/ + JPACKAGE_HOME: ${{ env.JAVA_HOME }} + GLUON_MACSIGN_PREFIX: ${{ secrets.GLUON_MACSIGN_PREFIX }} + GLUON_MACSIGN_USER: ${{ secrets.GLUON_MACSIGN_USER }} + TAG: ${{ steps.variables.outputs.SOURCE_TAG }} + VERSION: ${{ steps.variables.outputs.SOURCE_VERSION }} + - name: "Notarize Release Build" + uses: erwin1/xcode-notarize@main + with: + product-path: ${{ steps.outputfile.outputs.path }} + appstore-connect-username: ${{ secrets.NOTARIZATION_USERNAME }} + appstore-connect-password: ${{ secrets.NOTARIZATION_PASSWORD }} + primary-bundle-id: com.gluonhq.scenebuilder + asc-provider: ${{ secrets.GLUON_MACSIGN_PREFIX }} + verbose: true + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: SceneBuilder-${{ runner.os }} + path: ${{ steps.outputfile.outputs.path }} + - name: Upload to AWS S3 + run: | + aws s3 cp $ARTIFACT_PATH $S3_PATH --acl public-read --region us-east-1 --debug + env: + ARTIFACT_PATH: ${{ steps.outputfile.outputs.path }} + S3_PATH: ${{ steps.variables.outputs.S3_PATH }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..689d67921 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Scene Builder Release - Upload files +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Find TAG name + id: find-tag + run: | + TAG=${GITHUB_REF/refs\/tags\//} + echo "::set-output name=tag::$TAG" + - name: Upload settings.properties and version.json + if: "!contains(steps.find-tag.outputs.tag, 'RC')" + run: | + TAG=${{ steps.find-tag.outputs.tag }} + printf "latestversion=$TAG" > settings.properties + aws s3 cp settings.properties ${{ env.AWS_S3_BUCKET }}/scenebuilder/settings.properties --acl public-read --region us-east-1 --debug + # Upload version.json. Some older versions still use version-8.4.0.json file + aws s3 cp $GITHUB_WORKSPACE/version.json ${{ env.AWS_S3_BUCKET }}/scenebuilder/version.json --acl public-read --region us-east-1 --debug + aws s3 cp $GITHUB_WORKSPACE/version.json ${{ env.AWS_S3_BUCKET }}/scenebuilder/version-8.4.0.json --acl public-read --region us-east-1 --debug + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml new file mode 100644 index 000000000..b8be5403a --- /dev/null +++ b/.github/workflows/win.yml @@ -0,0 +1,62 @@ +name: Scene Builder Windows Bundles +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Setup java + uses: joschi/setup-jdk@v2 + with: + java-version: 16 + - name: Store Variables + id: variables + run: | + TAG=${GITHUB_REF/refs\/tags\//} + VERSION=$TAG + S3_PATH=${{ env.AWS_S3_BUCKET }}/scenebuilder/$TAG/install/windows/ + if [[ "$TAG" == *-RC* ]]; then + VERSION=`echo $TAG | cut -d- -f1` + S3_PATH=${{ env.AWS_S3_BUCKET }}/scenebuilder/RC/$TAG/install/windows/ + fi + echo ::set-output name=SOURCE_TAG::$TAG + echo ::set-output name=SOURCE_VERSION::$VERSION + echo ::set-output name=S3_PATH::$S3_PATH + shell: bash + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + - name: Create Bundle using JPackage + run: | + bitsadmin /Transfer DownloadJavaFX https://download2.gluonhq.com/openjfx/16/openjfx-16_windows-x64_bin-jmods.zip D:\openjfx-16_windows-x64_bin-jmods.zip + powershell -command "Expand-Archive -Force D:\openjfx-16_windows-x64_bin-jmods.zip D:\" + .\gradlew jlink jpackage -PVERSION="${{ env.VERSION }}" + ren app\build\SceneBuilder-${{ env.VERSION }}.msi SceneBuilder-${{ env.TAG }}.msi + env: + JAVAFX_HOME: D:\javafx-jmods-16 + JPACKAGE_HOME: ${{ env.JAVA_HOME }} + TAG: ${{ steps.variables.outputs.SOURCE_TAG }} + VERSION: ${{ steps.variables.outputs.SOURCE_VERSION }} + - name: Codesign + uses: erwin1/code-sign-action@master + with: + certificate: '${{ secrets.WINDOWS_CERTIFICATE }}' + password: '${{ secrets.WINDOWS_PASSWORD }}' + certificatename: '${{ secrets.WINDOWS_CERTNAME }}' + folder: 'app/build' + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: SceneBuilder-${{ runner.os }} + path: app/build/*.msi + - name: Upload to AWS S3 + run: | + aws s3 cp app/build/SceneBuilder-${{ env.TAG }}.msi ${{ env.S3_PATH }} --acl public-read --region us-east-1 --debug + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + TAG: ${{ steps.variables.outputs.SOURCE_TAG }} + S3_PATH: ${{ steps.variables.outputs.S3_PATH }} diff --git a/.gitignore b/.gitignore index 678c2f9b9..ad3ca0854 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ kit/build/ # IDEA .idea/ *.iml +out/ # Eclipse .classpath diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8f3ab4fe0..000000000 --- a/.travis.yml +++ /dev/null @@ -1,73 +0,0 @@ -# use java support. -language: java - -# required to install tools on Linux -sudo: required - -# skip install -install: true - -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ - -cache: - directories: - - "$HOME/.gradle/caches/" - -before_install: - - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then - sudo -H pip install --upgrade pip; - pip install awscli --upgrade --user; - fi - -env: - global: - - secure: "MZhhXBH49kGDBD6b85kNS53I61dNfUCYg2Q3H+1bmW5g7lDdoAG8wYsQ+a2u189MswnDfg/oFa7e1WlXu/AuKDZkM22ne/lfTKvHHzL9f611GsvpNpSUl4NOxYRdsxwdqKco+ypVasOzxQwghy4xx6ufdA6yIJhLrIVcIg58xKBO2fqu0G39QphTPxl+fi8kTtolQST68fT2WR3UOxLZJ/YDD5fkv/ZfMnRl/wG642ppfbRmpNzTvtU2GdxDiZJ4bCtBweUXimLe8LvSE1zuSvKaXb+dEwgjjv+Lufq96vajLX0jYnbEUan/Zp9h2OQNeco9QvaVEvQ/7SDNPoaX6b8t9IHW/pDmVVxMwfuv4T22f2K5OUp5GYtusCqoOonZWUJtnWbtIO+Q14JzLd7UHTCn2R+edi9Mz2iaP/B8AYHMqN2G3EZ+uPy/j8vxkeL8gCZuFVx0N53wkrjJ9D0PYCloQohDejEScBtnS3sV4/jhTazPoqgFi/EyG7Wmg3A+4DDANtE1fEMPBiHZ+OD+jFJAwV7HRTeQstc156hqDvb3JJt+QEh1cKzrpo8Ay/ewt9/SJD0WA5fcsXz4gGH2TyzKOmRWiwpbdyG4c3x2T8vdm7eL8cj/EnFV6MLwtOYEVzWnvqfZgT06LEGGmYw3WUadkFsVA/qJPxEzGergNtQ=" - - secure: "d2jvdKutBjSIFaeaMPSkCO53+0tUq8qzlFrUOmKNyEyosoMnfh/GljoOkwmLzsyhI5fC841nJNuN+FQJmYobNZkgKV6ljNqaxe8k+Ug08sWFP1OLpiHyZ/C+ZvWRCdA4DUjv2rGQu8VK6rffLJaK58QAupQEkVWw4nBgbcEUSIaHTNM36b4AwyjNNmqPfL/Bds72GIjdizDjZ2ivASTVgj1gb3kFO/ubWnWjcOxEfKSxIw5KNW5/1b8kAu+LlKIWmoXQzSyansyOfFTFe67B7cmtU88IFoiDulQcSlKHAxnE6V92NK9iEaSUNYO37hCcCB3e8gDVQE1GHHaBi789B3ner6hbH9aKTDK345PHjtlWqVrC7/ya4aGfm6R9H2rGI63VS1EP194nUBC6hWYUC1GOWrwE38PvSn0W8MLjJ7ygV0kO7z5zcYg9klZKQUxeoNjceWykaFFGogCl7BdBxxazLrbac2zMwyA/hvTbi/qZQ13ihXxXTg8Srf7FDAcfHcvVx1s3hiJTpOV/xdvg9AA/6tf2a9jIvDCNd8giKQjfUdwUpwnN+fTQtHQYQE6PnYkgZOFQC7enYTdMxyw4nP7tNVJDRZbJvSw1fmHSfuEderQ3myMvJaSSyz4DXz4W2FZoo7u1LEsWpEJF33eG2zRzwuxZuirCIHNGUDfZVGQ=" - - secure: "vWiTwEpeL/lwe9ul7s5TddKRNSQvB2KjPS95OQK4IT0rLyo7Uyl8VFA/k4pXzIKPayqei5OwBSDW+c+u3Mklr5rU6FPOU+rZa0ZMGUWGGPO1+9I/f9FzDOOTd5oZqXEYmUJC77anYuQwvVCRwjjPnuRi/05RsSlZFg8ozLKIjXnenTMyjRvYFh74VJpdVensfleOjJsK5267eCAZH9mlFsftsbMVkJTJ+hNVMUScE2fD9aMLYx4hwMpal24vteiWnpCmEwxyBiLm4CMbxq5z27dkhm/CLfiu1cDvV3Ei15wcwO3ZSz4R/O0U79I9A0/IBzEap8uTeZOqp9Z1FBJ9hz1XlCiXGjZhPT+k419OyUK7UKTejUelTSAKwWCgAvyZ52LAcAZAvj+0nEnpAGQNzskog4tc9nwETHjepSBkJzCkgOlEnBP/aflDlwyuXD/5q/oU0/UQ5paJx59dpDTBWP1hDAOVHSMMzdGv50sT18QmMxXsetu+dWpMxa9jjsp5jxCc1NNeqRd5SjYdTRMbW9R5k0v+TwwLSCy28OE7c3d1WI7X3GPAY4uPV/u3NgAEhjpRidCNTVxHeDD63DVcHUxfNEH1UcDbb88qHJaW2bSVWYYPZOwKE0HxV6fUFLRXPPwER9Qn6WKL9+WycSZ2N1+Pl3QrA2tAJ1m+9u48X+M=" - - secure: "ouqfdutVk9LM7OxKnqrplBVLpT+wS2ABRORSfX2Y0lz+JRaNN0bq0HF0tu6fOpn2KG4xTTknlZKrFPAqBiilvLMF61vvEV4zlmEY+449uwqQnEGtv30c5E28tSLuibsmkLJ4a4vP8wqZR30y477ngUR4l2TzBXp+PjTqIBFhmEmViJMmR7q7SmPCY7/lUD1LqXlHegLJ/hrxRGHyaZcyPzb7/pJOYdMrYRyGhR4ADoYmm2fSFEkiyvferk8rD609vzM9vEBfix3KBNmDsaCZvZpyl9Y+LZE9z9xApgwog6Y7azBarJzVHnI5dEApgoZ1RYAg3Yn3cfG6p65TRGN3auXKK5ZRD+Fe9L6Br1uL5DLo7MJpHALlvl2D0oumOggHkXPsGZMOUKFK3K2FDgTcwekFxBZ1yJEjB8IVS2gzMxMW4qdaOM7ErLSz/IziGVnxgAUdfq0760XEKml+lgVCYkYioY29594vBKPUhzX8so+3JKX+7PLPgL40T1uALkLMz4fuWrsYrrvJK/l/WIuQ2Q9x+pTeOHdwUAhaU7bCXqwPicab3wzin+baAe6avG0+19e3wFFVPqA2Z8+vi6R+edc2U38Y6voiMqi2H4dCn8YvGqtiXy1Sav5znw77uoZRYKjRaaw3Hx6zffhVOYe+ivcO5i3zo1Lx4BkdCSRpu84=" - -matrix: - fast_finish: true - include: - - os: linux - dist: trusty - jdk: oraclejdk11 - - os: osx - osx_image: xcode10.1 - -before_script: - - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then - export DISPLAY=:99.0; - sh -e /etc/init.d/xvfb start; - sleep 3; - fi - - if [ -n "${TRAVIS_TAG}" -a "${TRAVIS_OS_NAME}" = "osx" ]; then - openssl aes-256-cbc -k "$ENC_SECRET" -in app/assets/osx/codesign.cer.enc -out app/assets/osx/codesign.cer -d; - openssl aes-256-cbc -k "$ENC_SECRET" -in app/assets/osx/codesign.p12.enc -out app/assets/osx/codesign.p12 -d; - fi - -script: - - chmod +x .ci/build.sh; - - sh .ci/build.sh; - -deploy: - provider: s3 - access_key_id: $AWS_ACCESS_KEY_ID - secret_access_key: $AWS_SECRET_ACCESS_KEY - bucket: "download.gluonhq.com" - acl: public_read - upload-dir: scenebuilder - local-dir: deployment - skip_cleanup: true - on: - tags: true - repo: gluonhq/scenebuilder - -# deploy with S3 provider faulty sets content-type for rpm files to "audio/x-pn-realaudio-plugin" instead of "application/x-rpm" -after_deploy: - - if [ "${TRAVIS_OS_NAME}" = "linux" ]; then - aws s3 cp --content-type "application/x-rpm" --acl public-read --metadata-directive REPLACE s3://download.gluonhq.com/scenebuilder/$TRAVIS_TAG/install/linux/SceneBuilder-$TRAVIS_TAG.rpm s3://download.gluonhq.com/scenebuilder/$TRAVIS_TAG/install/linux/SceneBuilder-$TRAVIS_TAG.rpm; - fi - diff --git a/LICENSE.txt b/LICENSE.txt index 8672ae870..c246c88cd 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,5 @@ -Copyright (c) 2016, 2018, Gluon and/or its affiliates. +Copyright (c) 2016, 2021, Gluon and/or its affiliates. Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. diff --git a/.github/README.md b/README.md similarity index 100% rename from .github/README.md rename to README.md diff --git a/app/build.gradle b/app/build.gradle index b4e36e7a3..e955d41c9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,10 +2,11 @@ import org.apache.tools.ant.filters.EscapeUnicode plugins { id 'application' - id "com.github.johnrengelman.shadow" version "4.0.3" + id 'com.github.johnrengelman.shadow' version '5.2.0' } mainClassName = 'com.oracle.javafx.scenebuilder.app.SceneBuilderApp' +archivesBaseName = "$rootProject.name" dependencies { implementation project(':kit') @@ -18,9 +19,8 @@ run { } } +jar.enabled = false shadowJar { - baseName = 'scenebuilder' - manifest { attributes 'Main-Class': mainClassName } @@ -44,8 +44,10 @@ processResources { expand([ version: version, javaVersion: System.getProperty('java.runtime.version') + ', ' + System.getProperty('java.vendor'), + javafxVersion: javafx.version, buildDate: buildDate ]) + filteringCharset = 'UTF-8' filter(EscapeUnicode) } into buildDir @@ -82,3 +84,97 @@ uploadArchives { } } +/** + * Tasks related to packaging and releasing of Scene Builder + */ +def fx_jmods = System.getenv('JAVAFX_HOME') +def java_home = System.getenv('JAVA_HOME') +def jpackage_home = System.getenv('JPACKAGE_HOME') + +task jlink(type: Exec) { + dependsOn 'jar' + workingDir 'build' + + doFirst { + if (java_home == null) { + throw new RuntimeException("JAVA_HOME is not defined.") + } + if (fx_jmods == null) { + throw new RuntimeException("JAVAFX_HOME is not defined.") + } + def argsList = [ + '--module-path', "${fx_jmods}", + '--add-modules', 'java.base,java.desktop,java.logging,java.naming,java.prefs,java.security.jgss,java.sql,java.xml,javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web,jdk.unsupported', + '--output', 'runtime', + '--strip-debug', + '--compress', '2', + '--no-header-files', + '--no-man-pages' + ] + executable = "${java_home}/bin/jlink" + args = argsList + } +} + +task jpackage(type: Exec) { + dependsOn 'shadowJar' + workingDir 'build' + def options = [] + doFirst { + if (jpackage_home == null) { + throw new RuntimeException("JPACKAGE_HOME is not defined.") + } + def argsList = [ + '--input', "$buildDir/libs/", + '--main-jar', "${rootProject.name}-${project.version}-all.jar", + '--main-class', "$mainClassName", + '--runtime-image', 'runtime', + '--license-file', '../../LICENSE.txt', + '--name', "$rootProject.name", + '--description', 'Scene Builder', + '--app-version', "$project.version", + '--vendor', 'Gluon', + '--verbose' + ] + def currentOs = org.gradle.internal.os.OperatingSystem.current() + if (currentOs.linux) { + options = [ + '--type', 'deb', + '--java-options', '-Djdk.gtk.version=2 --add-opens javafx.fxml/javafx.fxml=ALL-UNNAMED', + '--icon', '../assets/linux/icon-linux.png', + '--install-dir', '/opt' + ] + } else if (currentOs.macOsX) { + /** + * Needs to paas the following project parameters for signing the package: + * 1. signingPrefix + * 2. signingKeychain + * 3. signingKeyUsername + */ + options = [ + '--type', 'dmg', + '--java-options', '--add-opens javafx.fxml/javafx.fxml=ALL-UNNAMED', + '--icon', '../assets/osx/icon-mac.icns', + '--mac-package-identifier', 'com.gluonhq.scenebuilder', + '--mac-package-name', 'Scene Builder', + '--mac-package-signing-prefix', signingPrefix, + '--mac-signing-key-user-name', signingKeyUsername, + '--mac-sign' + ] + } else { + options = [ + '--type', 'msi', + '--java-options', '--add-opens javafx.fxml/javafx.fxml=ALL-UNNAMED', + '--icon', '../assets/windows/icon-windows.ico', + '--win-dir-chooser', + '--win-menu', + '--win-menu-group', 'Scene Builder', + '--win-per-user-install', + '--win-shortcut' + ] + } + argsList.addAll(options) + args = argsList + } + executable = "${jpackage_home}/bin/jpackage" +} diff --git a/app/src/main/java/com/oracle/javafx/scenebuilder/app/AppPlatform.java b/app/src/main/java/com/oracle/javafx/scenebuilder/app/AppPlatform.java index e399bd6a5..1d56cc57c 100644 --- a/app/src/main/java/com/oracle/javafx/scenebuilder/app/AppPlatform.java +++ b/app/src/main/java/com/oracle/javafx/scenebuilder/app/AppPlatform.java @@ -129,13 +129,19 @@ private static synchronized boolean requestStartGeneric( final boolean result; messageBox = new MessageBox<>(getMessageBoxFolder(), MessageBoxMessage.class, 1000 /* ms */); + // Fix Start: Github Issue #301 + final List parametersUnnamed = new ArrayList<>(parameters.getUnnamed()); + if (IS_MAC) { + parametersUnnamed.removeIf(p -> p.startsWith("-psn")); + } + // Fix End if (messageBox.grab(new MessageBoxDelegate(notificationHandler))) { - notificationHandler.handleLaunch(parameters.getUnnamed()); + notificationHandler.handleLaunch(parametersUnnamed); result = true; } else { result = false; final MessageBoxMessage unamedParameters - = new MessageBoxMessage(parameters.getUnnamed()); + = new MessageBoxMessage(parametersUnnamed); try { messageBox.sendMessage(unamedParameters); } catch(InterruptedException x) { diff --git a/app/src/main/java/com/oracle/javafx/scenebuilder/app/about/AboutWindowController.java b/app/src/main/java/com/oracle/javafx/scenebuilder/app/about/AboutWindowController.java index cdc5838ad..82c64e4c1 100644 --- a/app/src/main/java/com/oracle/javafx/scenebuilder/app/about/AboutWindowController.java +++ b/app/src/main/java/com/oracle/javafx/scenebuilder/app/about/AboutWindowController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 Gluon and/or its affiliates. + * Copyright (c) 2016, 2021, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates, 2015, Gluon. * All rights reserved. Use is subject to license terms. * @@ -61,6 +61,7 @@ public final class AboutWindowController extends AbstractFxmlWindowController { private String sbBuildVersion; private String sbBuildDate; private String sbBuildJavaVersion; + private String sbBuildJavaFXVersion; // The resource bundle contains two keys: about.copyright and about.copyright.open private String sbAboutCopyrightKeyName; // File name must be in sync with what we use in logging.properties (Don't understand this comment, haven't found any logging.properties file @@ -78,6 +79,7 @@ public AboutWindowController() { sbBuildVersion = sbProps.getProperty("build.version", "UNSET"); //NOI18N sbBuildDate = sbProps.getProperty("build.date", "UNSET"); //NOI18N sbBuildJavaVersion = sbProps.getProperty("build.java.version", "UNSET"); //NOI18N + sbBuildJavaFXVersion = sbProps.getProperty("build.javafx.version", "UNSET"); //NOI18N sbAboutCopyrightKeyName = sbProps.getProperty("copyright.key.name", "UNSET"); //NOI18N } } catch (IOException ex) { @@ -123,6 +125,7 @@ private String getAboutText() { StringBuilder text = getVersionParagraph() .append(getBuildInfoParagraph()) .append(getLoggingParagraph()) + .append(getJavaFXParagraph()) .append(getJavaParagraph()) .append(getOsParagraph()) .append(I18N.getString(sbAboutCopyrightKeyName)); @@ -166,6 +169,7 @@ private StringBuilder getBuildInfoParagraph() { StringBuilder sb = new StringBuilder(I18N.getString("about.build.information")); sb.append("\n").append(sbBuildInfo).append("\n") //NOI18N .append(I18N.getString("about.build.date", sbBuildDate)).append("\n") + .append(I18N.getString("about.build.javafx.version", sbBuildJavaFXVersion)).append("\n") .append(I18N.getString("about.build.java.version", sbBuildJavaVersion)) .append("\n\n"); //NOI18N return sb; @@ -180,6 +184,12 @@ private StringBuilder getLoggingParagraph() { .append("\n\n"); //NOI18N return sb; } + + private StringBuilder getJavaFXParagraph() { + StringBuilder sb = new StringBuilder("JavaFX\n"); //NOI18N + sb.append(System.getProperty("javafx.version")).append("\n\n"); //NOI18N + return sb; + } private StringBuilder getJavaParagraph() { StringBuilder sb = new StringBuilder("Java\n"); //NOI18N diff --git a/app/src/main/java/com/oracle/javafx/scenebuilder/app/util/AppSettings.java b/app/src/main/java/com/oracle/javafx/scenebuilder/app/util/AppSettings.java index ed708979c..c22ec3f74 100644 --- a/app/src/main/java/com/oracle/javafx/scenebuilder/app/util/AppSettings.java +++ b/app/src/main/java/com/oracle/javafx/scenebuilder/app/util/AppSettings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 Gluon and/or its affiliates. + * Copyright (c) 2016, 2021, Gluon and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: @@ -58,9 +58,9 @@ public class AppSettings { public static final String LATEST_VERSION_CHECK_URL = "http://download.gluonhq.com/scenebuilder/settings.properties"; public static final String LATEST_VERSION_NUMBER_PROPERTY = "latestversion"; - public static final String LATEST_VERSION_INFORMATION_URL = "http://download.gluonhq.com/scenebuilder/version-8.4.0.json"; + public static final String LATEST_VERSION_INFORMATION_URL = "http://download.gluonhq.com/scenebuilder/version.json"; - public static final String DOWNLOAD_URL = "http://gluonhq.com/labs/scene-builder"; + public static final String DOWNLOAD_URL = "https://gluonhq.com/products/scene-builder/"; private static String sceneBuilderVersion; private static String latestVersion; diff --git a/app/src/main/resources/com/oracle/javafx/scenebuilder/app/about/about.properties b/app/src/main/resources/com/oracle/javafx/scenebuilder/app/about/about.properties index 928fdbeb0..5839932df 100644 --- a/app/src/main/resources/com/oracle/javafx/scenebuilder/app/about/about.properties +++ b/app/src/main/resources/com/oracle/javafx/scenebuilder/app/about/about.properties @@ -32,4 +32,5 @@ build.info=Version ${version} build.version=${version} build.date=${buildDate} build.java.version=${javaVersion} +build.javafx.version=${javafxVersion} copyright.key.name=about.copyright.open diff --git a/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp.properties b/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp.properties index eff825bd2..695a7ef20 100644 --- a/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp.properties +++ b/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp.properties @@ -285,8 +285,9 @@ about.title = About JavaFX Scene Builder about.build.information = Build Information about.build.date = Date: {0} about.build.java.version = Java Version: {0} +about.build.javafx.version = JavaFX Version: {0} about.copyright = Copyright \u00a9 2012, 2014, Oracle and/or its affiliates. All rights reserved.\n\nThis software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.\n\nThe information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.\n\nIf this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:\n\nU.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are \"commercial computer software\" or \"commercial technical data\" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.\n\nThis software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications.\n\nOracle is a registered trademark of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.\n\nThis software and documentation may provide access to or information on content, products, and services from third parties. Oracle and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services. -about.copyright.open = Copyright (c) 2015-2018, Gluon.\nAll rights reserved. Use is subject to license terms.\n\nThis file is available and licensed under the following license:\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n - Neither the name of Gluon nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +about.copyright.open = Copyright (c) 2015-2021, Gluon.\nAll rights reserved. Use is subject to license terms.\n\nThis file is available and licensed under the following license:\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n - Neither the name of Gluon nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Hardware acceleration is a boolean: its value depends on the FX toolkit and pipeline in use. about.fx.hardware.acceleration = Hardware acceleration about.fx.hardware.acceleration.enabled = ENABLED diff --git a/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp_ja.properties b/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp_ja.properties index c664f7716..3e82af7c3 100644 --- a/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp_ja.properties +++ b/app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp_ja.properties @@ -285,8 +285,9 @@ about.title = JavaFX Scene Builderバージョン情報 about.build.information = ビルド情報 about.build.date = 日付: {0} about.build.java.version = Javaバージョン: {0} +about.build.javafx.version = JavaFXバージョン: {0} about.copyright = Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.\n\nこのソフトウェアおよび関連ドキュメントの使用と開示は、ライセンス契約の制約条件に従うものとし、知的財産に関する法律により保護されています。ライセンス契約で明示的に許諾されている場合もしくは法律によって認められている場合を除き、形式、手段に関係なく、いかなる部分も使用、複写、複製、翻訳、放送、修正、ライセンス供与、送信、配布、発表、実行、公開または表示することはできません。このソフトウェアのリバース・エンジニアリング、逆アセンブル、逆コンパイルは互換性のために法律によって規定されている場合を除き、禁止されています。\n\nここに記載された情報は予告なしに変更される場合があります。また、誤りがないことの保証はいたしかねます。\n\n誤りを見つけた場合は、オラクル社までご連絡ください。このソフトウェアまたは関連ドキュメントが、米国政府機関もしくは米国政府機関に代わってこのソフトウェアまたは関連ドキュメントをライセンスされた者に提供される場合は、次のNoticeが適用されます。Government, the following notice is applicable:\n\nU.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.\n\nこのソフトウェアは様々な情報管理アプリケーションでの一般的な使用のために開発されたものです。このソフトウェアは、危険が伴うアプリケーション(人的傷害を発生させる可能性があるアプリケーションを含む)への用途を目的として開発されていません。このソフトウェアを危険が伴うアプリケーションで使用する際、このソフトウェアを安全に使用するために、適切な安全装置、バックアップ、冗長性(redundancy)、その他の対策を講じることは使用者の責任となります。このソフトウェアを危険が伴うアプリケーションで使用したことに起因して損害が発生しても、オラクル社およびその関連会社は一切の責任を負いかねます。\n\nOracleはOracle Corporationおよびその関連企業の登録商標です。その他の名称は、それぞれの所有者の商標または登録商標です。\n\nこのソフトウェアおよびドキュメントは、第三者のコンテンツ、製品、サービスへのアクセス、あるいはそれらに関する情報を提供することがあります。オラクル社およびその関連会社は、第三者のコンテンツ、製品、サービスに関して一切の責任を負わず、いかなる保証もいたしません。オラクル社およびその関連会社は、第三者のコンテンツ、製品、サービスへのアクセスまたは使用によって損失、費用、あるいは損害が発生しても、一切の責任を負いかねます。 -about.copyright.open = Copyright (c) 2015-2017, Gluon.\nAll rights reserved. Use is subject to license terms.\n\nThis file is available and licensed under the following license:\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n - Neither the name of Gluon nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +about.copyright.open = Copyright (c) 2015-2021, Gluon.\nAll rights reserved. Use is subject to license terms.\n\nThis file is available and licensed under the following license:\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n - Neither the name of Gluon nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Hardware acceleration is a boolean: its value depends on the FX toolkit and pipeline in use. about.fx.hardware.acceleration = ハードウェア・アクセラレーション about.fx.hardware.acceleration.enabled = 有効 diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 4d4a97070..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,42 +0,0 @@ -# build version -version: '{build}' - -# environment settings -environment: - enc_secret: - secure: tE+SpkNSSGdCz8/esIC1r6Gw/NQWtdpwvG0TAMiuIrc= - key_secret: - secure: Qv/FKSDp3x4KntE+oVLa4Q== - signtool: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe - matrix: - - JAVA_HOME: C:\Program Files\Java\jdk11 - -# install required tools -install: - - cmd: echo %JAVA_HOME% - - cmd: choco install -y InnoSetup - - ps: iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1')) - - cmd: if NOT "%APPVEYOR_REPO_TAG_NAME%" == "" ( appveyor-tools\secure-file -decrypt app\assets\windows\codesign.p12.enc -secret %enc_secret% ) - - sh: if [ -n "${APPVEYOR_REPO_TAG_NAME}" ]; then ./appveyor-tools/secure-file -decrypt app/assets/windows/codesign.p12.enc -secret $enc_secret; fi - -# build and install artifacts -build_script: - - cmd: .ci\build.bat - -artifacts: - - path: install\windows\SceneBuilder-%APPVEYOR_REPO_TAG_NAME%.exe - name: windows-scenebuilder - -deploy: - - provider: S3 - access_key_id: - secure: rlv2PJSU8m4Wkw7BvwwmhMpTkyiD1I2CKW88HymuXfI= - secret_access_key: - secure: +NCVGlZV3+8RoyGJ8+w5hGmPWk/8NBQU+2t+pnvip5vlaTYZkgEuwhFVnleRzzfr - artifact: windows-scenebuilder - bucket: download.gluonhq.com - region: us-east-1 - folder: scenebuilder/%APPVEYOR_REPO_TAG_NAME% - set_public: true - on: - APPVEYOR_REPO_TAG: true diff --git a/build.gradle b/build.gradle index 7f8fe241e..1a619aab5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,7 @@ plugins { - id 'org.openjfx.javafxplugin' version '0.0.7' apply false + id 'maven' + id 'org.openjfx.javafxplugin' version '0.0.9' apply false + id 'org.beryx.runtime' version '1.11.4' apply false } apply plugin: 'base' @@ -58,6 +60,7 @@ subprojects { } javafx { + version = '16' modules = [ 'javafx.web', 'javafx.fxml', 'javafx.swing', 'javafx.media' ] } @@ -75,8 +78,6 @@ clean { delete "dist" } -apply plugin: 'maven' - uploadArchives { repositories { mavenDeployer { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 558870dad..a4b442974 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/library/ImportWindowController.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/library/ImportWindowController.java index 56885fa97..4140224ac 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/library/ImportWindowController.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/library/ImportWindowController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Gluon and/or its affiliates. + * Copyright (c) 2017, 2020, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -34,6 +34,8 @@ import java.io.File; import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; @@ -47,6 +49,7 @@ import java.util.Set; import java.util.TreeSet; import java.util.concurrent.ExecutionException; +import java.util.logging.Logger; import java.util.stream.Collectors; import com.oracle.javafx.scenebuilder.kit.alert.ImportingGluonControlsAlert; @@ -54,6 +57,7 @@ import com.oracle.javafx.scenebuilder.kit.editor.panel.util.dialog.ErrorDialog; import com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument; import com.oracle.javafx.scenebuilder.kit.i18n.I18N; +import com.oracle.javafx.scenebuilder.kit.library.BuiltinLibrary; import com.oracle.javafx.scenebuilder.kit.library.user.UserLibrary; import com.oracle.javafx.scenebuilder.kit.library.util.FolderExplorer; import com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer; @@ -89,10 +93,12 @@ */ public class ImportWindowController extends AbstractModalDialog { + private static final Logger LOGGER = Logger.getLogger(ImportWindowController.class.getSimpleName()); + public enum PrefSize { DEFAULT, TWO_HUNDRED_BY_ONE_HUNDRED, TWO_HUNDRED_BY_TWO_HUNDRED - }; + } final List importFiles; private final LibraryPanelController libPanelController; @@ -462,7 +468,13 @@ protected List call() throws Exception { boolean importingGluonControls = false; for (JarReport jarReport : jarReportList) { + Path file = jarReport.getJar(); + String jarName = file.getName(file.getNameCount() - 1).toString(); + StringBuilder sb = new StringBuilder( + I18N.getString("log.info.explore." + (Files.isDirectory(file) ? "folder" : "jar") + ".results", jarName)) + .append("\n"); for (JarReportEntry e : jarReport.getEntries()) { + sb.append("> ").append(e.toString()).append("\n"); if ((e.getStatus() == JarReportEntry.Status.OK) && e.isNode()) { boolean checked = true; final String canonicalName = e.getKlass().getCanonicalName(); @@ -483,8 +495,17 @@ protected List call() throws Exception { updateOKButtonTitle(numOfComponentToImport); updateSelectionToggleText(numOfComponentToImport); }); + } else { + if (e.getException() != null) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + e.getException().printStackTrace(pw); + sb.append(">> " + sw.toString()); + } } } + LOGGER.info(sb.toString()); + if (jarReport.hasGluonControls()) { importingGluonControls = true; } @@ -534,7 +555,7 @@ void unsetProcessing() { importList.getSelectionModel().selectedItemProperty().addListener((ChangeListener) (ov, t, t1) -> { previewGroup.getChildren().clear(); - final String fxmlText = JarExplorer.makeFxmlText(t1.getJarReportEntry().getKlass()); + final String fxmlText = BuiltinLibrary.makeFxmlText(t1.getJarReportEntry().getKlass()); try { FXOMDocument fxomDoc = new FXOMDocument(fxmlText, null, importClassLoader, null); zeNode = (Node) fxomDoc.getSceneGraphRoot(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/BuiltinLibrary.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/BuiltinLibrary.java index 4ef5e16c5..19b28bb55 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/BuiltinLibrary.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/BuiltinLibrary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Gluon and/or its affiliates. + * Copyright (c) 2016, 2020, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -97,7 +97,32 @@ public static String getFX8Qualifier() { public static String getEmptyQualifier() { return EMPTY_QUALIFIER; } - + + /** + * Creates the FXML content to import a given class as follows: + *
{@code
+     *      //NOI18N
+     *     
+     *     
+     * }
+ * + * @param componentClass the class + * @return a String with the FXML content + */ + public static String makeFxmlText(Class componentClass) { + final StringBuilder sb = new StringBuilder(); + + sb.append("\n"); //NOI18N + sb.append(""); //NOI18N + sb.append("<"); //NOI18N + sb.append(componentClass.getSimpleName()); + sb.append("/>\n"); //NOI18N + + return sb.toString(); + } + /* * Library */ @@ -382,30 +407,7 @@ private void addItem(String name, String fxmlText, String section, String iconNa } - private static String makeFxmlText(Class componentClass) { - final StringBuilder sb = new StringBuilder(); - - /* - * //NOI18N - * - * - * - * - */ - - sb.append("\n"); //NOI18N - - sb.append(""); //NOI18N - sb.append("<"); //NOI18N - sb.append(componentClass.getSimpleName()); - sb.append("/>\n"); //NOI18N - - return sb.toString(); - } - - private static String makeRegionFxmlText(Class componentClass, + private static String makeRegionFxmlText(Class componentClass, double pw, double ph) { final StringBuilder sb = new StringBuilder(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/user/LibraryFolderWatcher.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/user/LibraryFolderWatcher.java index c3248715c..5322bc441 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/user/LibraryFolderWatcher.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/user/LibraryFolderWatcher.java @@ -443,11 +443,12 @@ private Collection makeLibraryItems(JarReport jarOrFolderReport) th try{ sectionName=jarOrFolderReport.getJar().toFile().getName().replace(".jar", ""); }catch(Exception exception){ - //if getJar returns null or toFile not finding path + //if getJar returns null or toFile not finding path sectionName=UserLibrary.TAG_USER_DEFINED; } final String fxmlText = BuiltinLibrary.makeFxmlText(e.getKlass()); result.add(new LibraryItem(name, sectionName, fxmlText, iconURL, library)); + } } } diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/util/ExplorerBase.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/util/ExplorerBase.java new file mode 100644 index 000000000..6b711d4a4 --- /dev/null +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/util/ExplorerBase.java @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2020, Gluon and/or its affiliates. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. + * All rights reserved. Use is subject to license terms. + * + * This file is available and licensed under the following license: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * - Neither the name of Oracle Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package com.oracle.javafx.scenebuilder.kit.library.util; + +import com.oracle.javafx.scenebuilder.kit.editor.EditorPlatform; +import com.oracle.javafx.scenebuilder.kit.library.BuiltinLibrary; +import javafx.fxml.FXMLLoader; +import javafx.scene.Node; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.lang.reflect.Modifier; +import java.nio.charset.Charset; + +abstract class ExplorerBase { + + static Object instantiateWithFXMLLoader(Class klass, ClassLoader classLoader) throws IOException { + Object result; + + final String fxmlText = BuiltinLibrary.makeFxmlText(klass); + final byte[] fxmlBytes = fxmlText.getBytes(Charset.forName("UTF-8")); //NOI18N + + final FXMLLoader fxmlLoader = new FXMLLoader(); + try { + fxmlLoader.setClassLoader(classLoader); + result = fxmlLoader.load(new ByteArrayInputStream(fxmlBytes)); + } catch(IOException x) { + throw x; + } catch(RuntimeException|Error x) { + throw new IOException(x); + } + + return result; + } + + String makeClassName(String entryName, String separator) { + final String result; + + if (! entryName.endsWith(".class")) { //NOI18N + result = null; + } else if (entryName.contains("$")) { //NOI18N + // We skip inner classes for now + result = null; + } else { + final int endIndex = entryName.length()-6; // ".class" -> 6 //NOI18N + result = entryName.substring(0, endIndex).replace(separator, "."); //NOI18N + } + + return result; + } + + JarReportEntry exploreEntry(String entryName, ClassLoader classLoader, String className) { + JarReportEntry.Status status; + Throwable entryException; + Class entryClass = null; + + // Filtering out what starts with com.javafx. is bound to DTL-6378. + if (className == null || className.startsWith("java.") //NOI18N + || className.startsWith("javax.") || className.startsWith("javafx.") //NOI18N + || className.startsWith("com.oracle.javafx.scenebuilder.") //NOI18N + || className.startsWith("com.javafx.") + || className.startsWith("module-info") + || className.startsWith(EditorPlatform.GLUON_PACKAGE)) { //NOI18N + status = JarReportEntry.Status.IGNORED; + entryClass = null; + entryException = null; + } else { + try { + // Some reading explaining why using Class.forName is not appropriate: + // http://blog.osgi.org/2011/05/what-you-should-know-about-class.html + // http://blog.bjhargrave.com/2007/09/classforname-caches-defined-class-in.html + // http://stackoverflow.com/questions/8100376/class-forname-vs-classloader-loadclass-which-to-use-for-dynamic-loading + entryClass = classLoader.loadClass(className); // Note: static intializers of entryClass are not run, this doesn't seem to be an issue + + if (Modifier.isAbstract(entryClass.getModifiers()) + || !Node.class.isAssignableFrom(entryClass)) { + status = JarReportEntry.Status.IGNORED; + entryClass = null; + entryException = null; + } else { + instantiateWithFXMLLoader(entryClass, classLoader); + status = JarReportEntry.Status.OK; + entryException = null; + } + } catch (RuntimeException | IOException x) { + status = JarReportEntry.Status.CANNOT_INSTANTIATE; + entryException = x; + } catch (Error | ClassNotFoundException x) { + status = JarReportEntry.Status.CANNOT_LOAD; + entryClass = null; + entryException = x; + } + } + + return new JarReportEntry(entryName, status, entryException, entryClass, className); + } +} diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/util/FolderExplorer.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/util/FolderExplorer.java index 5969617b4..ff8f9374c 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/util/FolderExplorer.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/util/FolderExplorer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Gluon and/or its affiliates. + * Copyright (c) 2019, 2020, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -32,22 +32,15 @@ */ package com.oracle.javafx.scenebuilder.kit.library.util; -import java.io.ByteArrayInputStream; +import com.oracle.javafx.scenebuilder.kit.library.util.JarReportEntry.Status; + import java.io.File; import java.io.IOException; -import java.lang.reflect.Modifier; -import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.util.stream.Stream; -import com.oracle.javafx.scenebuilder.kit.editor.EditorPlatform; -import com.oracle.javafx.scenebuilder.kit.library.util.JarReportEntry.Status; - -import javafx.fxml.FXMLLoader; -import javafx.scene.Node; - -public class FolderExplorer { +public class FolderExplorer extends ExplorerBase { private final Path rootFolderPath; @@ -72,125 +65,21 @@ public JarReport explore(ClassLoader classLoader) throws IOException { return result; } - public static String makeFxmlText(Class klass) { - final StringBuilder result = new StringBuilder(); - - /* - * //NOI18N - * - * - * - * - */ - - result.append("\n"); //NOI18N - - result.append(""); //NOI18N - result.append("<"); //NOI18N - result.append(klass.getSimpleName()); - result.append("/>\n"); //NOI18N - - return result.toString(); - } - - - public static Object instantiateWithFXMLLoader(Class klass, ClassLoader classLoader) throws IOException { - Object result; - - final String fxmlText = makeFxmlText(klass); - final byte[] fxmlBytes = fxmlText.getBytes(Charset.forName("UTF-8")); //NOI18N - - final FXMLLoader fxmlLoader = new FXMLLoader(); - try { - fxmlLoader.setClassLoader(classLoader); - result = fxmlLoader.load(new ByteArrayInputStream(fxmlBytes)); - } catch(IOException x) { - throw x; - } catch(RuntimeException|Error x) { - throw new IOException(x); - } - - return result; - } - /* * Private */ private JarReportEntry exploreEntry(Path rootpath, Path path, ClassLoader classLoader) { - JarReportEntry.Status status; - Throwable entryException; - Class entryClass = null; - String className; - File file = path.toFile(); if (file.isDirectory()) { - status = JarReportEntry.Status.IGNORED; - entryClass = null; - entryException = null; - className = null; + return new JarReportEntry(file.getName(), Status.IGNORED, null, null, null); } else { Path relativepath = rootpath.relativize(path); - className = makeClassName(relativepath.toString()); - // Filtering out what starts with com.javafx. is bound to DTL-6378. - if (className == null || className.startsWith("java.") //NOI18N - || className.startsWith("javax.") || className.startsWith("javafx.") //NOI18N - || className.startsWith("com.oracle.javafx.scenebuilder.") //NOI18N - || className.startsWith("com.javafx.") - || className.startsWith(EditorPlatform.GLUON_PACKAGE)) { //NOI18N - status = JarReportEntry.Status.IGNORED; - entryClass = null; - entryException = null; - } else { - try { - // Some reading explaining why using Class.forName is not appropriate: - // http://blog.osgi.org/2011/05/what-you-should-know-about-class.html - // http://blog.bjhargrave.com/2007/09/classforname-caches-defined-class-in.html - // http://stackoverflow.com/questions/8100376/class-forname-vs-classloader-loadclass-which-to-use-for-dynamic-loading - entryClass = classLoader.loadClass(className); // Note: static intializers of entryClass are not run, this doesn't seem to be an issue - - if (Modifier.isAbstract(entryClass.getModifiers()) - || !Node.class.isAssignableFrom(entryClass)) { - status = JarReportEntry.Status.IGNORED; - entryClass = null; - entryException = null; - } else { - instantiateWithFXMLLoader(entryClass, classLoader); - status = JarReportEntry.Status.OK; - entryException = null; - } - } catch (RuntimeException | IOException x) { - status = JarReportEntry.Status.CANNOT_INSTANTIATE; - entryException = x; - } catch (Error | ClassNotFoundException x) { - status = JarReportEntry.Status.CANNOT_LOAD; - entryClass = null; - entryException = x; - } - } + String className = makeClassName(relativepath.toString(), File.separator); + return super.exploreEntry(file.getName(), classLoader, className); } - - return new JarReportEntry(file.getName(), status, entryException, entryClass, className); } - - private String makeClassName(String filename) { - final String result; - - if (filename.endsWith(".class") == false) { //NOI18N - result = null; - } else if (filename.contains("$")) { //NOI18N - // We skip inner classes for now - result = null; - } else { - final int endIndex = filename.length()-6; // ".class" -> 6 //NOI18N - result = filename.substring(0, endIndex).replace(File.separator, "."); //NOI18N - } - - return result; - } } diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/util/JarExplorer.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/util/JarExplorer.java index 123c0a3ff..e4d054f5a 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/util/JarExplorer.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/util/JarExplorer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Gluon and/or its affiliates. + * Copyright (c) 2017, 2020, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -32,26 +32,19 @@ */ package com.oracle.javafx.scenebuilder.kit.library.util; -import java.io.ByteArrayInputStream; +import com.oracle.javafx.scenebuilder.kit.library.util.JarReportEntry.Status; + import java.io.IOException; -import java.lang.reflect.Modifier; -import java.nio.charset.Charset; import java.nio.file.Path; import java.util.Enumeration; import java.util.jar.JarEntry; import java.util.jar.JarFile; -import com.oracle.javafx.scenebuilder.kit.editor.EditorPlatform; -import com.oracle.javafx.scenebuilder.kit.library.util.JarReportEntry.Status; - -import javafx.fxml.FXMLLoader; -import javafx.scene.Node; - /** * * */ -public class JarExplorer { +public class JarExplorer extends ExplorerBase { private final Path jar; @@ -78,121 +71,17 @@ public JarReport explore(ClassLoader classLoader) throws IOException { return result; } - public static String makeFxmlText(Class klass) { - final StringBuilder result = new StringBuilder(); - - /* - * //NOI18N - * - * - * - * - */ - - result.append("\n"); //NOI18N - - result.append(""); //NOI18N - result.append("<"); //NOI18N - result.append(klass.getSimpleName()); - result.append("/>\n"); //NOI18N - - return result.toString(); - } - - - public static Object instantiateWithFXMLLoader(Class klass, ClassLoader classLoader) throws IOException { - Object result; - - final String fxmlText = makeFxmlText(klass); - final byte[] fxmlBytes = fxmlText.getBytes(Charset.forName("UTF-8")); //NOI18N - - final FXMLLoader fxmlLoader = new FXMLLoader(); - try { - fxmlLoader.setClassLoader(classLoader); - result = fxmlLoader.load(new ByteArrayInputStream(fxmlBytes)); - } catch(IOException x) { - throw x; - } catch(RuntimeException|Error x) { - throw new IOException(x); - } - - return result; - } - /* * Private */ private JarReportEntry exploreEntry(JarEntry entry, ClassLoader classLoader) { - JarReportEntry.Status status; - Throwable entryException; - Class entryClass = null; - String className; - if (entry.isDirectory()) { - status = JarReportEntry.Status.IGNORED; - entryClass = null; - entryException = null; - className = null; - } else { - className = makeClassName(entry.getName()); - // Filtering out what starts with com.javafx. is bound to DTL-6378. - if (className == null || className.startsWith("java.") //NOI18N - || className.startsWith("javax.") || className.startsWith("javafx.") //NOI18N - || className.startsWith("com.oracle.javafx.scenebuilder.") //NOI18N - || className.startsWith("com.javafx.") - || className.startsWith(EditorPlatform.GLUON_PACKAGE)) { //NOI18N - status = JarReportEntry.Status.IGNORED; - entryClass = null; - entryException = null; - } else { - try { - // Some reading explaining why using Class.forName is not appropriate: - // http://blog.osgi.org/2011/05/what-you-should-know-about-class.html - // http://blog.bjhargrave.com/2007/09/classforname-caches-defined-class-in.html - // http://stackoverflow.com/questions/8100376/class-forname-vs-classloader-loadclass-which-to-use-for-dynamic-loading - entryClass = classLoader.loadClass(className); // Note: static intializers of entryClass are not run, this doesn't seem to be an issue - - if (Modifier.isAbstract(entryClass.getModifiers()) - || !Node.class.isAssignableFrom(entryClass)) { - status = JarReportEntry.Status.IGNORED; - entryClass = null; - entryException = null; - } else { - instantiateWithFXMLLoader(entryClass, classLoader); - status = JarReportEntry.Status.OK; - entryException = null; - } - } catch (RuntimeException | IOException x) { - status = JarReportEntry.Status.CANNOT_INSTANTIATE; - entryException = x; - } catch (Error | ClassNotFoundException x) { - status = JarReportEntry.Status.CANNOT_LOAD; - entryClass = null; - entryException = x; - } - } - } - - return new JarReportEntry(entry.getName(), status, entryException, entryClass, className); - } - - - private String makeClassName(String entryName) { - final String result; - - if (entryName.endsWith(".class") == false) { //NOI18N - result = null; - } else if (entryName.contains("$")) { //NOI18N - // We skip inner classes for now - result = null; + return new JarReportEntry(entry.getName(), JarReportEntry.Status.IGNORED, null, null, null); } else { - final int endIndex = entryName.length()-6; // ".class" -> 6 //NOI18N - result = entryName.substring(0, endIndex).replace("/", "."); //NOI18N + String className = makeClassName(entry.getName(), "/"); + return super.exploreEntry(entry.getName(), classLoader, className); } - - return result; } + } diff --git a/kit/src/main/resources/com/oracle/javafx/scenebuilder/kit/i18n/SceneBuilderKit.properties b/kit/src/main/resources/com/oracle/javafx/scenebuilder/kit/i18n/SceneBuilderKit.properties index 7790145ab..e84cdb2a2 100644 --- a/kit/src/main/resources/com/oracle/javafx/scenebuilder/kit/i18n/SceneBuilderKit.properties +++ b/kit/src/main/resources/com/oracle/javafx/scenebuilder/kit/i18n/SceneBuilderKit.properties @@ -1,4 +1,4 @@ -# Copyright (c) 2016, 2019, Gluon and/or its affiliates. +# Copyright (c) 2016, 2020, Gluon and/or its affiliates. # Copyright (c) 2012, 2014, Oracle and/or its affiliates. # All rights reserved. Use is subject to license terms. # @@ -71,6 +71,9 @@ label.qualifier.vertical = (vertical) log.info.explore.end = End exploring {0} log.info.explore.folder = Start exploring FOLDER {0} log.info.explore.jar = Start exploring JAR {0} +log.info.explore.jar.results = Results of exploring JAR {0} +log.info.explore.folder.results = Results of exploring FOLDER {0} +log.info.explore.no.results = No custom controls found log.warning.inline.edit.internationalized.strings = Can''t inline edit internationalized strings log.warning.color.creation.error.hexadecimal = Can''t create color for hexadecimal value ''{0}'' log.warning.image.location.does.not.exist = Image ''{0}'' does not exist diff --git a/version.json b/version.json new file mode 100644 index 000000000..66d5a2da8 --- /dev/null +++ b/version.json @@ -0,0 +1,6 @@ +{ + "announcement": { + "url": "https://gluonhq.com/scene-builder-16-release/", + "text": "Scene Builder 16 has been released. Download and install it now, or select 'Learn more' to visit https://gluonhq.com/scene-builder-16-release/ for more information." + } +} \ No newline at end of file