Skip to content

Commit

Permalink
Merge pull request #5 from cybozu/support-plugin
Browse files Browse the repository at this point in the history
Support BuiltToolPlugin
  • Loading branch information
Kyome22 authored Oct 4, 2022
2 parents dbc1453 + 2ac0635 commit 98ed6ad
Show file tree
Hide file tree
Showing 18 changed files with 213 additions and 681 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/dispatch-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: macos-12
timeout-minutes: 30
env:
DEVELOPER_DIR: "/Applications/Xcode_13.4.1.app/Contents/Developer"
DEVELOPER_DIR: "/Applications/Xcode_14.0.1.app/Contents/Developer"

steps:
- name: Checkout
Expand All @@ -21,14 +21,16 @@ jobs:
- name: Run SourcePackagesParserTests
run: |
xcodebuild -scheme spp test \
-only-testing:SourcePackagesParserTests \
-destination "platform=macOS,arch=x86_64" \
-resultBundlePath SourcePackagesParserTests | \
xcpretty -c && exit ${PIPESTATUS[0]}
- name: Run LicenseListTests
run: |
xcodebuild -scheme LicenseList-Package test \
-destination "platform=iOS Simulator,name=iPhone 13,OS=15.5" \
-only-testing:LicenseListTests \
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.0" \
-resultBundlePath LicenseListTests | \
xcpretty && exit ${PIPESTATUS[0]}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-artifact-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: macos-12
timeout-minutes: 20
env:
DEVELOPER_DIR: "/Applications/Xcode_13.4.1.app/Contents/Developer"
DEVELOPER_DIR: "/Applications/Xcode_14.0.1.app/Contents/Developer"
ARTIFACT_BUNDLE: "swift-packages-parser.artifactbundle"

steps:
Expand Down
76 changes: 25 additions & 51 deletions LicenseDemo/LicenseDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@
objects = {

/* Begin PBXBuildFile section */
18AC730228EBEE2800E64B96 /* LicenseList in Frameworks */ = {isa = PBXBuildFile; productRef = 18AC730128EBEE2800E64B96 /* LicenseList */; };
18E61A722872A66800C5A710 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18E61A712872A66800C5A710 /* AppDelegate.swift */; };
18E61A742872A66800C5A710 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18E61A732872A66800C5A710 /* SceneDelegate.swift */; };
18E61A762872A66800C5A710 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18E61A752872A66800C5A710 /* ViewController.swift */; };
18E61A792872A66800C5A710 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 18E61A772872A66800C5A710 /* Main.storyboard */; };
18E61A7B2872A66900C5A710 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 18E61A7A2872A66900C5A710 /* Assets.xcassets */; };
18E61A7E2872A66900C5A710 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 18E61A7C2872A66900C5A710 /* LaunchScreen.storyboard */; };
18E61A8C2872AB8C00C5A710 /* LicenseList in Frameworks */ = {isa = PBXBuildFile; productRef = 18E61A8B2872AB8C00C5A710 /* LicenseList */; };
18E61A942872AC5100C5A710 /* LicenseDemoForSwiftUIApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18E61A932872AC5100C5A710 /* LicenseDemoForSwiftUIApp.swift */; };
18E61A962872AC5100C5A710 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18E61A952872AC5100C5A710 /* ContentView.swift */; };
18E61A982872AC5300C5A710 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 18E61A972872AC5300C5A710 /* Assets.xcassets */; };
18E61A9B2872AC5300C5A710 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 18E61A9A2872AC5300C5A710 /* Preview Assets.xcassets */; };
18E61AA12872B05600C5A710 /* license-list.plist in Resources */ = {isa = PBXBuildFile; fileRef = 18E61AA02872B05600C5A710 /* license-list.plist */; };
18E61AA22872B05900C5A710 /* license-list.plist in Resources */ = {isa = PBXBuildFile; fileRef = 18E61AA02872B05600C5A710 /* license-list.plist */; };
18E61AA42872B13500C5A710 /* LicenseList in Frameworks */ = {isa = PBXBuildFile; productRef = 18E61AA32872B13500C5A710 /* LicenseList */; };
/* End PBXBuildFile section */

