Skip to content

zunda-pixel/LicenseProvider

Repository files navigation

LicensePlugin

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)
          }
        }
      }
    }
  }
}

About

Generate License List that Project depends on.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages