diff --git a/multiplatform-crypto-libsodium-bindings/build.gradle.kts b/multiplatform-crypto-libsodium-bindings/build.gradle.kts index 3195504..b06227f 100644 --- a/multiplatform-crypto-libsodium-bindings/build.gradle.kts +++ b/multiplatform-crypto-libsodium-bindings/build.gradle.kts @@ -145,107 +145,103 @@ kotlin { println("Configuring Linux Arm 32 targets") } - - runningOnMacos { - println("Configuring macos targets") - iosX64() { - binaries { - framework { - optimized = true - } - } - } - iosArm64() { - binaries { - framework { - optimized = true - } - } - } - - iosArm32() { - binaries { - framework { - optimized = true - } - } - } - macosX64() { - binaries { - framework { - optimized = true - } - } - compilations.getByName("main") { - val libsodiumCinterop by cinterops.creating { - defFile(project.file("src/nativeInterop/cinterop/libsodium.def")) - compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-macos-x86-64/include") - } - kotlinOptions.freeCompilerArgs = listOf( - "-include-binary", "${project.rootDir}/sodiumWrapper/static-macos-x86-64/lib/libsodium.a" - ) - } - } - tvosX64() { - binaries { - framework { - optimized = true - } - } - } - - tvosArm64() { - binaries { - framework { - optimized = true - } - } - } - - watchosArm64() { - binaries { - framework { - optimized = true - } - } - } - - watchosArm32() { - binaries { - framework { - optimized = true - } - } - } - - watchosX86() { - binaries { - framework { - optimized = true - } + println("Configuring macos targets") + iosX64() { + binaries { + framework { + optimized = true } } } - runningOnWindows { - println("Configuring Mingw targets") - mingwX64() { - binaries { - staticLib { - optimized = true - } - } - compilations.getByName("main") { - val libsodiumCinterop by cinterops.creating { - defFile(project.file("src/nativeInterop/cinterop/libsodium.def")) - compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-mingw-x86-64/include") - } - kotlinOptions.freeCompilerArgs = listOf( - "-include-binary", "${project.rootDir}/sodiumWrapper/static-mingw-x86-64/lib/libsodium.a" - ) + iosArm64() { + binaries { + framework { + optimized = true } } } + iosArm32() { + binaries { + framework { + optimized = true + } + } + } + macosX64() { + binaries { + framework { + optimized = true + } + } + compilations.getByName("main") { + val libsodiumCinterop by cinterops.creating { + defFile(project.file("src/nativeInterop/cinterop/libsodium.def")) + compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-macos-x86-64/include") + } + kotlinOptions.freeCompilerArgs = listOf( + "-include-binary", "${project.rootDir}/sodiumWrapper/static-macos-x86-64/lib/libsodium.a" + ) + } + } + tvosX64() { + binaries { + framework { + optimized = true + } + } + } + + tvosArm64() { + binaries { + framework { + optimized = true + } + } + } + + watchosArm64() { + binaries { + framework { + optimized = true + } + } + } + + watchosArm32() { + binaries { + framework { + optimized = true + } + } + } + + watchosX86() { + binaries { + framework { + optimized = true + } + } + } + println("Configuring Mingw targets") + mingwX64() { + binaries { + staticLib { + optimized = true + } + } + compilations.getByName("main") { + val libsodiumCinterop by cinterops.creating { + defFile(project.file("src/nativeInterop/cinterop/libsodium.def")) + compilerOpts.add("-I${project.rootDir}/sodiumWrapper/static-mingw-x86-64/include") + } + kotlinOptions.freeCompilerArgs = listOf( + "-include-binary", "${project.rootDir}/sodiumWrapper/static-mingw-x86-64/lib/libsodium.a" + ) + } + } + + println(targets.names) sourceSets { diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 364fbd6..90ff178 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -99,9 +99,18 @@ kotlin { } runningOnMacos { - val iosX64Target = iosX64() - val iosArm64Target = iosArm64() - val iosArm32Target = iosArm32() + val iosX64Target = iosX64() { + baseName = "LibsodiumBindings" + export(Deps.Common.libsodiumBindings) + } + val iosArm64Target = iosArm64() { + baseName = "LibsodiumBindings" + export(Deps.Common.libsodiumBindings) + } + val iosArm32Target = iosArm32() { + baseName = "LibsodiumBindings" + export(Deps.Common.libsodiumBindings) + } val macosX64Target = macosX64() val tvosX64Target = tvosX64() val tvosArm64Target = tvosArm64() @@ -113,16 +122,16 @@ kotlin { binaries.executable {} } - configure(listOf( - iosX64Target, iosArm64Target, iosArm32Target, - tvosX64Target, tvosArm64Target, watchosArm64Target, - watchosArm32Target, watchosX86Target) - ) { - binaries.framework { - baseName = "LibsodiumBindings" - export(Deps.Common.libsodiumBindings) - } - } +// configure(listOf( +// iosX64Target, iosArm64Target, iosArm32Target, +// tvosX64Target, tvosArm64Target, watchosArm64Target, +// watchosArm32Target, watchosX86Target) +// ) { +// binaries.framework { +// baseName = "LibsodiumBindings" +// export(Deps.Common.libsodiumBindings) +// } +// } val mode = System.getenv("CONFIGURATION") ?: "DEBUG" println("Mode $mode") // Create a task to build a fat framework.