diff --git a/.setup/Package.resolved b/.setup/Package.resolved deleted file mode 100644 index 5c34cb9..0000000 --- a/.setup/Package.resolved +++ /dev/null @@ -1,52 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "PathKit", - "repositoryURL": "https://github.com/kylef/PathKit", - "state": { - "branch": null, - "revision": "73f8e9dca9b7a3078cb79128217dc8f2e585a511", - "version": "1.0.0" - } - }, - { - "package": "ShellOut", - "repositoryURL": "https://github.com/JohnSundell/ShellOut.git", - "state": { - "branch": null, - "revision": "4ebf25863deb9c3c02696704fc3d39736183f258", - "version": "2.2.1" - } - }, - { - "package": "Spectre", - "repositoryURL": "https://github.com/kylef/Spectre.git", - "state": { - "branch": null, - "revision": "f14ff47f45642aa5703900980b014c2e9394b6e5", - "version": "0.9.0" - } - }, - { - "package": "SwiftHamcrest", - "repositoryURL": "https://github.com/nschum/SwiftHamcrest", - "state": { - "branch": null, - "revision": "53e322984e000deefd3a5efaa777a7365c51aac9", - "version": "2.2.1" - } - }, - { - "package": "Version", - "repositoryURL": "https://github.com/mxcl/Version.git", - "state": { - "branch": null, - "revision": "682f0da36005924672506b96fac93269831004b7", - "version": "1.1.1" - } - } - ] - }, - "version": 1 -} diff --git a/.setup/Package.swift b/.setup/Package.swift deleted file mode 100644 index 531378c..0000000 --- a/.setup/Package.swift +++ /dev/null @@ -1,26 +0,0 @@ -// swift-tools-version:5.3 - -import PackageDescription - -let package = Package( - name: "RepoConfiguratorSetup", - platforms: [ - .macOS(.v10_11), - ], - products: [ - .executable( - name: "RepoConfiguratorSetup", - targets: ["RepoConfiguratorSetup"] - ) - ], - dependencies: [ - .package(name: "XCERepoConfigurator", path: "./../") - ], - targets: [ - .target( - name: "RepoConfiguratorSetup", - dependencies: ["XCERepoConfigurator"], - path: "Setup" - ) - ] -) diff --git a/.setup/Setup/main.swift b/.setup/Setup/main.swift deleted file mode 100644 index 86be3b6..0000000 --- a/.setup/Setup/main.swift +++ /dev/null @@ -1,211 +0,0 @@ -import PathKit - -import XCERepoConfigurator - -// MARK: - PRE-script invocation output - -print("\n") -print("--- BEGIN of '\(Executable.name)' script ---") - -// MARK: - - -// MARK: Parameters - -Spec.BuildSettings.swiftVersion.value = "5.0" - -let localRepo = try Spec.LocalRepo.current() - -let remoteRepo = try Spec.RemoteRepo( - accountName: localRepo.context, - name: localRepo.name -) - -let company = try Spec.Company( - prefix: "XCE", - identifier: "com.\(remoteRepo.accountName)" -) - -let project = ( - name: remoteRepo.name, - summary: "Generate repo config files using Swift and Xcode.", - copyrightYear: 2018 -) - -let productName = company.prefix + project.name - -let authors = [ - ("Maxim Khatskevich", "maxim@khatskevi.ch") -] - -// swift-package-manager -let desktop = ".macOS(.v10_11)" // DeploymentTarget = (.macOS, "10.11") - -typealias PerSubSpec = ( - core: T, - tests: T -) - -let subSpecs: PerSubSpec = ( - "Core", - "AllTests" -) - -let targetNames: PerSubSpec = ( - productName, - productName + subSpecs.tests -) - -let sourcesLocations: PerSubSpec = ( - Spec.Locations.sources + subSpecs.core, - Spec.Locations.tests + subSpecs.tests -) - -// MARK: Parameters - Summary - -remoteRepo.report() -company.report() - -// MARK: - - -// MARK: Write - ReadMe - -try ReadMe() - .addGitHubLicenseBadge( - account: company.name, - repo: project.name - ) - .addGitHubTagBadge( - account: company.name, - repo: project.name - ) - .addSwiftPMCompatibleBadge() - .addWrittenInSwiftBadge( - version: Spec.BuildSettings.swiftVersion.value - ) - .addStaticShieldsBadge( - "platforms", - status: "macOS", - color: "blue", - title: "Supported platforms", - link: "Package.swift" - ) - .add(""" - [![CI](https://github.com/\(remoteRepo.accountName)/\(remoteRepo.name)/actions/workflows/ci.yml/badge.svg)](https://github.com/\(remoteRepo.accountName)/\(remoteRepo.name)/actions/workflows/ci.yml) - """ - ) - .add(""" - - # \(project.name) - - \(project.summary) - - """ - ) - .prepare( - removeRepeatingEmptyLines: false - ) - .writeToFileSystem( - ifFileExists: .skip - ) - -// MARK: Write - License - -try License - .MIT( - copyrightYear: UInt(project.copyrightYear), - copyrightEntity: authors.map{ $0.0 }.joined(separator: ", ") - ) - .prepare() - .writeToFileSystem() - -// MARK: Write - GitHub - PagesConfig - -try GitHub - .PagesConfig() - .prepare() - .writeToFileSystem() - -// MARK: Write - GitHub - Actions Workflow - -try GitHub.Actions.Workflow - .standard( - name: "CI", - branches: ["main", "master"] - ) - .prepare() - .writeToFileSystem() - -// MARK: Write - Git - .gitignore - -try Git - .RepoIgnore() - .addMacOSSection() - .addCocoaSection() - .addSwiftPackageManagerSection(ignoreSources: true) - .add( - """ - # we don't need to store project file, - # as we generate it on-demand - *.\(Xcode.Project.extension) - """ - ) - .prepare() - .writeToFileSystem() - -// MARK: Write - Package.swift - -try CustomTextFile(""" - // swift-tools-version:\(Spec.BuildSettings.swiftVersion.value) - - import PackageDescription - - let package = Package( - name: "\(productName)", - platforms: [ - \(desktop), - ], - products: [ - .library( - name: "\(productName)", - targets: [ - "\(targetNames.core)" - ] - ) - ], - dependencies: [ - .package(url: "https://github.com/kylef/PathKit", from: "1.0.0"), - .package(url: "https://github.com/mxcl/Version.git", from: "1.0.0"), - .package(url: "https://github.com/JohnSundell/ShellOut.git", from: "2.0.0"), - .package(url: "https://github.com/nschum/SwiftHamcrest", from: "2.2.1") - ], - targets: [ - .target( - name: "\(targetNames.core)", - dependencies: [ - "Version", - "PathKit", - "ShellOut" - ], - path: "\(sourcesLocations.core)" - ), - .testTarget( - name: "\(targetNames.tests)", - dependencies: [ - "\(targetNames.core)", - "Version", - "SwiftHamcrest" - ], - path: "\(sourcesLocations.tests)" - ), - ] - ) - """ - ) - .prepare( - at: ["Package.swift"] - ) - .writeToFileSystem() - -// MARK: - POST-script invocation output - -print("--- END of '\(Executable.name)' script ---") diff --git a/README.md b/README.md index 13aa427..d979f9c 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -[![GitHub License](https://img.shields.io/github/license/XCEssentials/RepoConfigurator.svg?longCache=true)](LICENSE) -[![GitHub Tag](https://img.shields.io/github/tag/XCEssentials/RepoConfigurator.svg?longCache=true)](https://github.com/XCEssentials/RepoConfigurator/tags) +[![GitHub License](https://img.shields.io/github/license/XCEssentials/XCERepoConfigurator.svg?longCache=true)](LICENSE) +[![GitHub Tag](https://img.shields.io/github/tag/XCEssentials/XCERepoConfigurator.svg?longCache=true)](https://github.com/XCEssentials/XCERepoConfigurator/tags) [![Swift Package Manager Compatible](https://img.shields.io/badge/SPM-compatible-brightgreen.svg?longCache=true)](Package.swift) [![Written in Swift](https://img.shields.io/badge/Swift-5.9-orange.svg?longCache=true)](https://swift.org) [![Supported platforms](https://img.shields.io/badge/platforms-macOS-blue.svg?longCache=true)](Package.swift) -[![CI](https://github.com/XCEssentials/RepoConfigurator/actions/workflows/ci.yml/badge.svg)](https://github.com/XCEssentials/RepoConfigurator/actions/workflows/ci.yml) +[![CI](https://github.com/XCEssentials/XCERepoConfigurator/actions/workflows/ci.yml/badge.svg)](https://github.com/XCEssentials/XCERepoConfigurator/actions/workflows/ci.yml) -# RepoConfigurator +# XCERepoConfigurator Generate repo config files using Swift and Xcode. @@ -53,7 +53,3 @@ This is run **manually** by the developer — when bootstrapping a new project, ## Remember Most of the initializers have some parameters with default values, look into sources to discover all available parameters to configure output file according to your needs. - -## Development - -This repo uses itself for generating various infrastructure files in the repo, so go to `.setup` folder and run the SPM script located there by executing `swift run`.