Skip to content

Commit

Permalink
Fixed a problem in older versions og Gradle when not specifying a Jav…
Browse files Browse the repository at this point in the history
…a toolchain
  • Loading branch information
bjornvester committed Jun 20, 2023
1 parent 6c9b08d commit 5c12566
Show file tree
Hide file tree
Showing 11 changed files with 672 additions and 685 deletions.
779 changes: 401 additions & 378 deletions README.md

Large diffs are not rendered by default.

125 changes: 60 additions & 65 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,65 +1,60 @@
plugins {
`kotlin-dsl`
id("java-gradle-plugin")
id("com.gradle.plugin-publish") version "1.2.0"
}

group = "com.github.bjornvester"
version = "2.0"

repositories {
mavenCentral()
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}

// The integration test folder is an input to the unit test in the root project
// Register these files as inputs
tasks.withType<Test>().configureEach {
inputs
.files(layout.projectDirectory.dir("integration-test").asFileTree.matching {
exclude("**/build/**")
exclude("**/gradle/**")
})
.withPathSensitivity(PathSensitivity.RELATIVE)
useJUnitPlatform()
systemProperty("GRADLE_ROOT_FOLDER", projectDir.absolutePath)
systemProperty("GRADLE_PLUGIN_VERSION", version)
}

tasks.withType<Wrapper> {
gradleVersion = "latest"
}

dependencies {
compileOnly("org.apache.cxf:cxf-tools-wsdlto-core:4.0.2")
testImplementation("commons-io:commons-io:2.13.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}

gradlePlugin {
website.set("https://github.com/bjornvester/wsdl2java-gradle-plugin")
vcsUrl.set("https://github.com/bjornvester/wsdl2java-gradle-plugin")
plugins {
create("wsdl2JavaPlugin") {
id = "com.github.bjornvester.wsdl2java"
description = """Adds the CXF wsdl2java tool to your project.
|Please see the Github project page for details.""".trimMargin()
displayName = "Gradle Wsdl2Java plugin"
tags.set(listOf("wsdl2java", "cxf", "wsimport"))
implementationClass = "com.github.bjornvester.wsdl2java.Wsdl2JavaPlugin"
description = "Changes:\n" +
" - Added support for using the jakarta namespace, which is now the default. The older javax namespace can be enabled with a configuration change.\n" +
" - Added support for the Gradle configuration cache.\n" +
" - The Wsdl2Java task now runs with the configured, or default, Java Toolchain.\n" +
" - Minimum required of version of Gradle is now 6.7 (up from 6.0).\n" +
" - The configurations for marking generated code has changed to support a third variant of the Generated annotation. See the README for details."
}
}
}
plugins {
`kotlin-dsl`
id("java-gradle-plugin")
id("com.gradle.plugin-publish") version "1.2.0"
}

group = "com.github.bjornvester"
version = "2.0.1"

repositories {
mavenCentral()
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}

// The integration test folder is an input to the unit test in the root project
// Register these files as inputs
tasks.withType<Test>().configureEach {
inputs
.files(layout.projectDirectory.dir("integration-test").asFileTree.matching {
exclude("**/build/**")
exclude("**/gradle/**")
})
.withPathSensitivity(PathSensitivity.RELATIVE)
useJUnitPlatform()
systemProperty("GRADLE_ROOT_FOLDER", projectDir.absolutePath)
systemProperty("GRADLE_PLUGIN_VERSION", version)
}

tasks.withType<Wrapper> {
gradleVersion = "latest"
}

dependencies {
compileOnly("org.apache.cxf:cxf-tools-wsdlto-core:4.0.2")
testImplementation("commons-io:commons-io:2.13.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}

gradlePlugin {
website.set("https://github.com/bjornvester/wsdl2java-gradle-plugin")
vcsUrl.set("https://github.com/bjornvester/wsdl2java-gradle-plugin")
plugins {
create("wsdl2JavaPlugin") {
id = "com.github.bjornvester.wsdl2java"
displayName = "Gradle Wsdl2Java plugin"
tags.set(listOf("wsdl2java", "cxf", "wsimport"))
implementationClass = "com.github.bjornvester.wsdl2java.Wsdl2JavaPlugin"
description = "Changes:\n" +
" - Fixed a problem in older versions of Gradle when not specifying a Java toolchain.\n" +
" - Due to compatability issues not found version 2.0.0 of the plugin, the plugin now requires at least Gradle 7.6"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ dependencies {

java {
toolchain {
// Note that the unit test in the root project modifies the line below
// Be careful making changes
languageVersion.set(JavaLanguageVersion.of(8))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ dependencies {

java {
toolchain {
// Note that the unit test in the root project modifies the line below
// Be careful making changes
languageVersion.set(JavaLanguageVersion.of(17))
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<bindings xmlns="http://java.sun.com/xml/ns/jaxb" version="2.1"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
extensionBindingPrefixes="xjc">
<globalBindings>
<xjc:javaType name="java.time.OffsetDate" xmlType="xs:date"
adapter="io.github.threetenjaxb.core.OffsetTimeXmlAdapter"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<bindings xmlns="https://jakarta.ee/xml/ns/jaxb" version="3.0"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
extensionBindingPrefixes="xjc">
<globalBindings>
<xjc:javaType name="java.time.OffsetDate" xmlType="xs:date"
adapter="io.github.threetenjaxb.core.OffsetTimeXmlAdapter"/>
Expand Down
40 changes: 19 additions & 21 deletions integration-test/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version ("0.5.0")
}

includeBuild("..")

include(
// Note that the lines below are modified by the unit test in the root project.
// Be careful making changes.
"cxf4:bindings-datetime-test-jakarta",
"cxf4:filter-test",
"cxf4:grouping-test",
"cxf4:includes-options-test",
"cxf4:utf8-test",

"cxf3:bindings-datetime-test",
"cxf3:generated-annotation-test",
"cxf3:xjc-plugins-test"
)

//enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version ("0.5.0")
}

includeBuild("..")

include(
// Note that the lines below are modified by the unit test in the root project.
// Be careful making changes.
"cxf4:bindings-datetime-test-jakarta",
"cxf4:filter-test",
"cxf4:grouping-test",
"cxf4:includes-options-test",
"cxf4:utf8-test",

"cxf3:bindings-datetime-test",
"cxf3:generated-annotation-test",
"cxf3:xjc-plugins-test"
)
Loading

0 comments on commit 5c12566

Please sign in to comment.