Expand All @@ -38,15 +36,14 @@
18E61A952872AC5100C5A710 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
18E61A972872AC5300C5A710 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
18E61A9A2872AC5300C5A710 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
18E61AA02872B05600C5A710 /* license-list.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "license-list.plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
18E61A6C2872A66800C5A710 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
18E61A8C2872AB8C00C5A710 /* LicenseList in Frameworks */,
18AC730228EBEE2800E64B96 /* LicenseList in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -64,7 +61,6 @@
181DFF4C2849FA1800B97329 = {
isa = PBXGroup;
children = (
18E61AA02872B05600C5A710 /* license-list.plist */,
181F97F7286C0F45003D756F /* Packages */,
18E61A702872A66800C5A710 /* LicenseDemoForUIKit */,
18E61A922872AC5100C5A710 /* LicenseDemoForSwiftUI */,
Expand Down Expand Up @@ -139,16 +135,16 @@
buildPhases = (
18E61A6B2872A66800C5A710 /* Sources */,
18E61A6C2872A66800C5A710 /* Frameworks */,
18E61A872872A90600C5A710 /* Parse SourcePackages */,
18E61A6D2872A66800C5A710 /* Resources */,
);
buildRules = (
);
dependencies = (
18B961FF28E6797C00A313B0 /* PBXTargetDependency */,
);
name = LicenseDemoForUIKit;
packageProductDependencies = (
18E61A8B2872AB8C00C5A710 /* LicenseList */,
18AC730128EBEE2800E64B96 /* LicenseList */,
);
productName = LicenseDemoForUIKit;
productReference = 18E61A6F2872A66800C5A710 /* LicenseDemoForUIKit.app */;
Expand All @@ -160,12 +156,12 @@
buildPhases = (
18E61A8D2872AC5100C5A710 /* Sources */,
18E61A8E2872AC5100C5A710 /* Frameworks */,
18E61AA52872B6AD00C5A710 /* Parse SourcePackages */,
18E61A8F2872AC5100C5A710 /* Resources */,
);
buildRules = (
);
dependencies = (
18B9620428E6EB9C00A313B0 /* PBXTargetDependency */,
);
name = LicenseDemoForSwiftUI;
packageProductDependencies = (
Expand Down Expand Up @@ -224,7 +220,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
18E61AA12872B05600C5A710 /* license-list.plist in Resources */,
18E61A7E2872A66900C5A710 /* LaunchScreen.storyboard in Resources */,
18E61A7B2872A66900C5A710 /* Assets.xcassets in Resources */,
18E61A792872A66800C5A710 /* Main.storyboard in Resources */,
Expand All @@ -237,51 +232,11 @@
files = (
18E61A9B2872AC5300C5A710 /* Preview Assets.xcassets in Resources */,
18E61A982872AC5300C5A710 /* Assets.xcassets in Resources */,
18E61AA22872B05900C5A710 /* license-list.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
18E61A872872A90600C5A710 /* Parse SourcePackages */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Parse SourcePackages";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "PACKAGE_PATH=\"${SRCROOT}/../\"\nSOURCE_PACKAGES_PATH=`echo ${BUILD_DIR%Build/*}SourcePackages`\n\n# build SourcePackagesParser\nxcrun --sdk macosx swift build -c release --package-path ${PACKAGE_PATH} --product spp\n\n# run SourcePackagesParser\n${PACKAGE_PATH}.build/release/spp ${SRCROOT} ${SOURCE_PACKAGES_PATH}\n";
};
18E61AA52872B6AD00C5A710 /* Parse SourcePackages */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Parse SourcePackages";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "PACKAGE_PATH=\"${SRCROOT}/../\"\nSOURCE_PACKAGES_PATH=`echo ${BUILD_DIR%Build/*}SourcePackages`\n\n# build SourcePackagesParser\nxcrun --sdk macosx swift build -c release --package-path ${PACKAGE_PATH} --product spp\n\n# run SourcePackagesParser\n${PACKAGE_PATH}.build/release/spp ${SRCROOT} ${SOURCE_PACKAGES_PATH}\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
18E61A6B2872A66800C5A710 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand All @@ -304,6 +259,17 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
18B961FF28E6797C00A313B0 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
productRef = 18B961FE28E6797C00A313B0 /* PrepareLicenseList */;
};
18B9620428E6EB9C00A313B0 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
productRef = 18B9620328E6EB9C00A313B0 /* PrepareLicenseList */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
18E61A772872A66800C5A710 /* Main.storyboard */ = {
isa = PBXVariantGroup;
Expand Down Expand Up @@ -634,10 +600,18 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
18E61A8B2872AB8C00C5A710 /* LicenseList */ = {
18AC730128EBEE2800E64B96 /* LicenseList */ = {
isa = XCSwiftPackageProductDependency;
productName = LicenseList;
};
18B961FE28E6797C00A313B0 /* PrepareLicenseList */ = {
isa = XCSwiftPackageProductDependency;
productName = "plugin:PrepareLicenseList";
};
18B9620328E6EB9C00A313B0 /* PrepareLicenseList */ = {
isa = XCSwiftPackageProductDependency;
productName = "plugin:PrepareLicenseList";
};
18E61AA32872B13500C5A710 /* LicenseList */ = {
isa = XCSwiftPackageProductDependency;
productName = LicenseList;
Expand Down
4 changes: 1 addition & 3 deletions LicenseDemo/LicenseDemoForSwiftUI/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ import SwiftUI
import LicenseList

struct ContentView: View {
let fileURL = Bundle.main.url(forResource: "license-list", withExtension: "plist")!

var body: some View {
NavigationView {
NavigationLink("License") {
LicenseListView(fileURL: fileURL)
LicenseListView()
.navigationTitle("LICENSE")
.navigationBarTitleDisplayMode(.inline)
}
Expand Down
3 changes: 1 addition & 2 deletions LicenseDemo/LicenseDemoForUIKit/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ class ViewController: UIViewController {
}

@IBAction func pushLicense(_ sender: Any) {
if let fileURL = Bundle.main.url(forResource: "license-list", withExtension: "plist") {
let vc = LicenseListViewController(fileURL: fileURL)
if let vc = LicenseListViewController() {
vc.title = "LICENSE"
navigationController?.pushViewController(vc, animated: true)
}
Expand Down
4 changes: 2 additions & 2 deletions LicenseDemo/Package.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// swift-tools-version:5.5
// swift-tools-version:5.6
import PackageDescription

let package = Package(
name: "",
products: [],
targets: []
)
)
Loading

0 comments on commit 98ed6ad

Please sign in to comment.