Skip to content

Commit

Permalink
Ensure that jarmode jar added to an app has same SHA as published jar
Browse files Browse the repository at this point in the history
Closes gh-31862
  • Loading branch information
wilkinsona committed Aug 1, 2022
1 parent 66a93a3 commit c0daede
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Expand Up @@ -15,3 +15,8 @@ dependencies {
testImplementation("org.mockito:mockito-core")
testImplementation("org.mockito:mockito-junit-jupiter")
}

jar {
reproducibleFileOrder = true
preserveFileTimestamps = false
}
Expand Up @@ -49,23 +49,18 @@ task reproducibleLoaderJar(type: Jar) {
destinationDirectory = file("${generatedResources}/META-INF/loader")
}

task reproducibleJarModeLayerToolsJar(type: Jar) {
task layerToolsJar(type: Sync) {
dependsOn configurations.jarmode
from {
zipTree(configurations.jarmode.incoming.files.singleFile).matching {
exclude "META-INF/LICENSE.txt"
exclude "META-INF/NOTICE.txt"
}
file(configurations.jarmode.incoming.files.singleFile)
}
reproducibleFileOrder = true
preserveFileTimestamps = false
archiveFileName = "spring-boot-jarmode-layertools.jar"
destinationDirectory = file("${generatedResources}/META-INF/jarmode")
rename({ "spring-boot-jarmode-layertools.jar" })
into(file("${generatedResources}/META-INF/jarmode"))
}

sourceSets {
main {
output.dir(generatedResources, builtBy: [reproducibleJarModeLayerToolsJar, reproducibleLoaderJar])
output.dir(generatedResources, builtBy: [layerToolsJar, reproducibleLoaderJar])
}
}

Expand Down

0 comments on commit c0daede

Please sign in to comment.