Skip to content

Commit bf3c6df

Browse files
committed
chore: improve build flow in Makefiles
Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
1 parent 7122ecd commit bf3c6df

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
SHELL := /bin/bash
22

3+
check-program = $(foreach exec,$(1),$(if $(shell PATH="$(PATH)" which $(exec)),,$(error "Missing deps: no '$(exec)' in PATH")))
4+
35
# Get the temporary directory of the system
46
TEMPDIR := $(shell dirname $(shell mktemp -u))
57

@@ -39,9 +41,12 @@ all build: generate build.ios build.android
3941

4042
# Build iOS framework
4143
build.ios: generate $(gnocore_xcframework)
44+
cd $(react_native_dir); $(MAKE) node_modules
45+
cd $(react_native_dir); $(MAKE) ios/Berty.xcworkspace
4246

4347
# Build Android aar & jar
4448
build.android: generate $(gnocore_aar) $(gnocore_jar)
49+
cd $(react_native_dir); $(MAKE) node_modules
4550

4651
# Clean all generated files
4752
clean: bind.clean
@@ -101,3 +106,17 @@ _bind.clean.android:
101106
bind.clean: _bind.clean.ios _bind.clean.android
102107
rm -rf $(bind_init_files)
103108

109+
# - asdf
110+
111+
asdf.add_plugins:
112+
$(call check-program, asdf)
113+
@echo "Installing asdf plugins..."
114+
@set -e; \
115+
for PLUGIN in $$(cut -d' ' -f1 .tool-versions | grep "^[^\#]"); do \
116+
asdf plugin add $$PLUGIN || [ $$?==2 ] || exit 1; \
117+
done
118+
119+
asdf.install_tools: asdf.add_plugins
120+
$(call check-program, asdf)
121+
@echo "Installing asdf tools..."
122+
@asdf install

gnoboard/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ node_modules: package.json yarn.lock
99
(yarn && touch $@) || true
1010
.PHONY: node_modules
1111

12+
ios/Berty.xcworkspace: ios/Berty.xcodeproj ios/Podfile node_modules
13+
$(call check-program, bundle)
14+
cd ios && pod install --repo-update
15+
touch $@
16+
.PHONY: ios/Berty.xcworkspace
17+
1218
# - Helpers
1319

1420
android.reverse_tcp:

0 commit comments

Comments
 (0)