diff --git a/.github/workflows/build-app-as-jar.yml b/.github/workflows/build-app-as-jar.yml new file mode 100644 index 0000000..df8f8c9 --- /dev/null +++ b/.github/workflows/build-app-as-jar.yml @@ -0,0 +1,39 @@ +name: Build-App-Jar +run-name: Building app Jar +on: + push: + tags: + - v** + +jobs: + Build-App-Jar: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v3 + + - name: Set up Maven + uses: stCarolas/setup-maven@v4.5 + with: + maven-version: 3.8.8 + + - name: Install Java + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: '17' + + + # Get project version + - run: echo SHOWLY_DESKTOP_VERSION="$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV + + - run: mvn compile package + + # Upload linux executable to releases + - uses: xresloader/upload-to-github-release@v1.4.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + file: "target/shade/showly-desktop-*" + draft: false + tags: true \ No newline at end of file diff --git a/.github/workflows/build-linux-app.yml b/.github/workflows/build-linux-app.yml deleted file mode 100644 index 6edc126..0000000 --- a/.github/workflows/build-linux-app.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build-Linux-Executable -run-name: Building Linux Executable -on: - push: - tags: - - v** - -jobs: - Build-Linux-Executable: - runs-on: ubuntu-latest - steps: - - - uses: actions/checkout@v3 - - - name: Set up Maven - uses: stCarolas/setup-maven@v4.5 - with: - maven-version: 3.8.8 - - # Installing and setting up GraalVM(gluon) - - run: sudo apt-get update - - run: sudo apt-get install -y wget gcc pkg-config libasound2-dev libavcodec-dev libavformat-dev libavutil-dev libfreetype6-dev libgl-dev libglib2.0-dev libglib2.0-dev libgtk-3-dev libpango1.0-dev libx11-dev libxtst-dev zlib1g-dev libstdc++6 libc++1 libstdc++5 - - run: wget https://github.com/gluonhq/graal/releases/download/gluon-22.1.0.1-Final/graalvm-svm-java17-linux-gluon-22.1.0.1-Final.tar.gz -O graalvm.tar.gz - - run: tar -xzf graalvm.tar.gz - - run: echo GRAALVM_HOME="$(pwd)/graalvm-svm-java17-linux-gluon-22.1.0.1-Final" >> $GITHUB_ENV - - run: echo JAVA_HOME="${GRAALVM_HOME}" >> $GITHUB_ENV - - # Building the project as a native linux app - - run: mvn clean gluonfx:build - - # Get project version - - run: echo SHOWLY_DESKTOP_VERSION="$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV - - # Renaming the executable to have the name and version of the project - - run: mv target/gluonfx/x86_64-linux/desktop ./showly-desktop-${SHOWLY_DESKTOP_VERSION} - - # Upload linux executable to releases - - uses: xresloader/upload-to-github-release@v1.4.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - file: "./showly-desktop-*" - tags: true - draft: true \ No newline at end of file diff --git a/pom.xml b/pom.xml index 58028f9..03e5653 100644 --- a/pom.xml +++ b/pom.xml @@ -1,13 +1,14 @@ - + 4.0.0 io.github.r0land013.showly desktop 1.0.0 UTF-8 - 11 - 11 + 17 + 17 @@ -15,19 +16,27 @@ javafx-controls 21.0.1 - + + + org.openjfx + javafx-graphics + 21.0.1 + linux + + org.openjfx javafx-graphics 21.0.1 + win - + org.openjfx javafx-fxml 21.0.1 - + org.openjfx javafx-swing @@ -40,8 +49,8 @@ 0.2.1 - - + + @@ -71,20 +80,83 @@ 1.0.22 io.github.r0land013.showly.desktop.App - - ${java.home}/lib/static/linux-amd64/glibc/libmlib_image.a - - - https://github.com/R0land013 - ${project.version} - - + maven-resources-plugin 3.0.2 + + org.apache.maven.plugins + maven-jdeps-plugin + 3.1.2 + + + org.apache.maven.plugins + maven-shade-plugin + 3.6.0 + + + package + + shade + + + true + project-classifier + target\shade\showly-desktop-${project.version}.jar + + + io.github.r0land013.showly.desktop.Launcher + + + + + ** + org.openjfx.javafx-controls + + + + + + + + + + linux-build + + + + com.gluonhq + gluonfx-maven-plugin + 1.0.22 + + io.github.r0land013.showly.desktop.App + + ${java.home}/lib/static/linux-amd64/glibc/libmlib_image.a + + + + + + + + windows-build + + + + com.gluonhq + gluonfx-maven-plugin + 1.0.22 + + io.github.r0land013.showly.desktop.App + + + + + + \ No newline at end of file diff --git a/src/main/java/io/github/r0land013/showly/desktop/Launcher.java b/src/main/java/io/github/r0land013/showly/desktop/Launcher.java new file mode 100644 index 0000000..d5cbe06 --- /dev/null +++ b/src/main/java/io/github/r0land013/showly/desktop/Launcher.java @@ -0,0 +1,9 @@ +package io.github.r0land013.showly.desktop; +import io.github.r0land013.showly.desktop.App; + +public class Launcher { + + public static void main(String[] args) { + App.main(args); + } +} diff --git a/src/main/resources/META-INF/native-image/jni-config.json b/src/main/resources/META-INF/native-image/jni-config.json index eaea83d..a3788e5 100644 --- a/src/main/resources/META-INF/native-image/jni-config.json +++ b/src/main/resources/META-INF/native-image/jni-config.json @@ -31,7 +31,11 @@ }, { "name":"com.sun.glass.ui.Cursor", - "fields":[{"name":"ptr"}] + "fields":[{"name":"ptr"}], + "methods":[ + {"name":"getNativeCursor","parameterTypes":[] }, + {"name":"getType","parameterTypes":[] } + ] }, { "name":"com.sun.glass.ui.Pixels", @@ -116,6 +120,105 @@ ], "methods":[{"name":"","parameterTypes":[] }] }, +{ + "name":"com.sun.javafx.font.directwrite.D2D1_COLOR_F", + "fields":[ + {"name":"a"}, + {"name":"b"}, + {"name":"g"}, + {"name":"r"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.D2D1_MATRIX_3X2_F", + "fields":[ + {"name":"_11"}, + {"name":"_12"}, + {"name":"_21"}, + {"name":"_22"}, + {"name":"_31"}, + {"name":"_32"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.D2D1_PIXEL_FORMAT", + "fields":[ + {"name":"alphaMode"}, + {"name":"format"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.D2D1_POINT_2F", + "fields":[ + {"name":"x"}, + {"name":"y"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.D2D1_RENDER_TARGET_PROPERTIES", + "fields":[ + {"name":"dpiX"}, + {"name":"dpiY"}, + {"name":"minLevel"}, + {"name":"pixelFormat"}, + {"name":"type"}, + {"name":"usage"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.DWRITE_GLYPH_METRICS", + "fields":[ + {"name":"advanceHeight"}, + {"name":"advanceWidth"}, + {"name":"bottomSideBearing"}, + {"name":"leftSideBearing"}, + {"name":"rightSideBearing"}, + {"name":"topSideBearing"}, + {"name":"verticalOriginY"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.DWRITE_GLYPH_RUN", + "fields":[ + {"name":"advanceOffset"}, + {"name":"ascenderOffset"}, + {"name":"bidiLevel"}, + {"name":"fontEmSize"}, + {"name":"fontFace"}, + {"name":"glyphAdvances"}, + {"name":"glyphIndices"}, + {"name":"isSideways"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.DWRITE_MATRIX", + "fields":[ + {"name":"dx"}, + {"name":"dy"}, + {"name":"m11"}, + {"name":"m12"}, + {"name":"m21"}, + {"name":"m22"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.RECT", + "fields":[ + {"name":"bottom"}, + {"name":"left"}, + {"name":"right"}, + {"name":"top"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, { "name":"com.sun.javafx.font.freetype.FT_Bitmap", "fields":[ @@ -166,6 +269,23 @@ {"name":"yy"} ] }, +{ + "name":"com.sun.prism.impl.PrismSettings", + "fields":[ + {"name":"disableD3D9Ex"}, + {"name":"forceGPU"}, + {"name":"isVsyncEnabled"}, + {"name":"verbose"} + ] +}, +{ + "name":"java.awt.AWTEvent", + "fields":[ + {"name":"bdata"}, + {"name":"consumed"}, + {"name":"id"} + ] +}, { "name":"java.awt.AlphaComposite", "fields":[ @@ -178,6 +298,51 @@ "fields":[{"name":"value"}], "methods":[{"name":"getRGB","parameterTypes":[] }] }, +{ + "name":"java.awt.Component", + "fields":[ + {"name":"appContext"}, + {"name":"background"}, + {"name":"cursor"}, + {"name":"enabled"}, + {"name":"focusable"}, + {"name":"foreground"}, + {"name":"graphicsConfig"}, + {"name":"height"}, + {"name":"parent"}, + {"name":"peer"}, + {"name":"visible"}, + {"name":"width"}, + {"name":"x"}, + {"name":"y"} + ], + "methods":[ + {"name":"getFont_NoClientCode","parameterTypes":[] }, + {"name":"getLocationOnScreen_NoTreeLock","parameterTypes":[] }, + {"name":"getToolkitImpl","parameterTypes":[] }, + {"name":"isEnabledImpl","parameterTypes":[] } + ] +}, +{ + "name":"java.awt.Dimension", + "fields":[ + {"name":"height"}, + {"name":"width"} + ] +}, +{ + "name":"java.awt.Font", + "fields":[ + {"name":"name"}, + {"name":"pData"}, + {"name":"size"}, + {"name":"style"} + ], + "methods":[ + {"name":"getFont","parameterTypes":["java.lang.String"] }, + {"name":"getFontPeer","parameterTypes":[] } + ] +}, { "name":"java.awt.GraphicsEnvironment", "methods":[ @@ -185,6 +350,23 @@ {"name":"isHeadless","parameterTypes":[] } ] }, +{ + "name":"java.awt.Insets", + "fields":[ + {"name":"bottom"}, + {"name":"left"}, + {"name":"right"}, + {"name":"top"} + ], + "methods":[{"name":"","parameterTypes":["int","int","int","int"] }] +}, +{ + "name":"java.awt.Toolkit", + "methods":[ + {"name":"getDefaultToolkit","parameterTypes":[] }, + {"name":"getFontMetrics","parameterTypes":["java.awt.Font"] } + ] +}, { "name":"java.awt.color.ICC_Profile", "methods":[{"name":"cmmProfile","parameterTypes":[] }] @@ -192,6 +374,20 @@ { "name":"java.awt.color.ICC_ProfileRGB" }, +{ + "name":"java.awt.desktop.UserSessionEvent$Reason", + "fields":[ + {"name":"CONSOLE"}, + {"name":"LOCK"}, + {"name":"REMOTE"}, + {"name":"UNSPECIFIED"} + ] +}, +{ + "name":"java.awt.event.InputEvent", + "fields":[{"name":"modifiers"}], + "methods":[{"name":"getButtonDownMasks","parameterTypes":[] }] +}, { "name":"java.awt.geom.AffineTransform", "fields":[ @@ -275,6 +471,7 @@ "fields":[ {"name":"allgrayopaque"}, {"name":"colorData"}, + {"name":"lookupcache"}, {"name":"map_size"}, {"name":"rgb"}, {"name":"transparent_index"} @@ -319,6 +516,10 @@ "name":"java.lang.Boolean", "methods":[{"name":"getBoolean","parameterTypes":["java.lang.String"] }] }, +{ + "name":"java.lang.Class", + "methods":[{"name":"forName","parameterTypes":["java.lang.String","boolean","java.lang.ClassLoader"] }] +}, { "name":"java.lang.ClassLoader", "methods":[ @@ -338,6 +539,7 @@ "name":"java.lang.String", "methods":[ {"name":"","parameterTypes":["byte[]"] }, + {"name":"concat","parameterTypes":["java.lang.String"] }, {"name":"toLowerCase","parameterTypes":["java.util.Locale"] } ] }, @@ -417,6 +619,13 @@ "name":"org.graalvm.jniutils.JNIExceptionWrapperEntryPoints", "methods":[{"name":"getClassName","parameterTypes":["java.lang.Class"] }] }, +{ + "name":"sun.awt.AWTAutoShutdown", + "methods":[ + {"name":"notifyToolkitThreadBusy","parameterTypes":[] }, + {"name":"notifyToolkitThreadFree","parameterTypes":[] } + ] +}, { "name":"sun.awt.SunHints", "fields":[{"name":"INTVAL_STROKE_PURE"}] @@ -428,9 +637,22 @@ {"name":"awtLockNotify","parameterTypes":[] }, {"name":"awtLockNotifyAll","parameterTypes":[] }, {"name":"awtLockWait","parameterTypes":["long"] }, - {"name":"awtUnlock","parameterTypes":[] } + {"name":"awtUnlock","parameterTypes":[] }, + {"name":"isTouchKeyboardAutoShowEnabled","parameterTypes":[] } ] }, +{ + "name":"sun.awt.Win32GraphicsConfig", + "fields":[{"name":"visual"}] +}, +{ + "name":"sun.awt.Win32GraphicsDevice", + "fields":[{"name":"dynamicColorModel"}] +}, +{ + "name":"sun.awt.Win32GraphicsEnvironment", + "methods":[{"name":"dwmCompositionChanged","parameterTypes":["boolean"] }] +}, { "name":"sun.awt.X11.XErrorHandlerUtil", "methods":[{"name":"init","parameterTypes":["long"] }] @@ -471,6 +693,51 @@ {"name":"type"} ] }, +{ + "name":"sun.awt.image.SunVolatileImage", + "fields":[{"name":"volSurfaceManager"}] +}, +{ + "name":"sun.awt.image.VolatileSurfaceManager", + "fields":[{"name":"sdCurrent"}] +}, +{ + "name":"sun.awt.windows.WComponentPeer", + "fields":[ + {"name":"hwnd"}, + {"name":"winGraphicsConfig"} + ], + "methods":[ + {"name":"disposeLater","parameterTypes":[] }, + {"name":"replaceSurfaceData","parameterTypes":[] }, + {"name":"replaceSurfaceDataLater","parameterTypes":[] } + ] +}, +{ + "name":"sun.awt.windows.WDesktopPeer", + "methods":[ + {"name":"systemSleepCallback","parameterTypes":["boolean"] }, + {"name":"userSessionCallback","parameterTypes":["boolean","java.awt.desktop.UserSessionEvent$Reason"] } + ] +}, +{ + "name":"sun.awt.windows.WObjectPeer", + "fields":[ + {"name":"createError"}, + {"name":"destroyed"}, + {"name":"pData"}, + {"name":"target"} + ], + "methods":[{"name":"getPeerForTarget","parameterTypes":["java.lang.Object"] }] +}, +{ + "name":"sun.awt.windows.WToolkit", + "methods":[ + {"name":"displayChanged","parameterTypes":[] }, + {"name":"paletteChanged","parameterTypes":[] }, + {"name":"windowsSettingChange","parameterTypes":[] } + ] +}, { "name":"sun.font.CharToGlyphMapper", "methods":[{"name":"charToGlyph","parameterTypes":["int"] }] @@ -775,6 +1042,15 @@ "name":"sun.java2d.pipe.ShapeSpanIterator", "fields":[{"name":"pData"}] }, +{ + "name":"sun.java2d.windows.WindowsFlags", + "fields":[ + {"name":"d3dEnabled"}, + {"name":"d3dSet"}, + {"name":"offscreenSharingEnabled"}, + {"name":"setHighDPIAware"} + ] +}, { "name":"sun.java2d.xr.XRSurfaceData", "fields":[ diff --git a/src/main/resources/META-INF/native-image/reflect-config.json b/src/main/resources/META-INF/native-image/reflect-config.json index 3e24d9b..5ac5835 100644 --- a/src/main/resources/META-INF/native-image/reflect-config.json +++ b/src/main/resources/META-INF/native-image/reflect-config.json @@ -1,4 +1,11 @@ [ +{ + "name":"com.sun.glass.ui.Screen" +}, +{ + "name":"com.sun.javafx.font.directwrite.DWFactory", + "methods":[{"name":"getFactory","parameterTypes":[] }] +}, { "name":"com.sun.javafx.font.freetype.FTFactory", "methods":[{"name":"getFactory","parameterTypes":[] }] @@ -507,6 +514,10 @@ { "name":"org.slf4j.spi.SLF4JServiceProvider" }, +{ + "name":"sun.awt.Win32FontManager", + "methods":[{"name":"","parameterTypes":[] }] +}, { "name":"sun.awt.X11FontManager", "methods":[{"name":"","parameterTypes":[] }] @@ -555,6 +566,10 @@ "name":"sun.misc.Unsafe", "fields":[{"name":"theUnsafe"}] }, +{ + "name":"sun.security.provider.DRBG", + "methods":[{"name":"","parameterTypes":["java.security.SecureRandomParameters"] }] +}, { "name":"sun.security.provider.MD5", "methods":[{"name":"","parameterTypes":[] }] @@ -566,5 +581,9 @@ { "name":"sun.security.provider.SHA", "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"sun.security.provider.SHA2$SHA256", + "methods":[{"name":"","parameterTypes":[] }] } ] diff --git a/src/main/resources/META-INF/native-image/resource-config.json b/src/main/resources/META-INF/native-image/resource-config.json index 4d69657..6e88c58 100644 --- a/src/main/resources/META-INF/native-image/resource-config.json +++ b/src/main/resources/META-INF/native-image/resource-config.json @@ -61,13 +61,22 @@ "name":"com.sun.javafx.tk.quantum.QuantumMessagesBundle", "locales":[ "", + "es", "und" ] }, + { + "name":"com/sun/glass/ui/win/themes", + "locales":[ + "", + "es" + ] + }, { "name":"com/sun/javafx/scene/control/skin/resources/controls", "locales":[ "", + "es", "und" ] }, @@ -82,6 +91,7 @@ "name":"jakarta.servlet.http.LocalStrings", "locales":[ "", + "es", "und" ] },