forked from kylef/swiftenv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
22 lines (18 loc) · 891 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.PHONY: test
test: bats
@PATH="$$PWD/bats/bin:$$PWD/bin:$$PATH" bats test
.PHONY: test-integration
test-integration: bats
@PATH="$$PWD/bats/bin:$$PWD/bin:$$PWD/shims:$$PATH" SWIFTENV_ROOT="$$PWD" bats test/integration
bats:
git clone --depth 1 https://github.com/sstephenson/bats.git
CACHED_VERSIONS := \
4.1.3 4.2.4 \
5.0 5.0.1 5.0.2 5.0.3 \
5.1 5.2 5.2.1 5.2.2
CACHED_PATHS := $(foreach version,$(CACHED_VERSIONS),share/swiftenv-install/$(version))
versions: $(CACHED_PATHS)
share/swiftenv-install/%:
@echo Generating $*
@curl -o [email protected] https://swiftenv-api.fuller.li/versions/$*
@cat [email protected] | python -c "import json, sys; p = json.load(sys.stdin)['_links']; p = sorted([' \'{}\' )\n URL=\"{}\"\n ;;\n'.format(p, u['href']) for (p,u) in p.items() if p != 'self']); print('case \"%sPLATFORM\" in') % chr(36); print('\n'.join(p)); print(' * )\n ;;\nesac')" > $@