Skip to content

Commit

Permalink
revamp swift build
Browse files Browse the repository at this point in the history
  • Loading branch information
gyf304 committed Feb 16, 2021
1 parent baf3a10 commit df21d80
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 341 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ jobs:
- uses: actions/checkout@v2
- name: Build
run: make
- uses: actions/upload-artifact@v2
with:
path: build/vmcli
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
xcuserdata
/build
.build
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ all: build/vmcli build/vmctl
build:
mkdir -p build

build/vmcli: build vmcli/main.swift vmcli/vmcli.entitlements
xcodebuild -project vmcli.xcodeproj -scheme vmcli -configuration Release
cp "$(shell xcodebuild -project vmcli.xcodeproj -scheme vmcli -configuration Release -showBuildSettings | grep TARGET_BUILD_DIR | cut -d = -f 2- | cut -d ' ' -f 2)/vmcli" build/vmcli
build/vmcli: build vmcli/Sources/vmcli/main.swift vmcli/Package.swift
cd vmcli && swift build -c release --arch arm64 --arch x86_64
cp vmcli/.build/apple/Products/Release/vmcli build/vmcli
codesign -s - --entitlements vmcli/vmcli.entitlements build/vmcli
chmod +x build/vmcli

build/vmctl: build vmctl/vmctl.sh
Expand Down
321 changes: 0 additions & 321 deletions vmcli.xcodeproj/project.pbxproj

This file was deleted.

7 changes: 0 additions & 7 deletions vmcli.xcodeproj/project.xcworkspace/contents.xcworkspacedata

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "92646c0cdbaca076c8d3d0207891785b3379cbff",
"version": "0.3.1"
"revision": "9564d61b08a5335ae0a36f789a7d71493eacadfc",
"version": "0.3.2"
}
}
]
Expand Down
22 changes: 22 additions & 0 deletions vmcli/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "dealer",
platforms: [
.macOS(.v11),
],
products: [
.executable(name: "vmcli", targets: ["vmcli"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.3.0"),
],
targets: [
.target(name: "vmcli", dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
]),
]
)
File renamed without changes.

0 comments on commit df21d80

Please sign in to comment.