Generate License List that Project depends on.
// Package.swift
let package = Package(
name: "SampleKit",
products: [
.library(
name: "SampleKit",
targets: ["SampleKit"]
)
],
dependencies: [
.package(url: "https://github.com/zunda-pixel/LicenseProvider", from: "1.4.0"),
],
targets: [
.target(
name: "SampleKit",
plugins: [
.plugin(name: "LicenseProviderPlugin", package: "LicenseProvider"),
]
)
]
)
import SwiftUI
struct LicenseView: View {
var body: some View {
NavigationStack {
List {
ForEach(LicenseProvider.packages) { package in
NavigationLink(package.name) {
VStack {
if case .remoteSourceControl(let location) = package.kind {
Link("URL", destination: location)
}
Text(package.license)
}
.navigationTitle(package.name)
}
}
}
}
}
}