Desktop builds. #1

Merged
nellemann merged 11 commits from desktop into main 2023-08-14 17:40:48 +00:00
7 changed files with 110 additions and 98 deletions
Showing only changes of commit ff68f18ac3 - Show all commits

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
.git
.gradle

44
.drone.yml Normal file
View file

@ -0,0 +1,44 @@
---
kind: pipeline
name: default
type: docker
#platform:
# os: linux
# arch: amd64
steps:
- name: test
image: docker.io/bellsoft/liberica-openjdk-debian:17
commands:
- ./gradlew --quiet --no-daemon test
- name: build-deb
image: docker.io/debian:stable
environment:
AUTH_TOKEN: # Gitea access token ENV variable
from_secret: AUTH_TOKEN # Name of DroneCI secret exposed above
commands:
- apt-get install -y dpkg-dev unzip zip curl
- ./gradlew --quiet --no-daemon build jpackage
- for file in build/jpackage/*.{rpm,deb} ; do curl -s --user "$${AUTH_TOKEN}" --upload-file "$${file}" "https://git.data.coop/api/packages/${DRONE_REPO_OWNER}/generic/${DRONE_REPO_NAME}/${DRONE_TAG}/$(basename $file)" ; done
when:
event:
- tag
- name: build-rpm
image: docker.io/almalinux:8
environment:
AUTH_TOKEN: # Gitea access token ENV variable
from_secret: AUTH_TOKEN # Name of DroneCI secret exposed above
commands:
- dnf -y install unzip zip rpm-build
- ./gradlew --quiet --no-daemon build jpackage
- for file in build/jpackage/*.{rpm,deb} ; do curl -s --user "$${AUTH_TOKEN}" --upload-file "$${file}" "https://git.data.coop/api/packages/${DRONE_REPO_OWNER}/generic/${DRONE_REPO_NAME}/${DRONE_TAG}/$(basename $file)" ; done
when:
event:
- tag

View file

@ -1,96 +1,34 @@
# mDNS Explorer # mDNS Explorer
View all multicastDNS devices. View all multicastDNS devices on your local network.
## Development ## Development
Java SDK version 17 (or later) is required. Java SDK version 17 (or later) is required.
## Native Images Information on how to build and package jftpd:
The native images are built with GraalVM.
Download the Gluon version of GraalVM from https://github.com/gluonhq/graal/releases/tag/gluon-22.1.0.1-Final and extract it locally.
Point the GRAALVM_HOME environment variable to the folder:
```export GRAALVM_HOME="/path/to/gluon-22.1.0.1```
With all requirements setup and on a supported platform, the general idea is to run:
```shell ```shell
./gradlew clean build ./gradlew build jpackage
./gradlew nativeBuild -Ptarget=android # or -Ptarget=ios
./gradlew nativeLink -Ptarget=android
./gradlew nativePackage -Ptarget=android
./gradlew nativeInstall -Ptarget=android
./gradlew nativeRun -Ptarget=android
``` ```
or, in one go for Android: ### Windows
```shell Download and install
./gradlew -Ptarget=android clean build nativeBuild nativeLink nativePackage nativeInstall nativeRun - Microsoft .NET Framework 3.5
``` - Wix Toolset 3.11.2 (or later)
or, in one go for iOS:
```shell
./gradlew -Ptarget=ios clean build nativeBuild nativeLink nativePackage nativeInstall nativeRun
```
### Linux ### Linux
See https://docs.gluonhq.com/#prerequisites_linux TODO
For nativeBuild on Linux, install the following dependencies. docker build . -f docker/Dockerfile.rpm-txt
```shell or
sudo apt install libgtk-3-dev libavformat-dev libavutil-dev libavcodec-dev libasound2-dev libpango1.0-dev libxtst-dev build-essential
```
#### Building for Android (on Linux) docker build . -f docker/Dockerfile.deb-txt
See https://docs.gluonhq.com/#prerequisites_android
Install Android Studio and use sdkmanager to install the following:
- Android SDK Platform 31
- NDK (Side by side)
Point the ANDROID_NDK variable to the installed NDK directory:
```
export ANDROID_NDK="/home/mark/Android/Sdk/ndk/25.2.9519653/"
```
Add the platform-tools to you PATH to use 'adb' command:
```
export PATH="$PATH:/home/mark/Android/Sdk/platform-tools/"
```
Run the 'adb devices' and 'adb usb' to verify your Android networkService is in development mode and allows connections.
### MacOS ### MacOS
See https://docs.gluonhq.com/#platforms_macos TODO
Install the xcode command line tools and an iPhone emulator.
If you have problems with *xcrun* not being able to find *iphoneos*, try:
```shell
sudo xcode-select --switch /Applications/Xcode.app
```
Download and install homebrew, and install the following:
```shell
brew install maven
brew install --HEAD libusbmuxd
brew install --HEAD libimobiledevice
```
#### iOS (on MacOS)
See https://docs.gluonhq.com/#prerequisites_ios

View file

@ -1,4 +1,6 @@
plugins { plugins {
id 'java'
id 'groovy'
id 'application' id 'application'
id 'org.openjfx.javafxplugin' version '0.0.14' id 'org.openjfx.javafxplugin' version '0.0.14'
id 'com.google.osdetector' version '1.7.3' id 'com.google.osdetector' version '1.7.3'
@ -14,19 +16,17 @@ import org.apache.tools.ant.filters.ReplaceTokens
repositories { repositories {
mavenCentral() mavenCentral()
mavenLocal() mavenLocal()
maven {
url 'https://nexus.gluonhq.com/nexus/content/repositories/releases'
}
} }
version = "0.0.1"
mainClassName = "biz.nellemann.mdexpl.App"
application.mainModule = "biz.nellemann.mdexpl"
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
} }
application {
mainModule = 'biz.nellemann.mdexpl'
mainClass = 'biz.nellemann.mdexpl.App'
}
java { java {
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17
@ -106,21 +106,6 @@ gluonfx {
}*/ }*/
/*
shadowJar {
//archiveBaseName.set("vtd-poc-app")
//archiveClassifier.set('all')
archiveVersion.set("${System.env.BITBUCKET_BRANCH ?: 'dev' }")
}*/
//tasks.build.dependsOn tasks.shadowJar
tasks.processResources {
filesMatching('**/configuration.properties') {
filter(ReplaceTokens, tokens: [copyright: '2023', version: System.env.BITBUCKET_BUILD_NUMBER ?: 'development' ])
}
}
jlink { jlink {
forceMerge 'slf4j' forceMerge 'slf4j'
@ -179,21 +164,37 @@ jlink {
] ]
if (osdetector.release.isLike('debian')) { if (osdetector.release.isLike('debian')) {
// Requires 'dpkg-dev' installed
installerType = 'deb' installerType = 'deb'
skipInstaller = false skipInstaller = false
installerOptions += [ installerOptions += [
'--linux-deb-maintainer', 'mark.nellemann@gmail.com' '--linux-deb-maintainer', 'mark.nellemann@gmail.com'
] ]
} else if (osdetector.release.isLike('centos')) { } else if (osdetector.release.isLike('centos') or osdetector.release.isLike('suse')) {
// Requires 'rpm-build' installed
installerType = 'rpm' installerType = 'rpm'
skipInstaller = false skipInstaller = false
installerOptions += [ installerOptions += [
'--linux-rpm-license-type', 'APACHE-20' '--linux-rpm-license-type', 'APACHE-20'
] ]
} }
} }
} }
} }
/*
shadowJar {
//archiveBaseName.set("vtd-poc-app")
//archiveClassifier.set('all')
archiveVersion.set("${System.env.BITBUCKET_BRANCH ?: 'dev' }")
}*/
//tasks.build.dependsOn tasks.shadowJar
tasks.processResources {
filesMatching('**/configuration.properties') {
filter(ReplaceTokens, tokens: [copyright: '2023', version: System.env.BITBUCKET_BUILD_NUMBER ?: 'development' ])
}
}

