From 2c1500761dc91ca742ce73602615299e499d23ce Mon Sep 17 00:00:00 2001 From: "freddi(Yuki Aki)" Date: Tue, 13 Feb 2024 18:48:23 +0900 Subject: [PATCH] Support Artifact Bundle (#1388) * support artifact bundle * update CHANGELOG to exact PR * build ArtifactBundle only on macOS * update to copy SettingPresets into bundle * fix CHANGELOG.md * load Bundle.module * update ArtifactBundleGen * update ArtifactBundleGen to linux issue * fix unnecessary code * add lisence to bundle --- .gitignore | 1 + CHANGELOG.md | 3 +++ Makefile | 5 +++++ Package.resolved | 9 +++++++++ Package.swift | 4 +++- RELEASE.md | 4 ++-- Sources/XcodeGenKit/SettingPresets | 1 + Sources/XcodeGenKit/SettingsBuilder.swift | 3 +++ 8 files changed, 27 insertions(+), 3 deletions(-) create mode 120000 Sources/XcodeGenKit/SettingPresets diff --git a/.gitignore b/.gitignore index 1f55464b..cf9a40a5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ xcuserdata *.xcuserstate XcodeGen.xcodeproj xcodegen.zip +xcodegen.artifactbundle.zip .vscode/launch.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ab8fdd6..141a48c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Change Log ## Next Version +### Added + +- Support Artifact Bundle #1388 @freddi-kit ## 2.38.0 diff --git a/Makefile b/Makefile index 0e475b33..959be62a 100644 --- a/Makefile +++ b/Makefile @@ -48,3 +48,8 @@ brew: archive: build ./scripts/archive.sh "$(EXECUTABLE_PATH)" + swift package plugin --allow-writing-to-package-directory generate-artifact-bundle \ + --package-version $(VERSION) \ + --executable-name $(EXECUTABLE_NAME) \ + --build-config release \ + --include-resource-path LICENSE diff --git a/Package.resolved b/Package.resolved index b3231bf7..7c9e9d08 100644 --- a/Package.resolved +++ b/Package.resolved @@ -9,6 +9,15 @@ "version" : "4.6.1" } }, + { + "identity" : "artifactbundlegen", + "kind" : "remoteSourceControl", + "location" : "https://github.com/freddi-kit/ArtifactBundleGen", + "state" : { + "revision" : "707e4ccc4b1c7e48e881cd5ea91e493a95df24bf", + "version" : "0.0.6" + } + }, { "identity" : "graphviz", "kind" : "remoteSourceControl", diff --git a/Package.swift b/Package.swift index 00423603..bc66a795 100644 --- a/Package.swift +++ b/Package.swift @@ -20,8 +20,8 @@ let package = Package( .package(url: "https://github.com/jakeheis/SwiftCLI.git", from: "6.0.3"), .package(url: "https://github.com/mxcl/Version", from: "2.0.0"), .package(url: "https://github.com/SwiftDocOrg/GraphViz.git", exact: "0.2.0"), + .package(url: "https://github.com/freddi-kit/ArtifactBundleGen", exact: "0.0.6") ], - targets: [ .executableTarget(name: "XcodeGen", dependencies: [ "XcodeGenCLI", @@ -42,6 +42,8 @@ let package = Package( "PathKit", "XcodeGenCore", "GraphViz", + ], resources: [ + .copy("SettingPresets") ]), .target(name: "ProjectSpec", dependencies: [ "JSONUtilities", diff --git a/RELEASE.md b/RELEASE.md index 60e27d38..ebd890a8 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -7,5 +7,5 @@ 1. Run `make release` 1. Push commit and tag to github 1. Create release from tag on GitHub using the version number and relevant changelog contents -1. Run `make archive` and upload `xcodegen.zip` to the github release -1. Run `make brew` which will open a PR on homebrew core +1. Run `make archive` and upload `xcodegen.zip` and `xcodegen.artifactbundle.zip` to the github release +1. Run `make brew` which will open a PR on homebrew core \ No newline at end of file diff --git a/Sources/XcodeGenKit/SettingPresets b/Sources/XcodeGenKit/SettingPresets new file mode 120000 index 00000000..1137a5ea --- /dev/null +++ b/Sources/XcodeGenKit/SettingPresets @@ -0,0 +1 @@ +../../SettingPresets/ \ No newline at end of file diff --git a/Sources/XcodeGenKit/SettingsBuilder.swift b/Sources/XcodeGenKit/SettingsBuilder.swift index 69aadf6f..81047de7 100644 --- a/Sources/XcodeGenKit/SettingsBuilder.swift +++ b/Sources/XcodeGenKit/SettingsBuilder.swift @@ -249,6 +249,9 @@ extension SettingsPresetFile { symlink.parent() + relativePath, ] + possibleSettingsPaths } + if let moduleResourcePath = Bundle.module.path(forResource: "SettingPresets", ofType: nil) { + possibleSettingsPaths.append(Path(moduleResourcePath) + "\(path).yml") + } guard let settingsPath = possibleSettingsPaths.first(where: { $0.exists }) else { switch self {