Skip to content

Commit

Permalink
Use tasks.register() Gradle API
Browse files Browse the repository at this point in the history
* Remove `artifacts` as it is a part for publication now
  • Loading branch information
artembilan committed Feb 9, 2024
1 parent 35160a3 commit 9e08c7c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ task reference(dependsOn: asciidoctor) {

reference.onlyIf { "$System.env.NO_REFERENCE_TASK" != 'true' || project.hasProperty('ignoreEnvToStopReference') }

task api(type: Javadoc) {
tasks.register('api', Javadoc) {
group = 'Documentation'
description = 'Generates aggregated Javadoc API documentation.'
title = "${rootProject.description} ${version} API"
Expand All @@ -509,10 +509,10 @@ task api(type: Javadoc) {
classpath = files(javaProjects.collect { project ->
project.sourceSets.main.compileClasspath
})
destinationDir = new File(buildDir, 'api')
destinationDir = file('build/api')
}

task docsZip(type: Zip, dependsOn: [reference]) {
tasks.register('docsZip', Zip) {
group = 'Distribution'
archiveClassifier = 'docs'
description = "Builds -${archiveClassifier} archive containing api and reference " +
Expand All @@ -537,7 +537,8 @@ task docsZip(type: Zip, dependsOn: [reference]) {
}
}

task distZip(type: Zip, dependsOn: [docsZip]) { //, schemaZip]) {
tasks.register('distZip', Zip) {
dependsOn 'docsZip'
group = 'Distribution'
archiveClassifier = 'dist'
description = "Builds -${archiveClassifier} archive, containing all jars and docs, " +
Expand Down Expand Up @@ -575,12 +576,8 @@ task distZip(type: Zip, dependsOn: [docsZip]) { //, schemaZip]) {

}

artifacts {
archives distZip
archives docsZip
}

task dist(dependsOn: assemble) {
tasks.register('dist') {
dependsOn assemble
group = 'Distribution'
description = 'Builds -dist, -docs distribution archives.'
}
Expand Down

0 comments on commit 9e08c7c

Please sign in to comment.