-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ATL-5386: Remove cocoapods so it works on the iOS #87
Conversation
🦙 MegaLinter status:
|
Descriptor | Linter | Files | Fixed | Errors | Elapsed time |
---|---|---|---|---|---|
bash-exec | 1 | 1 | 0.01s | ||
shfmt | 1 | 1 | 0.01s | ||
✅ EDITORCONFIG | editorconfig-checker | 41 | 0 | 0.14s | |
✅ KOTLIN | ktlint | 25 | 0 | 59.07s | |
devskim | yes | 6 | 1.41s | ||
✅ REPOSITORY | dustilock | yes | no | 0.07s | |
✅ REPOSITORY | gitleaks | yes | no | 2.12s | |
✅ REPOSITORY | git_diff | yes | no | 0.04s | |
✅ REPOSITORY | secretlint | yes | no | 5.03s | |
✅ REPOSITORY | syft | yes | no | 0.5s | |
✅ REPOSITORY | trivy | yes | no | 6.22s |
See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true
in mega-linter.yml to validate all sources, not only the diff
6303d96
to
25b0c3a
Compare
@@ -7,8 +7,7 @@ val os: OperatingSystem = OperatingSystem.current() | |||
|
|||
plugins { | |||
kotlin("multiplatform") | |||
kotlin("native.cocoapods") | |||
id("com.chromaticnoise.multiplatform-swiftpackage") version "2.0.3" | |||
id("io.github.luca992.multiplatform-swiftpackage") version "2.0.5-arm64" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id("io.github.luca992.multiplatform-swiftpackage") version "2.0.5-arm64" | |
val osName = System.getProperty("os.name").toLowerCase() | |
if (osName.contains("mac os x") || osName.contains("darwin") || osName.contains("osx")) { | |
if (System.getProperty("os.arch") != "x86_64") { // M1Chip | |
id("io.github.luca992.multiplatform-swiftpackage") version "2.0.5-arm64" | |
} else { | |
id("io.github.luca992.multiplatform-swiftpackage") version("2.0.3") | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to add this? I don't think it makes a difference :) also I tried doing this and it was giving me an error when I add an If like so inside the plugins {...}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I've update the code snippet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated to code. This version should work inside the plugins
block now.
ios() { | ||
swiftCinterop("IOHKCryptoKit", name) | ||
swiftCinterop("IOHKSecureRandomGeneration", name) | ||
|
||
binaries.framework { | ||
baseName = currentModuleName | ||
embedBitcode("disable") | ||
} | ||
} | ||
macosX64() { | ||
binaries.framework { | ||
baseName = currentModuleName | ||
embedBitcode("disable") | ||
} | ||
|
||
swiftCinterop("IOHKCryptoKit", name) | ||
swiftCinterop("IOHKSecureRandomGeneration", name) | ||
} | ||
|
||
if (System.getProperty("os.arch") != "x86_64") { // M1Chip | ||
iosSimulatorArm64() | ||
iosSimulatorArm64() { | ||
binaries.framework { | ||
baseName = currentModuleName | ||
embedBitcode("disable") | ||
} | ||
|
||
swiftCinterop("IOHKCryptoKit", name) | ||
swiftCinterop("IOHKSecureRandomGeneration", name) | ||
} | ||
// tvosSimulatorArm64() | ||
// watchosSimulatorArm64() | ||
macosArm64() | ||
macosArm64() { | ||
binaries.framework { | ||
baseName = currentModuleName | ||
embedBitcode("disable") | ||
} | ||
|
||
swiftCinterop("IOHKCryptoKit", name) | ||
swiftCinterop("IOHKSecureRandomGeneration", name) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be inside of
if (os.isMacOsX)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funny enough it should not :D the linux passes fine, and I took them out of it, because on linux
the build would fail with the Swift Packages plugin and no Apple target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion on this. So we can ignore it.
9af2bf2
to
d8b1be5
Compare
This change was needed because ios requires a dependency manager for any dependency. Using cocoapods for internal xcode projects would not work quite right when trying to use Apollo as a framework.
d8b1be5
to
d16484d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Ahmed Moussa <[email protected]> Signed-off-by: Goncalo Frade <[email protected]>
Removed cocoapods for internal libraries and made them static.
The reason is if they are frameworks, the will not go within Apollo framework, instead they will be dependencies and expected to exist as a dependency, also Apollo itself should be a static framework so it can be easily reused on our SDK.