Skip to content

Commit a558871

Browse files
build: improve Upload task
1 parent 73c55fd commit a558871

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

build.gradle

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,6 @@ tasks.register('xmldoc', Javadoc) {
142142
destinationDir = reporting.file("xmlDoclet")
143143
options.docletpath = configurations.xmlDoclet.files.asType(List)
144144
options.doclet = "com.github.markusbernhardt.xmldoclet.XmlDoclet"
145-
146-
// @see https://github.com/gradle/gradle/issues/11898#issue-549900869
147-
//title = null
148-
//options.noTimestamp(false)
149-
150145
options.addBooleanOption("rst", true)
151146
options.addStringOption("basePackage", "net.sf.jsqlparser")
152147

@@ -303,14 +298,14 @@ spotless {
303298
}
304299
}
305300

306-
tasks.withType(Checkstyle) {
301+
tasks.withType(Checkstyle).configureEach {
307302
reports {
308303
xml.required = false
309304
html.required = true
310305
}
311306
}
312307

313-
task renderRR() {
308+
tasks.register('renderRR') {
314309
dependsOn(compileJavacc)
315310
doLast {
316311
// these WAR files have been provided as a courtesy by Gunther Rademacher
@@ -362,7 +357,7 @@ task renderRR() {
362357
}
363358
}
364359

365-
task gitChangelogTask(type: GitChangelogTask) {
360+
tasks.register('gitChangelogTask', GitChangelogTask) {
366361
fromRepo = file("$projectDir")
367362
file = new File("${projectDir}/src/site/sphinx/changelog.rst")
368363
fromRef = "4.0"
@@ -401,7 +396,7 @@ Version {{name}}
401396
// @formatter:on
402397
}
403398

404-
task updateKeywords(type: JavaExec) {
399+
tasks.register('updateKeywords', JavaExec) {
405400
group = "Execution"
406401
description = "Run the main class with JavaExecTask"
407402
classpath = sourceSets.main.runtimeClasspath
@@ -414,7 +409,7 @@ task updateKeywords(type: JavaExec) {
414409
dependsOn(compileJava)
415410
}
416411

417-
task sphinx(type: Exec) {
412+
tasks.register('sphinx', Exec) {
418413
dependsOn(gitChangelogTask, renderRR, updateKeywords, xmldoc)
419414

420415
doFirst() {
@@ -547,7 +542,7 @@ signing {
547542
sign publishing.publications.mavenJava
548543
}
549544

550-
tasks.withType(JavaCompile) {
545+
tasks.withType(JavaCompile).configureEach {
551546
options.encoding = 'UTF-8'
552547
}
553548

@@ -559,11 +554,11 @@ remotes {
559554
}
560555
}
561556

562-
task upload {
557+
tasks.register('upload') {
563558
doFirst {
564-
if( findProperty("${project.name}.host")==null ) {
559+
if (findProperty("${project.name}.host") == null) {
565560
println(
566-
"""
561+
"""
567562
Property \"${project.name}.host\' not found.
568563
Please define \"${project.name}.host\" in the Gradle configuration (e. g. \$HOME/.gradle/gradle.properties.
569564
"""
@@ -575,7 +570,9 @@ task upload {
575570
session(remotes.webServer) {
576571
def versionStable = getVersion(false)
577572
execute "mkdir -p download/${project.name}-${versionStable}"
578-
put from: "${project.buildDir}/libs", into: "download/${project.name}-${versionStable}"
573+
for (File file: fileTree(include:['*.jar'], dir:"${project.buildDir}/libs").collect()) {
574+
put from: file, into: "download/${project.name}-${versionStable}"
575+
}
579576
}
580577
}
581578
}

0 commit comments

Comments
 (0)