diff --git a/build-logic/tor-binary/src/main/kotlin/bisq/gradle/tor_binary/BisqTorBinaryPlugin.kt b/build-logic/tor-binary/src/main/kotlin/bisq/gradle/tor_binary/BisqTorBinaryPlugin.kt index 586219944f..747f148077 100644 --- a/build-logic/tor-binary/src/main/kotlin/bisq/gradle/tor_binary/BisqTorBinaryPlugin.kt +++ b/build-logic/tor-binary/src/main/kotlin/bisq/gradle/tor_binary/BisqTorBinaryPlugin.kt @@ -4,10 +4,6 @@ import bisq.gradle.tasks.PgpFingerprint import bisq.gradle.tasks.download.SignedBinaryDownloader import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.file.RegularFile -import org.gradle.api.file.RegularFileProperty -import org.gradle.api.provider.Property -import org.gradle.api.provider.Provider import org.gradle.kotlin.dsl.create class BisqTorBinaryPlugin : Plugin { @@ -35,8 +31,7 @@ class BisqTorBinaryPlugin : Plugin { ) torBinaryDownloader.registerTasks() - val binaryTarFile: Provider = torBinaryDownloader.verifySignatureTask.flatMap { it.fileToVerify } - val torBinaryPackager = TorBinaryPackager(project) - torBinaryPackager.registerTasks(binaryTarFile) + val torBinaryPackager = TorBinaryPackager(project, torBinaryDownloader) + torBinaryPackager.registerTasks() } } \ No newline at end of file diff --git a/build-logic/tor-binary/src/main/kotlin/bisq/gradle/tor_binary/TorBinaryPackager.kt b/build-logic/tor-binary/src/main/kotlin/bisq/gradle/tor_binary/TorBinaryPackager.kt index 21d8b491dd..9ee82f7e59 100644 --- a/build-logic/tor-binary/src/main/kotlin/bisq/gradle/tor_binary/TorBinaryPackager.kt +++ b/build-logic/tor-binary/src/main/kotlin/bisq/gradle/tor_binary/TorBinaryPackager.kt @@ -1,23 +1,26 @@ package bisq.gradle.tor_binary +import bisq.gradle.tasks.download.SignedBinaryDownloader import org.gradle.api.Project import org.gradle.api.file.RegularFile -import org.gradle.api.provider.Property import org.gradle.api.provider.Provider import org.gradle.api.tasks.Copy import org.gradle.api.tasks.TaskProvider import org.gradle.api.tasks.bundling.Zip import org.gradle.kotlin.dsl.register -class TorBinaryPackager(private val project: Project) { +class TorBinaryPackager(private val project: Project, private val torBinaryDownloader: SignedBinaryDownloader) { companion object { private const val ARCHIVE_EXTRACTION_DIR = "${BisqTorBinaryPlugin.DOWNLOADS_DIR}/extracted" private const val PROCESSED_DIR = "${BisqTorBinaryPlugin.DOWNLOADS_DIR}/processed" } - fun registerTasks(tarFile: Provider) { + fun registerTasks() { val unpackTarTask: TaskProvider = project.tasks.register("unpackTorBinaryTar") { + dependsOn(torBinaryDownloader.verifySignatureTask) + + val tarFile: Provider = torBinaryDownloader.verifySignatureTask.flatMap { it.fileToVerify } from( tarFile.map { project.tarTree(it.asFile.absolutePath)