forked from bazel-xcode/PodToBUILD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExample.Makefile
66 lines (53 loc) · 1.96 KB
/
Example.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
# This Makefile does some odd things to setup testing conditions
# and install Bazel.
# Please see the `README` for regular usage
RULES_PODS_DIR=$(shell echo $$(dirname $$(dirname $$PWD)))
BAZEL=../../tools/bazel
# Override the repository to point at the source. It does a source build of the
# current code.
# TODO: there's an issue with non hermetic headers in the PINRemoteImage example
REPOSITORY_OVERRIDE=--override_repository=rules_pods=$(RULES_PODS_DIR)
BAZEL_OPTS=$(REPOSITORY_OVERRIDE) \
--disk_cache=$(HOME)/Library/Caches/Bazel \
--spawn_strategy=local \
--features rules_pods.testing \
--apple_platform_type=ios
all: bootstrap pod_test fetch build
# Some examples require out of band loading
bootstrap:
[[ ! -x bootstrap.sh ]] || ./bootstrap.sh
# This command ensures that cocoapods is installed on the host
pod_test:
pod --version
# Build everything in this workspace
.PHONY: build
build: info
$(BAZEL) build :* $(BAZEL_OPTS)
.PHONY: app
app: info
$(BAZEL) build :ReactNativeApp $(BAZEL_OPTS)
test: info
$(BAZEL) test :* $(BAZEL_OPTS)
# Fetch vendored pods if there's a Pods.WORKSPACE. In normal operation it isn't
# expected to run `update_pods` along with a build.
#
# Generally, this would be ran when dependencies are updated, and then,
# dependencies _would_ be checked in.
vendorize:
$(BAZEL) run $(BAZEL_OPTS) @rules_pods//:update_pods -- --src_root $(PWD)
# The above is similar to running ../../bin/update_pods.py --src_root $(PWD)
# however, `rules_pods` is overriden
ditto $(RULES_PODS_DIR)/BazelExtensions Vendor/rules_pods/BazelExtensions
fetch: info
[[ ! -f Pods.WORKSPACE ]] || $(MAKE) vendorize
$(BAZEL) fetch :* $(REPOSITORY_OVERRIDE)
info:
$(BAZEL) info $(REPOSITORY_OVERRIDE)
update_xcodeproj:
[[ ! -d PodsHost ]] || rm -rf PodsHost
ditto ../.PodsHost PodsHost
pod install
# This command generates a workspace from a Podfile
gen_podfile_deps:
make -C ../../ build
[[ ! -f Podfile ]] ||../../bin/RepoTools generate_workspace > podfile_deps.py