forked from facebook/screenshot-tests-for-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (43 loc) · 1.53 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
FILES_WITH_VERSIONS = \
gradle.properties \
examples/app-example/build.gradle \
examples/app-example-androidjunitrunner/build.gradle \
plugin/src/main/groovy/com/facebook/testing/screenshot/build/ScreenshotsPlugin.groovy
OLD_VERSION=$(shell grep VERSION_NAME gradle.properties | cut -d '=' -f 2)
TMPFILE:=$(shell mktemp)
.PHONY:
@true
env-check:
@echo Checking if emulator or device is connected for tests
adb get-serialno
set-release:
[ x$(NEW_VERSION) != x ]
[ x$(OLD_VERSION) != x ]
for file in $(FILES_WITH_VERSIONS) ; do \
test -f $$file ; \
done
for file in $(FILES_WITH_VERSIONS) ; do \
sed -i 's/$(OLD_VERSION)/$(NEW_VERSION)/' $$file ; \
done
cleanup:
rm -rf ~/.m2/repository/com/facebook/testing/screenshot/
./gradlew clean
integration-tests: | env-check cleanup install-local app-example-tests app-example-androidjunitrunner-tests cleanup
@true
app-example-tests:
cd examples/app-example && ./gradlew connectedAndroidTest
cd examples/app-example && ./gradlew screenshotTests 2>&1 | tee $(TMPFILE)
grep "Found 3 screenshots" $(TMPFILE)
app-example-androidjunitrunner-tests:
cd examples/app-example-androidjunitrunner && ./gradlew screenshotTests 2>&1 | tee $(TMPFILE)
grep "Found 2 screenshots" $(TMPFILE)
install-local:
./gradlew :plugin:install
./gradlew :core:install
version-tag:
git tag v$(OLD_VERSION)
git push origin v$(OLD_VERSION)
prod-integration-tests: env-check
$(MAKE) cleanup
cd examples/app-example && ./gradlew connectedAndroidTest
cd examples/app-example && ./gradlew screenshotTests