kotlin-multiplatform-oidc icon indicating copy to clipboard operation
kotlin-multiplatform-oidc copied to clipboard

Building on Linux/Windows

Open yottapanda opened this issue 1 year ago • 2 comments

I'm getting the following error when trying to build this project on Linux:

Caused by: java.io.IOException: Cannot run program "xcodebuild" (in directory "/home/keval/Documents/kotlin-multiplatform-oidc/oidc-crypto"): error=2, No such file or directory

Obviously I understand this is designed to be a cross-platform library, however I'd still like to run the sample app locally. Is there a way to disable the Apple-related components?

yottapanda avatar May 12 '24 12:05 yottapanda

I've just tried

Index: oidc-crypto/build.gradle.kts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/oidc-crypto/build.gradle.kts b/oidc-crypto/build.gradle.kts
--- a/oidc-crypto/build.gradle.kts	(revision 278a7e3c6f9993ed7b60a05d8e1c2809749595b3)
+++ b/oidc-crypto/build.gradle.kts	(date 1715516785303)
@@ -29,19 +29,19 @@
         }
     }
 
-    listOf(
-        iosX64(),
-        iosArm64(),
-        iosSimulatorArm64(),
-    ).forEach {
-        it.compilations {
-            val main by getting {
-                cinterops {
-                    create("KCrypto")
-                }
-            }
-        }
-    }
+//    listOf(
+//        iosX64(),
+//        iosArm64(),
+//        iosSimulatorArm64(),
+//    ).forEach {
+//        it.compilations {
+//            val main by getting {
+//                cinterops {
+//                    create("KCrypto")
+//                }
+//            }
+//        }
+//    }
 
     targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> {
         compilations["main"].compilerOptions.options.freeCompilerArgs.add("-Xexport-kdoc")

And it appears to have solved my problem.

Does this need a guard around it?

yottapanda avatar May 12 '24 12:05 yottapanda

Building on Windows/Linux had no priority when I setup the project, but if you have an idea, you may open a Pull Request :)

kalinjul avatar May 13 '24 06:05 kalinjul

Could be solved by using this trick: https://youtrack.jetbrains.com/issue/KT-30498

But this is out of scope of this library, if you want to build on windows, please just exclude the ios targets as the in comment above

kalinjul avatar Jun 17 '24 09:06 kalinjul