-
Notifications
You must be signed in to change notification settings - Fork 21
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
Package file for multiple modules #168
Comments
We likely don't want to code actual package file generator. We want to test whether we can write a package file which can then reference packages for multiple modules |
When consuming a remote package file from a url, it's not possible for it to reference packages at other file paths in the repo, so we can't just use our existing package file generation with a static parent package file. |
Played around with some ideas, but yeah, the original plan won't work. We can chat about some alternative ideas. While you can't reference sub-module // swift-tools-version:5.3
import PackageDescription
let remoteKotlinUrl = "https://maven.pkg.github.com/kpgalligan/KMMRules/kpgalligan/github/kmmrules/lessshared-kmmbridge/0.9.3/lessshared-kmmbridge-0.9.3.zip"
let remoteKotlinChecksum = "b2e0d6a24b8676f740153da82beabb258df72264c82c1e21718921db547314e1"
let packageName = "lessshared"
let remoteKotlinUrl2 = "https://maven.pkg.github.com/kpgalligan/KMMRules/kpgalligan/github/kmmrules/allshared-kmmbridge/0.9.3/allshared-kmmbridge-0.9.3.zip"
let remoteKotlinChecksum2 = "60ce4c9626926ada1e3a2d526151065790307829824353412a87e925a0f96aec"
let packageName2 = "allshared"
let package = Package(
name: "moreshared",
platforms: [
.iOS(.v13)
],
products: [
.library(
name: packageName,
targets: [packageName]
),
.library(
name: packageName2,
targets: [packageName2]
),
],
targets: [
.binaryTarget(
name: packageName,
url: remoteKotlinUrl,
checksum: remoteKotlinChecksum
)
,
.binaryTarget(
name: packageName2,
url: remoteKotlinUrl2,
checksum: remoteKotlinChecksum2
)
,
]
) When you add that, it'll ask which libraries you want to add: We're writing metadata to the build dir now (url, version, etc). In theory, we could write out package name and the checksum. Then, say, in the root dir, add an SPM config that points at each module we want to add to it. Then it could build the I'm reluctant to try anything really "weird", with
That's the first thing it says about creating packages. I do believe they mean it! Can think through maybe adding those other modules as module dependencies, but I have no idea how that intersects with task order. Can also look at settings plugins, but that seems like a whole different world. Third option, treat it as a really special case. Implement the extra metadata discussed above, then change the current plugin to run even if it doesn't have a dependency manager. It'll make the metadata and upload the zips. Then, run a completely different plugin that we point at modules to collect and build the |
same issue may related to this - build -> https://github.com/tddworks/openai-kotlin/actions/runs/7867481586/job/21463248748#step:8:1
|
Hi @kpgalligan, is this issue fixed? i couldn't find any docs for this. |
No. I was closing old issues. I'll reopen it, but we're crushed with regular Touchlab work and other OSS stuff we're doing, so I don't think this will get any thought anytime soon. There's a new version of KMMBridge coming out pretty soon, but it's focused on other things. If there's some extra time, I'll put some thought into this again, but I wouldn't say there's much "extra time" till later in the year (I.E. after KotlinConf). |
I am just trying to figure out how to fix this issue.
val kmmbridgeProjects = project.subprojects.filter {
it.plugins.hasPlugin("co.touchlab.kmmbridge:touchlab-kmmbridge")
}
products: [
.library(
name: packageName,
targets: [packageName]
),
.library(
name: packageName2,
targets: [packageName2]
),
],
targets: [
.binaryTarget(
name: packageName,
url: remoteKotlinUrl,
checksum: remoteKotlinChecksum
)
,
.binaryTarget(
name: packageName2,
url: remoteKotlinUrl2,
checksum: remoteKotlinChecksum2
)
,
]
|
Getting back to older issues. It looks like this PR provides a solution, although I would assume it's fairly manual. However, on recent doc review, those changes aren't in the current docs, so we'll need to update those. If that PR is not sufficient for some common use cases, we can reopen this. |
This will need some experimentation. Probably it looks like a single top-level file which declares multiple artifacts, but need to do some testing and understand how it works.
The text was updated successfully, but these errors were encountered: