Git submodules can be a hassle, so I’m open for be...
# kotlin-native
s
Git submodules can be a hassle, so I’m open for better suggestions
g
The common code is not public, so releasing it on a public repo (i.e. Maven central) is out of the question.
Publish it to private repo, there are many cloud providers (bintray, jitpack, github, sonatype) and self hosted (Artifactory, Sonatype)
👍 2
m
During development phase, wen also shared code changes very often, releasing of shared artifact can be a pain. Using `localMaven`works quite well. Also have a look on
composite builds
which address this issuel with multiple/single repo https://docs.gradle.org/current/userguide/composite_builds.html If multiple devs working on the stuff, you better go with solution proposed by @gildor artifactory with docker is up and running quite quickly
👍 1
g
Yeah, compltely agree with Michal Just use snapshots for this if you want to share it with other developers
for local development composite build maybe better alternative to localMaven
m
yeap, gradle+SNAPSHOTS ate not the best friends
g
Why?
I mean composite builds a better, but snapshots also work, just more ceremony
m
We had a lot of issues of resolution of the latest “SNAPSHOT” version, probably local caching issues, we gave up.
I’ve learned about
--refresh-dependencies
also cleaning the cache, but it was always dice throwing if I will get the right one.
g
probably local caching
Never saw such problem. By default Gradle caches snapshots for 24 hours, but it configurable and if you set 0 seconds for snapshots cache, it will check them on every build
m
Thanks, thats what I’ve expected. Let’s give gradle another chance 🙂
g
Also check that your repository is marked as snapshot repo, only in this case Gradle will check it every time
m
you mean
snapshotsOnly()
?
g
it’s property of root
pom.xml
of your repo
In Artifactory there is a flag to enable snapshots for your repo
m
Thank you for your hints, I will definitely try it out.
m
Because last time I checked, iOS developers where not using Gradle/Maven 😉
t
You can use Carthage, it’s easy to share a .framework that way https://github.com/Carthage/Carthage#archive-prebuilt-frameworks-into-one-zip-file
m
kotlin native has already integration for cocoapods https://kotlinlang.org/docs/reference/native/cocoapods.html
k
i would use CocoaPods with a local podspec for active module development
you can switch it to a git hosted podspec for normal workflows
m
probably also depends on what the iOS project is already using
k
i did encounter an issue with CocoaPods for an MPP that's using cinterop, but that's an edge case
m
So no one here is using a single Git for iOS/Android development?
Or can anyone recommend it?
k
that sounds quite messy
g
Single repository for Android and iOS is completely different story. I see nothing wrong with it itself, but it's just major shift for existing project. For a new multiplatform project it sounds for me as a good idea. But if you just share MPP library between Android and iOS than publishing artifacts + composite builds is probably a better solution
👍 1