Skip to content

Commit

Permalink
build-logic: Verify Bitcoin Core's SHA256 hash
Browse files Browse the repository at this point in the history
  • Loading branch information
alvasw committed Sep 3, 2024
1 parent b5be65d commit 547bec3
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.provider.Provider
import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.register


class BitcoinCorePlugin : Plugin<Project> {
Expand Down Expand Up @@ -63,7 +64,14 @@ class BitcoinCorePlugin : Plugin<Project> {

val binaryDownloadUrl: Provider<String> = extension.version.map { BitcoinCoreBinaryUrlProvider(it).url }
val downloadTaskFactory = DownloadTaskFactory(project, DOWNLOADS_DIR)
downloadTaskFactory.registerDownloadTask("downloadBitcoinCore", binaryDownloadUrl)
val binaryDownloadTask = downloadTaskFactory
.registerDownloadTask("downloadBitcoinCore", binaryDownloadUrl)

project.tasks.register<HashVerificationTask>("verifyBitcoinCore") {
inputFile.set(binaryDownloadTask.flatMap { it.outputFile })
sha256File.set(hashFileDownloader.verifySignatureTask.flatMap { it.fileToVerify })
resultFile.set(project.layout.buildDirectory.file("${DOWNLOADS_DIR}/bitcoin_core.sha256.result"))
}
}

private fun filenameAndFingerprint(filename: String, fingerprint: String) =
Expand Down

0 comments on commit 547bec3

Please sign in to comment.