-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
166 lines (136 loc) · 6.22 KB
/
makefile
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Set PLATFORM var, if needed
ifeq ($(PLATFORM),)
ifeq ($(OS),Windows_NT)
PLATFORM=windows
else
UNAME := $(shell uname -s)
ifeq ($(UNAME),Linux)
PLATFORM=linux
endif
ifeq ($(UNAME),Darwin)
PLATFORM=macos
endif
endif
endif
FLUTTER_BIN?=flutter
.PHONY: build
build: build-$(PLATFORM) # Build for PLATFORM or the host OS
.PHONY: build-all
build-all: build-windows build-linux build-macos
.PHONY: build-windows
build-windows:
[ -d bin ] || mkdir -p bin
GOOS=windows GOARCH=amd64 go build -ldflags '-s' -o bin/x86_64-windows-bugsnag-cli.exe main.go
GOOS=windows GOARCH=386 go build -ldflags '-s' -o bin/i386-windows-bugsnag-cli.exe main.go
.PHONY: build-linux
build-linux:
[ -d bin ] || mkdir -p bin
GOOS=linux GOARCH=amd64 go build -ldflags '-s' -o bin/x86_64-linux-bugsnag-cli main.go
GOOS=linux GOARCH=386 go build -ldflags '-s' -o bin/i386-linux-bugsnag-cli main.go
.PHONY: build-macos
build-macos:
[ -d bin ] || mkdir -p bin
GOOS=darwin GOARCH=amd64 go build -ldflags '-s' -o bin/x86_64-macos-bugsnag-cli main.go
GOOS=darwin GOARCH=arm64 go build -ldflags '-s' -o bin/arm64-macos-bugsnag-cli main.go
.PHONY: fmt
fmt:
gofmt -w ./
.PHONY: unit-tests
unit-test:
go install github.com/gotesttools/gotestfmt/v2/cmd/[email protected]
go test -race -json -v ./test/... 2>&1 | tee /tmp/gotest.log | gotestfmt
.PHONY: npm-lint
npm-lint:
npm i && npm install -g npm-check && npm-check
.PHONY: go-lint
go-lint:
go install github.com/golangci/golangci-lint/cmd/[email protected]
golangci-lint run
.PHONY: bump
bump:
ifneq ($(shell git diff --staged),)
@git diff --staged
@$(error You have uncommitted changes. Push or discard them to continue)
endif
@./scripts/bump-version.sh $(VERSION)
.PHONY: test-fixtures
test-fixtures: features/base-fixtures/android features/base-fixtures/dart features/base-fixtures/rn0_69 features/base-fixtures/rn0_70 features/base-fixtures/rn0_72
.PHONY: features/base-fixtures/android
features/base-fixtures/android:
cd $@ && ./gradlew bundleRelease
.PHONY: features/base-fixtures/dart
features/base-fixtures/dart:
cd $@ && $(FLUTTER_BIN) pub get
cd $@ && $(FLUTTER_BIN) build apk --suppress-analytics --split-debug-info=app-debug-info
cd $@ && $(FLUTTER_BIN) build ios --no-codesign --suppress-analytics --no-tree-shake-icons --split-debug-info=app-debug-info
.PHONY: features/base-fixtures/dsym
features/base-fixtures/dsym:
bundle install
cd $@ && xcrun xcodebuild -allowProvisioningUpdates -scheme dSYM-Example -resolvePackageDependencies
cd $@ && xcrun xcodebuild -allowProvisioningUpdates -scheme dSYM-Example -configuration Release -quiet build GCC_TREAT_WARNINGS_AS_ERRORS=YES
.PHONY: features/base-fixtures/dsym/archive
features/base-fixtures/dsym/archive:
bundle install
cd features/base-fixtures/dsym && bundle install
cd features/base-fixtures/dsym && xcrun xcodebuild -allowProvisioningUpdates -scheme dSYM-Example -resolvePackageDependencies
cd features/base-fixtures/dsym && xcrun xcodebuild -scheme dSYM-Example -configuration Release -allowProvisioningUpdates archive
.PHONY: features/base-fixtures/rn0_69
features/base-fixtures/rn0_69: features/base-fixtures/rn0_69/android features/base-fixtures/rn0_69/ios
.PHONY: features/base-fixtures/rn0_70
features/base-fixtures/rn0_70: features/base-fixtures/rn0_70/android features/base-fixtures/rn0_70/ios
.PHONY: features/base-fixtures/rn0_72
features/base-fixtures/rn0_72: features/base-fixtures/rn0_72/android features/base-fixtures/rn0_72/ios
.PHONY: features/base-fixtures/rn0_69/android
features/base-fixtures/rn0_69/android:
cd $@/../ && npm i
cd $@ && ./gradlew bundleRelease
.PHONY: features/base-fixtures/rn0_69/ios
features/base-fixtures/rn0_69/ios:
cd $@/../ && npm i
cd $@ && bundle install
cd $@ && bundle exec pod install --repo-update
cd $@ && xcodebuild -workspace rn0_69.xcworkspace -scheme rn0_69 -configuration Release -sdk iphoneos build
.PHONY: features/base-fixtures/rn0_69/ios/archive
features/base-fixtures/rn0_69/ios/archive:
cd features/base-fixtures/rn0_69/ && npm i
cd features/base-fixtures/rn0_69/ios/ && bundle install
cd features/base-fixtures/rn0_69/ios/ && bundle exec pod install --repo-update
cd features/base-fixtures/rn0_69/ios/ && xcrun xcodebuild -scheme rn0_69 -workspace rn0_69.xcworkspace -configuration Release -archivePath "../rn0_69.xcarchive" -allowProvisioningUpdates archive
.PHONY: features/base-fixtures/rn0_70/android
features/base-fixtures/rn0_70/android:
cd $@/../ && npm i
cd $@ && ./gradlew bundleRelease
.PHONY: features/base-fixtures/rn0_70/ios
features/base-fixtures/rn0_70/ios:
cd $@/../ && npm i
cd $@ && bundle install
cd $@ && bundle exec pod install --repo-update
cd $@ && xcodebuild -workspace rn0_70.xcworkspace -scheme rn0_70 -configuration Release -sdk iphoneos build
.PHONY: features/base-fixtures/rn0_70/ios/archive
features/base-fixtures/rn0_70/ios/archive:
cd features/base-fixtures/rn0_70/ && npm i
cd features/base-fixtures/rn0_70/ios/ && bundle install
cd features/base-fixtures/rn0_70/ios/ && bundle exec pod install --repo-update
cd features/base-fixtures/rn0_70/ios/ && xcrun xcodebuild -scheme rn0_70 -workspace rn0_70.xcworkspace -configuration Release -archivePath "../rn0_70.xcarchive" -allowProvisioningUpdates archive
.PHONY: features/base-fixtures/rn0_72/android
features/base-fixtures/rn0_72/android:
cd $@/../ && npm i
cd $@ && ./gradlew bundleRelease
.PHONY: features/base-fixtures/rn0_72/ios
features/base-fixtures/rn0_72/ios:
cd $@/../ && npm i
cd $@ && bundle install
cd $@ && bundle exec pod install --repo-update
cd $@ && xcodebuild -workspace rn0_72.xcworkspace -scheme rn0_72 -configuration Release -sdk iphoneos build
.PHONY: features/base-fixtures/rn0_72/ios/archive
features/base-fixtures/rn0_72/ios/archive:
cd features/base-fixtures/rn0_72/ && npm i
cd features/base-fixtures/rn0_72/ios && bundle install
cd features/base-fixtures/rn0_72/ios/ && bundle exec pod install --repo-update
cd features/base-fixtures/rn0_72/ios/ && xcrun xcodebuild -scheme rn0_72 -workspace rn0_72.xcworkspace -configuration Release -archivePath "../rn0_72.xcarchive" -allowProvisioningUpdates archive
.PHONY: features/base-fixtures/js-webpack4
features/base-fixtures/js-webpack4:
cd $@ && npm i && npm run build
.PHONY: features/base-fixtures/js-webpack5
features/base-fixtures/js-webpack5:
cd $@ && npm i && npm run build