I have a Gradle task that creates a 100MB JAR. Now I only want it to be created as part of my gradle build if code within the project has changed (say a specific ./src directory).
So at the moment the build.gradle.kts looks like:
tasks {
"shadowJar"(ShadowJar::class) {
isZip64 = true
archiveFileName.set("${project.name}.jar")
dependencies {
include(dependency(".*:.*:.*"))
exclude(dependency("org.apache.spark:.*"))
}
}
}
tasks {
"build" {
dependsOn("shadowJar")
}
}
Any ideas on how I can achieve this?
Thanks
p.s.
And as a background I'm doing to improve the build time. I've already found 2 things for my gradle.properties:
org.gradle.parallel=true
org.gradle.caching=true