Skip to content

Commit 07a0f33

Browse files
authored
Update Makefile (#93)
1 parent 9cfd72d commit 07a0f33

File tree

4 files changed

+48
-70
lines changed

4 files changed

+48
-70
lines changed

.github/workflows/distribute.yml

+3-35
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Inject version
5252
run: ./Scripts/version
5353
- name: Build
54-
run: make build
54+
run: make build-macos
5555
- name: Upload binary
5656
uses: actions/upload-artifact@v2
5757
with:
@@ -77,40 +77,8 @@ jobs:
7777
run: ./Scripts/version
7878
- name: Install dependencies
7979
run: brew install xcodegen ldid
80-
- name: Generate Xcode project
81-
run: xcodegen -s ios-project.yml
82-
- name: Build archive
83-
run: |
84-
xcodebuild archive -scheme CLI \
85-
-sdk iphoneos \
86-
-configuration Release \
87-
-derivedDataPath .build \
88-
-archivePath .build/ipatool.xcarchive \
89-
CODE_SIGN_IDENTITY='' \
90-
CODE_SIGNING_REQUIRED=NO \
91-
CODE_SIGN_ENTITLEMENTS='' \
92-
CODE_SIGNING_ALLOWED=NO
93-
cp .build/ipatool.xcarchive/Products/Applications/CLI.app/CLI .build/ipatool
94-
- name: Fakesign executable
95-
run: |
96-
cat <<EOF >"$PWD/.build/entitlements.xml"
97-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
98-
<plist version="1.0">
99-
<dict>
100-
<key>keychain-access-groups</key>
101-
<array>
102-
<string>ipatool</string>
103-
</array>
104-
<key>application-identifier</key>
105-
<string>ipatool</string>
106-
<key>platform-application</key>
107-
<true />
108-
<key>com.apple.private.security.container-required</key>
109-
<false />
110-
</dict>
111-
</plist>
112-
EOF
113-
ldid -S.build/entitlements.xml ./.build/ipatool
80+
- name: Build
81+
run: make build-ios
11482
- name: Upload binary
11583
uses: actions/upload-artifact@v2
11684
with:

.github/workflows/dry-builds.yml

+5-30
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,14 @@ jobs:
2020
restore-keys: |
2121
${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }}
2222
${{ runner.os }}-spm-
23-
- name: Inject version
24-
run: ./Scripts/version
2523
- name: Install dependencies
2624
run: brew install xcodegen ldid
27-
- name: Generate Xcode project
28-
run: xcodegen -s ios-project.yml
29-
- name: Build archive
25+
- name: Inject version
26+
run: ./Scripts/version
27+
- name: Build
3028
run: |
31-
xcodebuild archive -scheme CLI \
32-
-sdk iphoneos \
33-
-configuration Release \
34-
-derivedDataPath .build \
35-
-archivePath .build/ipatool.xcarchive \
36-
CODE_SIGN_IDENTITY='' \
37-
CODE_SIGNING_REQUIRED=NO \
38-
CODE_SIGN_ENTITLEMENTS='' \
39-
CODE_SIGNING_ALLOWED=NO
40-
cp .build/ipatool.xcarchive/Products/Applications/CLI.app/CLI .build/ipatool
29+
make build-ios
4130
file .build/ipatool
42-
- name: Fakesign executable
43-
run: |
44-
cat <<EOF >"$PWD/.build/entitlements.xml"
45-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
46-
<plist version="1.0">
47-
<dict>
48-
<key>platform-application</key>
49-
<true />
50-
<key>com.apple.private.security.container-required</key>
51-
<false />
52-
</dict>
53-
</plist>
54-
EOF
55-
ldid -S.build/entitlements.xml ./.build/ipatool
5631
build_macos:
5732
name: Dry build (macOS)
5833
runs-on: macos-12
@@ -71,5 +46,5 @@ jobs:
7146
run: ./Scripts/version
7247
- name: Build
7348
run: |
74-
make build
49+
make build-macos
7550
file .build/ipatool

.github/workflows/integration-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Inject version
2727
run: ./Scripts/version
2828
- name: Build
29-
run: make build
29+
run: make build-macos
3030
- name: Upload binary
3131
uses: actions/upload-artifact@v2
3232
with:

Makefile

+39-4
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,57 @@
11
prefix ?= /usr/local
22
bindir = $(prefix)/bin
33

4+
define ios_entitlements
5+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
6+
<plist version="1.0">
7+
<dict>
8+
<key>keychain-access-groups</key>
9+
<array>
10+
<string>ipatool</string>
11+
</array>
12+
<key>application-identifier</key>
13+
<string>ipatool</string>
14+
<key>platform-application</key>
15+
<true />
16+
<key>com.apple.private.security.container-required</key>
17+
<false />
18+
</dict>
19+
</plist>
20+
endef
21+
422
lint:
523
swiftlint lint --config .swiftlint.yml --path Sources/ Tests/m Plugins/
624

7-
build: lint
25+
build-macos: lint
826
swift build -c release --arch arm64
927
swift build -c release --arch x86_64
1028
lipo -create -output .build/ipatool .build/arm64-apple-macosx/release/ipatool .build/x86_64-apple-macosx/release/ipatool
1129

12-
install: build
30+
build-ios: lint
31+
xcodegen -s ios-project.yml
32+
xcodebuild archive -scheme CLI \
33+
-sdk iphoneos \
34+
-configuration Release \
35+
-derivedDataPath .build \
36+
-archivePath .build/ipatool.xcarchive \
37+
CODE_SIGN_IDENTITY='' \
38+
CODE_SIGNING_REQUIRED=NO \
39+
CODE_SIGN_ENTITLEMENTS='' \
40+
CODE_SIGNING_ALLOWED=NO
41+
cp .build/ipatool.xcarchive/Products/Applications/CLI.app/CLI .build/ipatool
42+
echo "$$ios_entitlements" > "${PWD}/.build/entitlements.xml"
43+
ldid -S.build/entitlements.xml ./.build/ipatool
44+
45+
install-macos: build
1346
install -d "$(bindir)"
1447
install ".build/ipatool" "$(bindir)"
1548

16-
uninstall:
49+
uninstall-macos:
1750
rm -rf "$(bindir)/ipatool"
1851

1952
clean:
2053
rm -rf .build
2154

22-
.PHONY: build install uninstall clean
55+
.PHONY: build-macos install-macos uninstall-macos clean
56+
57+
export ios_entitlements

0 commit comments

Comments
 (0)