Skip to content

Commit

Permalink
Fix build warnings (#604)
Browse files Browse the repository at this point in the history
Follow up to #594 which introduced deprecation warnings.

---------

Co-authored-by: Dominique Padiou <[email protected]>
  • Loading branch information
pm47 and dpad85 authored Feb 21, 2024
1 parent d9bf6bd commit f861c3c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 33 deletions.
8 changes: 4 additions & 4 deletions PhoenixCrypto/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
listOf("iphoneos", "iphonesimulator").forEach { sdk ->
tasks.create<Exec>("buildCrypto${sdk.capitalize()}") {
listOf("Iphoneos", "Iphonesimulator").forEach { sdk ->
tasks.create<Exec>("buildCrypto$sdk") {
group = "build"

commandLine(
"xcodebuild",
"-quiet",
"-project", "PhoenixCrypto.xcodeproj",
"-target", "PhoenixCrypto",
"-sdk", sdk
"-sdk", sdk.lowercase()
)
workingDir(projectDir)

Expand All @@ -16,7 +16,7 @@ listOf("iphoneos", "iphonesimulator").forEach { sdk ->
fileTree("$projectDir/PhoenixCrypto")
)
outputs.files(
fileTree("$projectDir/build/Release-${sdk}")
fileTree("$projectDir/build/Release-${sdk.lowercase()}")
)
}
}
Expand Down
49 changes: 20 additions & 29 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import org.jetbrains.dokka.Platform
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest

Expand Down Expand Up @@ -48,28 +47,28 @@ kotlin {
if (currentOs.isMacOsX) {
iosX64 { // ios simulator on intel devices
compilations["main"].cinterops.create("PhoenixCrypto") {
val platform = "iphonesimulator"
val platform = "Iphonesimulator"
val interopTask = tasks[interopProcessingTaskName]
interopTask.dependsOn(":PhoenixCrypto:buildCrypto${platform.capitalize()}")
includeDirs.headerFilterOnly("$rootDir/PhoenixCrypto/build/Release-$platform/include")
interopTask.dependsOn(":PhoenixCrypto:buildCrypto$platform")
includeDirs.headerFilterOnly("$rootDir/PhoenixCrypto/build/Release-${platform.lowercase()}/include")
}
}

iosArm64 { // actual ios devices
compilations["main"].cinterops.create("PhoenixCrypto") {
val platform = "iphoneos"
val platform = "Iphoneos"
val interopTask = tasks[interopProcessingTaskName]
interopTask.dependsOn(":PhoenixCrypto:buildCrypto${platform.capitalize()}")
includeDirs.headerFilterOnly("$rootDir/PhoenixCrypto/build/Release-$platform/include")
interopTask.dependsOn(":PhoenixCrypto:buildCrypto$platform")
includeDirs.headerFilterOnly("$rootDir/PhoenixCrypto/build/Release-${platform.lowercase()}/include")
}
}

iosSimulatorArm64 { // actual ios devices
compilations["main"].cinterops.create("PhoenixCrypto") {
val platform = "iphonesimulator"
val platform = "Iphonesimulator"
val interopTask = tasks[interopProcessingTaskName]
interopTask.dependsOn(":PhoenixCrypto:buildCrypto${platform.capitalize()}")
includeDirs.headerFilterOnly("$rootDir/PhoenixCrypto/build/Release-$platform/include")
interopTask.dependsOn(":PhoenixCrypto:buildCrypto$platform")
includeDirs.headerFilterOnly("$rootDir/PhoenixCrypto/build/Release-${platform.lowercase()}/include")
}
}
}
Expand Down Expand Up @@ -138,7 +137,7 @@ kotlin {
languageSettings.optIn("kotlin.ExperimentalStdlibApi")
}
}

configurations.all {
// do not cache changing (i.e. SNAPSHOT) dependencies
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
Expand All @@ -156,18 +155,12 @@ kotlin {
}
}

val dokkaOutputDir = buildDir.resolve("dokka")
val dokkaOutputDir = layout.buildDirectory.dir("dokka")
tasks.dokkaHtml {
outputDirectory.set(file(dokkaOutputDir))
dokkaSourceSets {
configureEach {
val platformName = when (platform.get()) {
Platform.jvm -> "jvm"
Platform.js -> "js"
Platform.native -> "native"
Platform.common -> "common"
Platform.wasm -> "wasm"
}
val platformName = platform.get().name
displayName.set(platformName)

perPackageOption {
Expand Down Expand Up @@ -231,7 +224,7 @@ afterEvaluate {
configure(targets) {
compilations.all {
cinterops.all { tasks[interopProcessingTaskName].enabled = false }
compileKotlinTask.enabled = false
compileTaskProvider.get().enabled = false
tasks[processResourcesTaskName].enabled = false
}
binaries.all { linkTask.enabled = false }
Expand Down Expand Up @@ -280,21 +273,19 @@ afterEvaluate {
val dockerTestEnv by tasks.creating(Exec::class) {
workingDir = projectDir.resolve("docker-local-test")
commandLine("bash", "env.sh", "remove", "net-create", "btc-create", "elx-create", "btc-start", "elx-start")
doLast {
gradle.buildFinished {
exec {
println("Cleaning up dockers...")
workingDir = projectDir.resolve("docker-local-test")
commandLine("bash", "env.sh", "elx-stop", "btc-stop", "remove")
}
}
}
}

val dockerCleanup by tasks.creating(Exec::class) {
println("Cleaning up dockers...")
workingDir = projectDir.resolve("docker-local-test")
commandLine("bash", "env.sh", "elx-stop", "btc-stop", "remove")
}

val includeIntegrationTests = project.findProperty("integrationTests") == "include"
tasks.withType<AbstractTestTask> {
if (includeIntegrationTests) {
dependsOn(dockerTestEnv)
finalizedBy(dockerCleanup)
} else {
filter.excludeTestsMatching("*IntegrationTest")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ class ElectrumMiniWalletTest : LightningTestSuite() {
}

@Ignore
@Test
fun `perf test generator`() = runSuspendTest(timeout = 45.seconds) {
val client = connectToMainnetServer()
val wallet = ElectrumMiniWallet(Block.LivenetGenesisBlock.hash, client, this, logger)
Expand Down

0 comments on commit f861c3c

Please sign in to comment.