Don't hash the dev bundle zip twice (#223)
This commit is contained in:
parent
1d88d33cc5
commit
7d2ae18db3
3 changed files with 6 additions and 3 deletions
|
@ -299,6 +299,7 @@ abstract class PaperweightUser : Plugin<Project> {
|
|||
parameters {
|
||||
cache.set(cacheDir)
|
||||
bundleZip.set(devBundleZip)
|
||||
bundleZipHash.set(bundleHash)
|
||||
downloadService.set(target.download)
|
||||
genSources.set(target.genSources)
|
||||
}
|
||||
|
|
|
@ -46,10 +46,10 @@ data class ExtractedBundle<C>(
|
|||
|
||||
fun extractDevBundle(
|
||||
destinationDirectory: Path,
|
||||
devBundle: Path
|
||||
devBundle: Path,
|
||||
newDevBundleHash: String
|
||||
): ExtractedBundle<Any> {
|
||||
val hashFile = destinationDirectory.resolve("current.sha256")
|
||||
val newDevBundleHash = devBundle.sha256asHex()
|
||||
|
||||
if (destinationDirectory.exists()) {
|
||||
val currentDevBundleHash = if (hashFile.isRegularFile()) hashFile.readText(Charsets.UTF_8) else ""
|
||||
|
|
|
@ -47,6 +47,7 @@ abstract class UserdevSetup : BuildService<UserdevSetup.Parameters>, SetupHandle
|
|||
|
||||
interface Parameters : BuildServiceParameters {
|
||||
val bundleZip: RegularFileProperty
|
||||
val bundleZipHash: Property<String>
|
||||
val cache: RegularFileProperty
|
||||
val downloadService: Property<DownloadService>
|
||||
val genSources: Property<Boolean>
|
||||
|
@ -55,7 +56,8 @@ abstract class UserdevSetup : BuildService<UserdevSetup.Parameters>, SetupHandle
|
|||
private val extractDevBundle: ExtractedBundle<Any> = lockSetup(parameters.cache.path) {
|
||||
val extract = extractDevBundle(
|
||||
parameters.cache.path.resolve(paperSetupOutput("extractDevBundle", "dir")),
|
||||
parameters.bundleZip.path
|
||||
parameters.bundleZip.path,
|
||||
parameters.bundleZipHash.get()
|
||||
)
|
||||
lastUsedFile(parameters.cache.path).writeText(System.currentTimeMillis().toString())
|
||||
extract
|
||||
|
|
Loading…
Reference in a new issue