multiplatform-swiftpackage
                                
                                 multiplatform-swiftpackage copied to clipboard
                                
                                    multiplatform-swiftpackage copied to clipboard
                            
                            
                            
                        Declare custom Package.swift template and its properties
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
- [x] Tests
- [ ] Throw exception if template file does not exist
- [ ] Verify that generated swift package file is valid (or at least parseable by Swift)
- [x] Expose default keys as public enum
- [ ] Update README
- [ ] Update CHANGELOG
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
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.