Skip to content

Commit

Permalink
Added task information to the wsdl2java Java sourceset directory
Browse files Browse the repository at this point in the history
This hooks up task dependencies to things like sourcesJar automatically.
  • Loading branch information
bjornvester committed Jun 22, 2023
1 parent 5c12566 commit 5483094
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Apply the plugin ID "com.github.bjornvester.wsdl2java" as specific in the [Gradl

```kotlin
plugins {
id("com.github.bjornvester.wsdl2java") version "2.0.1"
id("com.github.bjornvester.wsdl2java") version "2.0.2"
}
```

Expand Down
5 changes: 2 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

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

repositories {
mavenCentral()
Expand Down Expand Up @@ -53,8 +53,7 @@ gradlePlugin {
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"
" - Fixed missing task dependency on wsdl2java from sourcesJar"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ dependencies {
tasks.test {
useJUnitPlatform()
}

java {
withSourcesJar()
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,11 @@ class Wsdl2JavaPlugin : Plugin<Project> {
val currentJavaToolchain = project.extensions.getByType(JavaPluginExtension::class.java).toolchain
val currentJvmLauncherProvider = toolchainService.launcherFor(currentJavaToolchain)
javaLauncher.convention(currentJvmLauncherProvider)

val sourceSets = project.properties["sourceSets"] as SourceSetContainer
sourceSets.named(MAIN_SOURCE_SET_NAME) {
java.srcDir(sourcesOutputDir)
}
}

project.tasks.named(JavaPlugin.COMPILE_JAVA_TASK_NAME) {
dependsOn(wsdl2JavaTask)
val sourceSets = project.properties["sourceSets"] as SourceSetContainer
sourceSets.named(MAIN_SOURCE_SET_NAME) {
java.srcDir(wsdl2JavaTask)
}

return wsdl2JavaTask
Expand Down

0 comments on commit 5483094

Please sign in to comment.