Skip to content

Commit

Permalink
maybe fix sources and javadoc not being included
Browse files Browse the repository at this point in the history
  • Loading branch information
rotgruengelb committed Nov 21, 2023
1 parent 1cddf8e commit 04032f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 13 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,21 @@ tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:unchecked"
}

tasks.register('javadocJar', Jar) {
archiveClassifier = 'javadoc'
from javadoc
}

tasks.register('sourcesJar', Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
def targetJavaVersion = 17
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
it.options.release = targetJavaVersion
}
}

artifacts {
archives javadocJar, sourcesJar
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
withSourcesJar()
withJavadocJar()
}

jar {
Expand Down

0 comments on commit 04032f0

Please sign in to comment.