Skip to content

Commit

Permalink
bitcoin-core-binaries: Download Bitcoin Core
Browse files Browse the repository at this point in the history
  • Loading branch information
alvasw committed Sep 2, 2024
1 parent b2233ef commit 68ac51f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package bisq.gradle.bitcoin_core

import bisq.gradle.tasks.PerPlatformUrlProvider

class BitcoinCoreBinaryUrlProvider(private val version: String) : PerPlatformUrlProvider {
override val urlPrefix: String
get() = "https://bitcoincore.org/bin/bitcoin-core-$version/bitcoin-$version-"

override val LINUX_X86_64_URL: String
get() = "x86_64-linux-gnu.tar.gz"

override val MACOS_X86_64_URL: String
get() = "x86_64-apple-darwin.tar.gz"

override val MACOS_ARM_64_URL: String
get() = "arm64-apple-darwin.tar.gz"

override val WIN_X86_64_URL: String
get() = "win64.zip"
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package bisq.gradle.bitcoin_core

import bisq.gradle.tasks.PgpFingerprint
import bisq.gradle.tasks.download.DownloadTaskFactory
import bisq.gradle.tasks.download.SignedBinaryDownloader
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.provider.Provider
import org.gradle.kotlin.dsl.create


Expand Down Expand Up @@ -58,6 +60,10 @@ class BitcoinCorePlugin : Plugin<Project> {
)
)
hashFileDownloader.registerTasks()

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

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

0 comments on commit 68ac51f

Please sign in to comment.