Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
charneykaye committed Aug 16, 2023
2 parents 9be72a3 + cc667c6 commit 98bf654
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
# JavaCV + JavaFX + Spring Boot + jlink/jpackage + Gradle + GitHub Actions

Based on a real project we're working on, this is a minimal example of how to build a JavaFX application with JavaCV, and package it as a native application using jlink/jpackage.

## Stackoverflow

**How to Gradle load JavaCV binaries only for current platform?**
https://stackoverflow.com/questions/76908209/how-to-gradle-load-javacv-binaries-only-for-current-platform
30 changes: 11 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,14 @@ repositories {
}

javafx {
version = "${rootProject.ext.javaFxVersion}"
version = javaFxVersion
modules = ['javafx.base', 'javafx.controls', 'javafx.fxml', 'javafx.graphics']
}

//noinspection GroovyAssignabilityCheck
ext.os = org.gradle.internal.os.OperatingSystem.current() as org.gradle.internal.os.OperatingSystem

jlink {
// imageZip = file("$buildDir/image-zip/javacv-example.zip")
// options = ['--bind-services', '--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
addExtraDependencies 'javafx'

forceMerge('log4j-api')
Expand All @@ -72,34 +70,28 @@ jlink {
noConsole = true
}
jpackage {
if (os.windows) {
// installerOptions = ['--win-per-user-install', '--win-dir-chooser', '--win-menu']
}
}
}

dependencies {

implementation 'org.apache.logging.log4j:log4j-core:2.17.1'
implementation 'io.projectreactor.tools:blockhound:1.0.6.RELEASE'
implementation "ch.qos.logback:logback-classic:${rootProject.ext.logbackVersion}"
implementation "ch.qos.logback:logback-core:${rootProject.ext.logbackVersion}"
implementation "org.openjfx:javafx-base:${rootProject.ext.javaFxVersion}"
implementation "org.openjfx:javafx-controls:${rootProject.ext.javaFxVersion}"
implementation "org.openjfx:javafx-fxml:${rootProject.ext.javaFxVersion}"
implementation "org.openjfx:javafx-graphics:${rootProject.ext.javaFxVersion}"
implementation "org.springframework.boot:spring-boot-starter-logging:${rootProject.ext.springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter:${rootProject.ext.springBootVersion}"
implementation "ch.qos.logback:logback-classic:${logbackVersion}"
implementation "ch.qos.logback:logback-core:${logbackVersion}"
implementation "org.openjfx:javafx-base:${javaFxVersion}"
implementation "org.openjfx:javafx-controls:${javaFxVersion}"
implementation "org.openjfx:javafx-fxml:${javaFxVersion}"
implementation "org.openjfx:javafx-graphics:${javaFxVersion}"
implementation "org.springframework.boot:spring-boot-starter-logging:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter:${springBootVersion}"
implementation 'commons-codec:commons-codec:1.15'
implementation 'commons-io:commons-io:2.11.0'
implementation 'org.bytedeco:ffmpeg-platform-gpl:6.0-1.5.9' // Optional GPL builds with (almost) everything enabled
implementation 'org.bytedeco:flandmark-platform:1.07-1.5.8' // Required by org.bytedeco.javacv
implementation 'org.bytedeco:javacv-platform:1.5.9'
implementation 'org.reflections:reflections:0.10.2'
testImplementation "org.junit.jupiter:junit-jupiter-api:${rootProject.ext.junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
testImplementation 'org.hamcrest:hamcrest-library:2.2'
testImplementation 'org.mockito:mockito-junit-jupiter'
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${rootProject.ext.junitVersion}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
}

//noinspection ConfigurationAvoidance
Expand Down

0 comments on commit 98bf654

Please sign in to comment.