Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
114 lines (95 loc) · 4.92 KB
/
Copy pathMakefile
File metadata and controls
114 lines (95 loc) · 4.92 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
.PHONY: all build test test-stable test-all test-e2e generate resolve update-packages clean lint debug-install release-install release-dmg sync-homebrew-cask release
SCHEME = MFuse
APP_NAME = MFuse
DEBUG_DERIVED_DATA = DerivedData
DEBUG_APP_PATH = $(DEBUG_DERIVED_DATA)/Build/Products/Debug/$(APP_NAME).app
RELEASE_INSTALL_DERIVED_DATA = build/release-install-derived-data
RELEASE_INSTALL_APP_PATH = $(RELEASE_INSTALL_DERIVED_DATA)/Build/Products/Release/$(APP_NAME).app
RELEASE_INSTALL_STAGING_PATH = build/release-install-staging/$(APP_NAME).app
# Same derivation as scripts/release/release-from-git-version.sh.
COMMIT_COUNT = $(shell git rev-list --count HEAD)
RELEASE_MARKETING_VERSION = $(or $(MFUSE_BASE_VERSION),1.0).$(COMMIT_COUNT)
CODESIGN_FLAGS = CODE_SIGN_IDENTITY="-" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
LOCAL_PROJECT_SPEC = project.local.yml
XCODEGEN_ENV =
ifneq ($(wildcard $(LOCAL_PROJECT_SPEC)),)
XCODEGEN_ENV := INCLUDE_PROJECT_LOCAL_YML=1
endif
all: build test-stable
build:
xcodebuild -scheme $(SCHEME) build $(CODESIGN_FLAGS)
test: test-stable
# Stable local/default smoke-test subset.
# Intentionally excludes MFuseCore and other broader suites; use `make test-all`
# for the full verification matrix.
test-stable:
cd Packages/MFuseWebDAV && swift test
cd Packages/MFuseSMB && swift test
cd Packages/MFuseNFS && swift test
cd Packages/MFuseGoogleDrive && swift test
cd Packages/MFuseDropbox && swift test
cd Packages/MFuseOneDrive && swift test
# Full verification matrix intended for CI and exhaustive validation.
test-all:
cd Packages/MFuseWebDAV && swift test
cd Packages/MFuseSMB && swift test
cd Packages/MFuseNFS && swift test
cd Packages/MFuseGoogleDrive && swift test
cd Packages/MFuseDropbox && swift test
cd Packages/MFuseOneDrive && swift test
cd Packages/MFuseCore && swift test
cd Packages/MFuseFTP && swift test
cd Packages/MFuseSFTP && swift test
cd Packages/MFuseS3 && swift test
# End-to-end tests of every backend against real servers (see scripts/e2e/setup-vm.sh).
# Server addresses and credentials come from E2E_ENV, which stays outside the repo.
E2E_ENV ?= $(HOME)/.config/mfuse/e2e.env
test-e2e:
@test -f "$(E2E_ENV)" || (echo "test-e2e needs $(E2E_ENV) with the MFUSE_E2E_* settings; see scripts/e2e/setup-vm.sh." >&2; exit 1)
set -a && . "$(E2E_ENV)" && set +a && cd Packages/MFuseE2E && swift test
generate:
$(XCODEGEN_ENV) xcodegen generate
# The app's package versions are pinned in XCODE_PACKAGE_RESOLVED. Dependabot only updates
# the lockfiles next to each Package.swift, which Xcode ignores.
XCODE_PACKAGE_RESOLVED = MFuse.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
# Brings the app's lockfile in line with the manifests, keeping every pin that still fits.
resolve:
xcodebuild -resolvePackageDependencies -project MFuse.xcodeproj -scheme $(SCHEME)
# Moves every app dependency to the newest version its manifest allows.
update-packages:
rm -f $(XCODE_PACKAGE_RESOLVED)
$(MAKE) resolve
clean:
xcodebuild -scheme $(SCHEME) clean
rm -rf DerivedData .build
lint:
swiftlint
# Deliberately does NOT pass $(CODESIGN_FLAGS): an ad-hoc signed bundle has no team
# identifier, so the File Provider extension never registers with the system
# (`pluginkit` cannot see it) and no domain can be mounted. Installing a debug build
# that is useful for testing requires real signing, which comes from project.local.yml.
debug-install: generate
xcodebuild -scheme $(SCHEME) -configuration Debug -derivedDataPath $(DEBUG_DERIVED_DATA) build
rm -rf /Applications/$(APP_NAME).app
ditto $(DEBUG_APP_PATH) /Applications/$(APP_NAME).app
# A Release build installed locally, signed the way `make release` signs it (Developer ID
# and the Release profiles from project.local.yml, hardened runtime) so problems that only
# show up in a release build can be reproduced without archiving, notarizing or publishing.
release-install: generate
xcodebuild -scheme $(SCHEME) -configuration Release -derivedDataPath $(RELEASE_INSTALL_DERIVED_DATA) -onlyUsePackageVersionsFromResolvedFile build \
MARKETING_VERSION="$(RELEASE_MARKETING_VERSION)" \
CURRENT_PROJECT_VERSION="$(COMMIT_COUNT)" \
OTHER_CODE_SIGN_FLAGS="--options runtime"
# Copied to a staging path first, so a failed copy leaves the installed app in place;
# staged outside /Applications so Launch Services never registers a second copy.
rm -rf $(RELEASE_INSTALL_STAGING_PATH)
ditto $(RELEASE_INSTALL_APP_PATH) $(RELEASE_INSTALL_STAGING_PATH)
rm -rf /Applications/$(APP_NAME).app
mv $(RELEASE_INSTALL_STAGING_PATH) /Applications/$(APP_NAME).app
release-dmg:
@test -n "$(XCARCHIVE_PATH)" || (echo "release-dmg requires XCARCHIVE_PATH. Example: XCARCHIVE_PATH=/abs/path/to/MFuse.xcarchive make release-dmg; this target calls scripts/release/package-dmg-from-xcarchive.sh." >&2; exit 1)
bash scripts/release/package-dmg-from-xcarchive.sh
sync-homebrew-cask:
bash scripts/release/sync-homebrew-cask.sh
release:
bash scripts/release/release-from-git-version.sh