Skip to content

Commit

Permalink
Use Gradle's variant-aware dependency management and allow using Grad…
Browse files Browse the repository at this point in the history
…le's built-in Java Module System support (#151)

* Update Gradle version to latest (8.3)

* Update to latest plugins and Gradle syntax/features

* Extend test coverage / test multiple Gradle version

* Use variants to select JavaFX platform Jars in the dependency graph

- Metadata Rule (metadata could later be published by JavaFX)
- Transitive dependencies no longer need to be maintained in the plugin
- Empty Jars are no longer on the classpath
- Manual classpath and module path modification limited to minimum
- No hard dependency on 'org.javamodularity:moduleplugin' anymore
  - Users can then choose between Gradle's built in Modul System
    support or the javamodularity plugin
- Dependency declaration done lazily (via withDependencies)

* Declare dependencies for dependent modules in case of of local SDK

* Reformat code
  • Loading branch information
jjohannes authored Sep 2, 2023
1 parent 3f97f1e commit f0a8d4c
Show file tree
Hide file tree
Showing 36 changed files with 1,243 additions and 532 deletions.
66 changes: 22 additions & 44 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,42 +1,30 @@
plugins {
id 'com.gradle.build-scan' version '2.1'
id 'java-gradle-plugin'
id 'com.github.hierynomus.license' version '0.15.0'
id 'com.gradle.plugin-publish' version '0.12.0'
id 'com.github.ben-manes.versions' version '0.20.0'
id 'maven-publish'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'com.github.ben-manes.versions' version '0.47.0'
id 'com.github.hierynomus.license' version '0.16.1'
}

buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}

group 'org.openjfx'
version '0.0.15-SNAPSHOT'
group = 'org.openjfx'
version = '0.0.15-SNAPSHOT'

sourceCompatibility = 11
targetCompatibility = 11
java {
toolchain.languageVersion = JavaLanguageVersion.of(11)
}

repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
gradlePluginPortal()
}

dependencies {
implementation gradleApi()

implementation 'com.google.gradle:osdetector-gradle-plugin:1.7.3'
implementation 'org.javamodularity:moduleplugin:1.8.12'

testImplementation gradleTestKit()
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

test {
tasks.named('test', Test) {
useJUnitPlatform()
}

Expand All @@ -47,34 +35,24 @@ gradlePlugin {
displayName = 'JavaFX Gradle Plugin'
description = 'Plugin that makes it easy to work with JavaFX'
implementationClass = 'org.openjfx.gradle.JavaFXPlugin'
website = 'https://github.com/openjfx/javafx-gradle-plugin'
vcsUrl = 'https://github.com/openjfx/javafx-gradle-plugin'
tags.set(['java', 'javafx'])
}
}
}

pluginBundle {
website = 'https://github.com/openjfx/javafx-gradle-plugin'
vcsUrl = 'https://github.com/openjfx/javafx-gradle-plugin'
tags = [ 'java', 'javafx' ]
}

publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = 'javafx-gradle-plugin'
version = project.version

from components.java
}
}
repositories {
maven {
if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) {
url = "https://oss.sonatype.org/content/repositories/snapshots/"
def sonatypeUsername = providers.gradleProperty('sonatypeUsername')
def sonatypePassword = providers.gradleProperty('sonatypePassword')
if (sonatypeUsername.isPresent() && sonatypePassword.isPresent()) {
credentials {
username project.property('sonatypeUsername')
password project.property('sonatypePassword')
username = sonatypeUsername.get()
password = sonatypePassword.get()
}
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Tue Nov 13 11:59:28 CET 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
Loading

0 comments on commit f0a8d4c

Please sign in to comment.