-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
100 lines (79 loc) · 2.57 KB
/
justfile
File metadata and controls
100 lines (79 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
bundle_prefix := home_directory()
prefix := join(bundle_prefix, '.local')
bin := join(prefix, 'bin')
out := 'Out'
xcodeproj := 'gabber.xcodeproj'
xcodescheme := 'gabber'
xcconfig := 'project.xcconfig'
xcderived := join('DerivedData', 'gabber')
xcarchive := join(out, 'Gabber.xcarchive')
CI := env('GABBER_CI', 'false')
swiftlint_reporter := if CI == 'true' { 'github-actions-logging' } else { 'emoji' }
codesigning := if CI == 'true' { 'NO' } else { 'YES' }
default:
@just --list
_xcode config = 'Release' *args:
xcodebuild \
-project {{xcodeproj}} \
-scheme {{xcodescheme}} \
-configuration {{config}} \
-xcconfig {{xcconfig}} \
-derivedDataPath {{xcderived}} \
-skipPackagePluginValidation \
-skipMacroValidation \
CODE_SIGNING_ALLOWED={{codesigning}} \
CODE_SIGNING_REQUIRED={{codesigning}} \
{{args}}
_deps-xcode: (_xcode 'Debug' '-resolvePackageDependencies')
# Check formatting and linting
check: check-format check-lint
# Check linting
check-lint: check-lint-xcode check-lint-npm
# Check linting for XCode project
check-lint-xcode: _deps-xcode
./{{xcderived}}/SourcePackages/artifacts/swiftlintplugins/SwiftLintBinary/SwiftLintBinary.artifactbundle/macos/swiftlint \
--strict \
--reporter {{swiftlint_reporter}} \
gabber git-gabber
# Check linting for browser extension
check-lint-npm:
npm run lint
# Check formatting
check-format: check-format-swift check-format-other
# Check formatting for Swift files
check-format-swift:
swift format lint --recursive gabber git-gabber
# Check formatting for other files
check-format-other:
npx prettier --check .
# Run tests for extension
test-extension:
npm test
# Build the app
build config = 'Release': (_xcode config)
# Create XCode archive
archive config = 'Release': (_xcode config '-archivePath' xcarchive 'archive')
# Create a DMG from the archive
dmg: archive
hdiutil create \
-volname "Gabber" \
-srcfolder {{xcarchive}}/Products/Applications/Gabber.app \
-ov -format UDZO \
{{out}}/Gabber.dmg
# Install the app and git-gabber
install: archive
cp -r {{xcarchive}}/Products/Applications/Gabber.app {{bundle_prefix}}/Applications
install -m 755 {{xcarchive}}/Products/usr/local/bin/git-gabber {{bin}}/git-gabber
_out:
mkdir -p {{out}}
# Build the extension
extension: _out
npm run ext:build
# Sign the extension
sign-extension: _out
FIREFOX_API_KEY=$(cat .api-key) \
FIREFOX_API_SECRET=$(cat .api-secret) \
npm run ext:sign
# Clean up
clean:
rm -rf {{out}}