Base library to generate files, part of the Polymorph project
To install PolymorphGen with SwiftPackageManager, add the following lines to your Package.swift
.
let package = Package(
name: "XXX",
products: [
.library(
name: "XXX",
targets: ["XXX"]),
],
dependencies: [
.package(url: "https://github.com/Digipolitan/polymorph-gen.git", from: "1.0.0")
],
targets: [
.target(
name: "XXX",
dependencies: ["PolymorphGen"])
]
)
All child platform must implements the PlatformGen interface and override all fields & methods
class ExampleGen: PlatformGen {
static var name: String {
return "Example"
}
static var shared: PlatformGen = ExampleGen()
private init() { }
func generate(_ project: Project, options: PolymorphGen.Options) throws -> [File] {
// TODO
}
}
After that register your platform when initializing the PolymorphGen instance
let generator = PolymorphGen(platforms: [
ExampleGen.self
])
See CONTRIBUTING.md for more details!
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to contact@digipolitan.com.
PolymorphGen is licensed under the BSD 3-Clause license.