Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Conversation

ge-org
Copy link
Owner

@ge-org ge-org commented Nov 29, 2020

DSL Syntax

import com.chromaticnoise.multiplatformswiftpackage.dsl.TemplateKey.*

multiplatformSwiftPackage {
    packageTemplate(File(project.projectDir, "custom-package.template")) {
        packageName = "customized" // some properties can be accessed directly
        set("myProp", "my custom value") // custom key/value pairs can be added
        set(ToolsVersion, "42") // all default keys can be accessed in type-safe manner
    }
}

TODOs

  • Tests
  • Throw exception if template file does not exist
  • Verify that generated swift package file is valid (or at least parseable by Swift)
  • Expose default keys as public enum
  • Update README
  • Update CHANGELOG

@ge-org ge-org marked this pull request as draft November 29, 2020 17:52
@ge-org ge-org added this to the 2.1.x milestone Nov 29, 2020
@sebarthel89
Copy link

Looking forward to this PR. I tried to import a created swift package, but it failed by not finding a Package.swift .

SomeProject has no Package.swift manifest

@ge-org
Copy link
Owner Author

ge-org commented Dec 1, 2020

Hi @sebarthel89,

how did you add the Package.swift file to the project? This should already be possible without this PR.
It should work by executing ./gradlew createSwiftPackage and then dragging the swiftpackage folder into the Xcode project. Then add the XCFramework to the Frameworks, Libraries, and Embedded Content section in the project settings.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants