Skip to content

Commit

Permalink
downgraded java version & changed pom.xml (for flatpak)
Browse files Browse the repository at this point in the history
  • Loading branch information
DBChoco committed May 19, 2022
1 parent c153bf1 commit 26e4593
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 18 deletions.
11 changes: 11 additions & 0 deletions Salawat.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Desktop Entry]
Categories=Utility;Eduction;
Exec=salawat
GenericName=Prayer times (adhan) app
Icon=io.github.dbchoco.Salawat
Keywords=athan;azan;adhan;islam;prayer;
Name=Salawat
StartupNotify=true
StartupWMClass=salawat
Terminal=false
Type=Application
45 changes: 40 additions & 5 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>io.github.dbchoco</groupId>
<artifactId>Salawat</artifactId>
<name>Salawat</name>
<version>1.0</version>
<version>1.0.0</version>
<description>Prayer times (Adhan) app that is higly customizable and light weight.
Available for Windows and GNU/Linux.</description>
<organization>
Expand All @@ -17,8 +17,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.9.0</version>
<configuration>
<source>18</source>
<target>18</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -71,13 +71,14 @@
</goals>
<configuration>
<mainClass>io.github.dbchoco.Salawat.FakeMain</mainClass>
<bundleJre>false</bundleJre>
<copyDependencies>false</copyDependencies>
<bundleJre>true</bundleJre>
<copyDependencies>true</copyDependencies>
<runnableJar>${project.build.directory}/${project.artifactId}-${project.version}.jar</runnableJar>
<generateInstaller>true</generateInstaller>
<administratorRequired>false</administratorRequired>
<createTarball>true</createTarball>
<platform>auto</platform>
<additionalResources>Salawat.desktop</additionalResources>
<linuxConfig>
<pngFile>src/main/resources/io/github/dbchoco/Salawat/images/icon.png</pngFile>
</linuxConfig>
Expand Down Expand Up @@ -107,6 +108,40 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>flatpak</id>
<build>
<plugins>
<plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.6.6</version>
<executions>
<execution>
<configuration>
<mainClass>io.github.dbchoco.Salawat.FakeMain</mainClass>
<bundleJre>true</bundleJre>
<copyDependencies>true</copyDependencies>
<runnableJar>${project.build.directory}/${project.artifactId}-${project.version}.jar</runnableJar>
<generateInstaller>true</generateInstaller>
<administratorRequired>false</administratorRequired>
<createTarball>true</createTarball>
<platform>auto</platform>
<additionalResources>Salawat.desktop</additionalResources>
<linuxConfig>
<pngFile>src/main/resources/io/github/dbchoco/Salawat/images/icon.png</pngFile>
<generateDeb>false</generateDeb>
<generateRpm>false</generateRpm>
</linuxConfig>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
2 changes: 2 additions & 0 deletions flathub/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.flatpak-builder
dist
37 changes: 30 additions & 7 deletions flathub/io.github.dbchoco.Salawat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,55 @@ app-id: io.github.dbchoco.Salawat
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.openjdk17
command: salawat
separate-locales: false
finish-args:
- --share=ipc
- --socket=x11
- --socket=pulseaudio
- --share=network
- --env=PATH=/app/jre/bin:/app/bin:/usr/bin
- --env=JAVA_HOME=/app/jre

modules:
- name: salawat
buildsystem: simple
build-options:
env:
PATH: /app/bin:/usr/bin:/usr/lib/sdk/openjdk17/bin
MAVEN_OPTS: -Dmaven.repo.local=.m2/repository
JAVA_HOME: /usr/lib/sdk/openjdk17/jvm/openjdk-17
build-commands:
- install --directory --mode=0755 /app/salawat
- install -Dm644 --target-directory=/app/salawat/ Salawat/*
- cp -r Salawat/* /app/salawat/
- install -Dm755 salawat.sh /app/bin/salawat
- ls Salawat/
- install -Dm644 Salawat/icon.png /app/share/icons/hicolor/128x128/apps/$FLATPAK_ID.png
- install -Dm644 Salawat/icon.png /app/share/icons/hicolor/512x512/apps/$FLATPAK_ID.png
- install -Dm644 Salawat/Salawat.desktop /app/share/applications/${FLATPAK_ID}.desktop
- install -Dm644 io.github.dbchoco.Salawat.metainfo.xml /app/share/metainfo/$FLATPAK_ID.appdata.xml
- install -Dm644 io.github.dbchoco.Salawat.metainfo.xml /app/share/metainfo/$FLATPAK_ID.metainfo.xml

- mvn clean package -DpackagingPhase=none
- install -Dm755 -t "${FLATPAK_DEST}/bin" "es.estoes.wallpaperDownloader.sh"
- install -Dm644 -t "${FLATPAK_DEST}/share/es.estoes.wallpaperDownloader" "target/wallpaperdownloader.jar"
- install -Dm644 "deb/wallpaperdownloader.desktop" "${FLATPAK_DEST}/share/applications/es.estoes.wallpaperDownloader.desktop"
- install -Dm644 "deb/wallpaperdownloader.svg" "${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/es.estoes.wallpaperDownloader.svg"
- install -Dm644 -t "${FLATPAK_DEST}/share/metainfo" "es.estoes.wallpaperDownloader.metainfo.xml"
- desktop-file-edit --remove-key=Version "${FLATPAK_DEST}/share/applications/es.estoes.wallpaperDownloader.desktop"
- desktop-file-edit --set-key=Exec --set-value="${FLATPAK_DEST}/bin/es.estoes.wallpaperDownloader.sh" "${FLATPAK_DEST}/share/applications/es.estoes.wallpaperDownloader.desktop"
- desktop-file-edit --set-icon=es.estoes.wallpaperDownloader "${FLATPAK_DEST}/share/applications/es.estoes.wallpaperDownloader.desktop"
sources:
- type: archive
url: https://github.com/DBChoco/Salawat/releases/download/v1.0.0/Salawat-1.0-linux.tar.gz
sha256: 59820046b3f3acd6aaefb6080c7c7e078fc8777d508022d6004d66cb2ac975fb
url: https://github.com/DBChoco/Salawat/releases/download/v1.0.0/Salawat-1.0.0-linux.tar.gz
sha256: 1fcc9201e9456e55a5cb40d53cad7aca4dd52784334ac1e912a75193ee9f09c9
dest: Salawat
- type: file
path: io.github.dbchoco.Salawat.metainfo.xml
- type: file
path: salawat.sh

- maven-dependencies.yaml
modules:
- name: openjdk
buildsystem: simple
build-commands:
- /usr/lib/sdk/openjdk17/install.sh
49 changes: 43 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.dbchoco</groupId>
<artifactId>Salawat</artifactId>
<version>1.0</version>
<version>1.0.0</version>
<name>Salawat</name>
<description>Prayer times (Adhan) app that is higly customizable and light weight.
Available for Windows and GNU/Linux.</description>
Expand Down Expand Up @@ -79,8 +79,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.9.0</version>
<configuration>
<source>18</source>
<target>18</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -140,13 +140,14 @@
<!-- mandatory -->
<mainClass>io.github.dbchoco.Salawat.FakeMain</mainClass>
<!-- optional -->
<bundleJre>false</bundleJre>
<copyDependencies>false</copyDependencies>
<bundleJre>true</bundleJre>
<copyDependencies>true</copyDependencies>
<runnableJar>${project.build.directory}/${project.artifactId}-${project.version}.jar</runnableJar>
<generateInstaller>true</generateInstaller>
<administratorRequired>false</administratorRequired>
<createTarball>true</createTarball>
<platform>auto</platform>
<additionalResources>Salawat.desktop</additionalResources>

<linuxConfig>
<pngFile>src/main/resources/io/github/dbchoco/Salawat/images/icon.png</pngFile>
Expand Down Expand Up @@ -184,7 +185,43 @@
</execution>
</executions>
</plugin>

</plugins>
</build>
<profiles>
<profile>
<id>flatpak</id>
<build>
<plugins>
<plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.6.6</version>
<executions>
<execution>
<configuration>
<!-- mandatory -->
<mainClass>io.github.dbchoco.Salawat.FakeMain</mainClass>
<!-- optional -->
<bundleJre>true</bundleJre>
<copyDependencies>true</copyDependencies>
<runnableJar>${project.build.directory}/${project.artifactId}-${project.version}.jar</runnableJar>
<generateInstaller>true</generateInstaller>
<administratorRequired>false</administratorRequired>
<createTarball>false</createTarball>
<platform>auto</platform>
<additionalResources>Salawat.desktop</additionalResources>
<linuxConfig>
<pngFile>src/main/resources/io/github/dbchoco/Salawat/images/icon.png</pngFile>
<generateDeb>false</generateDeb>
<generateRpm>false</generateRpm>
</linuxConfig>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- https://github.com/fvarrui/JavaPackager -->
</profile>
</profiles>
</project>

0 comments on commit 26e4593

Please sign in to comment.