Skip to content

Commit

Permalink
BLADE-728 improve build.gradle for gradle 7
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjhy committed Aug 15, 2023
1 parent dca591d commit 34a299b
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,24 @@ clean.doFirst {
}

cliSourcesJar {
classifier = "sources"
archiveClassifier.set("sources")
from sourceSets.main.allJava
}

cliTestJar {
classifier = "tests"
dependsOn "unzipPortal"
archiveClassifier.set("tests")
from sourceSets.test.output
}

createWrapperZip {
from "${rootProject.projectDir}"
archiveName = "wrapper.zip"
destinationDir = new File("${buildDir}")
archiveFileName.set("wrapper.zip")
destinationDirectory.set(new File("${buildDir}"))
include "gradle/**"
include "gradlew*"

finalizedBy("processZipsResources")
}

dependencies {
Expand Down Expand Up @@ -142,11 +145,13 @@ downloadProductInfo {
}

jar {
archiveName = "blade.jar"
dependsOn("unzipPortal")
archiveFileName.set("blade.jar")
from createToolingZip, createWrapperZip, downloadProductInfo
}

processResources {
dependsOn("unzipPortal")
from configurations.bladeExtensions
from bladeExtensionsVersions
}
Expand All @@ -173,10 +178,12 @@ bladeExtensionsVersions {
project(":gradle-tooling").afterEvaluate {
tooling ->
createToolingZip {
archiveName = "tooling.zip"
dependsOn ":gradle-tooling:jar"
destinationDir = new File("${buildDir}")
archiveFileName.set("tooling.zip")
destinationDirectory.set(new File("${buildDir}"))
from tooling.jar.archivePath

finalizedBy("processZipsResources")
}
}

Expand Down Expand Up @@ -304,12 +311,16 @@ unzipManifest {
from zipTree(jar.archivePath)
into sourceSets.main.output.classesDirs.singleFile
include '/META-INF/MANIFEST.MF'

finalizedBy("compileTestJava")
}

unzipPortal {
dependsOn downloadPortal
from tarTree(resources.gzip(downloadPortal.dest))
into buildDir

finalizedBy("processZipsResources")
}

version = "4.1.2-SNAPSHOT"
Expand Down

0 comments on commit 34a299b

Please sign in to comment.