12
docker/Dockerfile.deb-txt Normal file
View file

@ -0,0 +1,12 @@
FROM docker.io/debian:stable AS build
RUN apt-get update && apt-get install -y unzip zip curl dpkg-dev
RUN bash -c "curl -s 'https://get.sdkman.io' | bash"
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk install java 17.0.8-zulu"
COPY ./src /tmp/prj/src
COPY ./gradle /tmp/prj/gradle
COPY [ "gradlew", "build.gradle", "gradle.properties", "settings.gradle", "/tmp/prj/" ]
WORKDIR /tmp/prj
RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && ./gradlew --no-daemon clean build jpackage"

14
docker/Dockerfile.rpm-txt Normal file
View file

@ -0,0 +1,14 @@
FROM docker.io/almalinux:8 AS build
RUN dnf -y install unzip zip rpm-build
RUN sh -c "curl -s 'https://get.sdkman.io' | bash"
RUN sh -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk install java 17.0.8-zulu"
COPY ./src /tmp/prj/src
COPY ./gradle /tmp/prj/gradle
COPY [ "gradlew", "build.gradle", "gradle.properties", "settings.gradle", "/tmp/prj/" ]
WORKDIR /tmp/prj
RUN sh -c "source $HOME/.sdkman/bin/sdkman-init.sh && ./gradlew --no-daemon clean build jpackage"
COPY --from=build build/jpackage/* build/

1
gradle.properties Normal file
View file

@ -0,0 +1 @@
version = 0.0.1