1
+ debug :
2
+ ./gradlew :unity-ads:assembleDebug
3
+
1
4
release :
2
5
./gradlew :unity-ads:assembleRelease
3
6
4
7
clean :
5
8
./gradlew :unity-ads:clean
6
9
7
- test : test-hosted
10
+ coverage :
11
+ ./gradlew -i jacocoTestReport --debug
8
12
9
- test-local : push- test-server-address exec-tests
13
+ coverage-ci : debug test-ci coverage
10
14
11
- test-unit-tests : push-test-server-address exec-unit-tests
15
+ zip : release
16
+ cp unity-ads/build/outputs/aar/unity-ads-release.aar unity-ads.aar
17
+ zip -9r unity-ads.aar.zip unity-ads.aar
18
+ rm unity-ads.aar
12
19
13
- build-test-apk : clean
14
- ./gradlew :unity-ads:assembleAndroidTest --full-stacktrace
20
+ javadoc :
21
+ ./gradlew :unity-ads:javadoc
15
22
16
- test-emulator : exec-tests
23
+ device-connected :
24
+ adb get-state 1> /dev/null 2>&1 && echo ' Device Attached' && exit 0 || echo ' Device NOT Attached' && exit -1
17
25
18
- test-hosted : push-test-server-address-hosted exec-tests
26
+ wake-up-device :
27
+ scripts/wakeUpDevice.sh
19
28
20
- test-usb : push-test-server-address-local setup-adb-reverse exec-only-unit- tests dismantle-adb-reverse
29
+ test : device-connected wake-up-device run-all- tests
21
30
22
- exec-tests : exec-unit-tests exec-hybrid -tests
31
+ test-local : device-connected wake-up-device push-test-server-address-ip run-all -tests
23
32
24
- exec-unit-tests : clean
25
- adb shell input keyevent 82
26
- ./gradlew :unity-ads:connectedCheck --full-stacktrace -Pandroid.testInstrumentationRunnerArguments.class=com.unity3d.ads.test.LegacyTestSuite
33
+ test-local-webview-staging : device-connected wake-up-device push-test-server-address-staging run-all-tests
27
34
28
- exec-hybrid-tests : clean
29
- adb shell input keyevent 82
30
- ./gradlew :unity-ads:connectedCheck --full-stacktrace -Pandroid.testInstrumentationRunnerArguments.class=com.unity3d.ads.test.HybridTestSuite
35
+ test-local-staging-localhost : device-connected wake-up-device push-test-server-address-localhost run-all-tests
31
36
32
- push-test-server-address :
33
- echo https://$(shell ifconfig |grep "inet" |grep -E -o "([0-9]{1,3}[\.]) {3}[0-9]{1,3}" |grep -v -E " ^0| ^127" -m 1):8080 > testServerAddress.txt
34
- adb push testServerAddress.txt /data/local/tmp
37
+ run-all-tests : test-instrumentation test-legacy test-integration
35
38
36
- push-test-server-address-hosted :
37
- echo " https://unity-ads-test-server.unityads.unity3d.com" > testServerAddress.txt
38
- adb push testServerAddress.txt /data/local/tmp
39
+ test-ci :
40
+ ./gradlew connectedDebugAndroidTest -i -w --stacktrace -Pandroid.testInstrumentationRunnerArguments.class=com.unity3d.ads.test.InstrumentationTestSuite,com.unity3d.ads.test.LegacyTestSuite
39
41
40
- push-test-server-address-local :
41
- echo " https://localhost:8080" > testServerAddress.txt
42
- adb push testServerAddress.txt /data/local/tmp
42
+ test-instrumentation :
43
+ ./gradlew connectedDebugAndroidTest -i -w --stacktrace -Pandroid.testInstrumentationRunnerArguments.class=com.unity3d.ads.test.InstrumentationTestSuite
43
44
44
- setup-adb-reverse :
45
- adb reverse tcp:8080 tcp:8080
45
+ test-legacy :
46
+ ./gradlew connectedDebugAndroidTest -i -w --stacktrace -Pandroid.testInstrumentationRunnerArguments.class=com.unity3d.ads.test.LegacyTestSuite
46
47
47
- dismantle-adb-reverse :
48
- adb reverse --remove-all
48
+ test-integration :
49
+ ./gradlew connectedDebugAndroidTest -i -w --stacktrace -Pandroid.testInstrumentationRunnerArguments.class=com.unity3d.ads.test.IntegrationTestSuite
49
50
50
- javadoc :
51
- ./gradlew :unity-ads:javadoc
51
+ push-test-server-address-ip :
52
+ echo http://$(shell ifconfig |grep "inet" |grep -E -o "([0-9]{1,3}[\.]) {3}[0-9]{1,3}" |grep -v -E " ^0| ^127" -m 1):8080 > testServerAddress.txt
53
+ adb push testServerAddress.txt /data/local/tmp
52
54
53
- zip : release
54
- cp unity-ads/build/outputs/aar/unity-ads-release.aar unity-ads.aar
55
- zip -9r unity-ads.aar.zip unity-ads.aar
56
- rm unity-ads.aar
55
+ push-test-server-address-staging :
56
+ echo " https://unity-ads-test-server.unityads.unity3d.com" > testServerAddress.txt
57
+ adb push testServerAddress.txt /data/local/tmp
57
58
58
- verify-release-build :
59
- if [[ -f " unity-ads.aar.zip" ]]; then \
60
- echo ' unity-ads.aar.zip exists' ; \
61
- else \
62
- echo ' unity-ads.aar.zip does not exist' ; \
63
- exit 1; \
64
- fi ;
59
+ push-test-server-address-localhost :
60
+ echo " http://localhost:8080" > testServerAddress.txt
61
+ adb push testServerAddress.txt /data/local/tmp
65
62
66
63
use-local-webview :
67
- sed -i ' ' ' s/return "https:\/\/config.unityads.unity3d.com\/webview\/" + getWebViewBranch() + "\/" + flavor + "\/config.json";/return "new-ip";/' " unity-ads/src/main/java/com/unity3d/services/core/properties/SdkProperties.java"
68
- sed -i ' ' ' s/return ".*";/return "https :\/\/$(shell ifconfig |grep "inet" |grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" |grep -v -E "^0|^127" -m 1):8000\/build\/" + flavor + "\/config.json";/' " unity-ads/src/main/java/com/unity3d/services/core/properties/SdkProperties.java"
64
+ sed -i ' ' ' s/return baseURI + getWebViewBranch() + "\/" + flavor + "\/config.json";/return "new-ip";/' " unity-ads/src/main/java/com/unity3d/services/core/properties/SdkProperties.java"
65
+ sed -i ' ' ' s/return ".*";/return "http :\/\/$(shell ifconfig |grep "inet" |grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" |grep -v -E "^0|^127" -m 1):8000\/build\/" + flavor + "\/config.json";/' " unity-ads/src/main/java/com/unity3d/services/core/properties/SdkProperties.java"
69
66
70
67
use-public-webview :
71
- sed -i ' ' ' s/return ".*";/return "https:\/\/config.unityads.unity3d.com\/webview\/" + getWebViewBranch() + "\/" + flavor + "\/config.json";/' " unity-ads/src/main/java/com/unity3d/services/core/properties/SdkProperties.java"
68
+ sed -i ' ' ' s/return ".*";/return baseURI + getWebViewBranch() + "\/" + flavor + "\/config.json";/' " unity-ads/src/main/java/com/unity3d/services/core/properties/SdkProperties.java"
72
69
73
70
create-android-26-emulator :
71
+ ${ANDROID_HOME} /tools/bin/sdkmanager --install " system-images;android-26;google_apis;x86"
74
72
echo " no" | ${ANDROID_HOME} /tools/bin/avdmanager create avd --name " android-26-test" --package " system-images;android-26;google_apis;x86" --device " Nexus 6P" --tag google_apis --abi google_apis/x86 --force
75
73
76
74
start-android-26-emulator :
77
75
${ANDROID_HOME} /emulator/emulator -port 5556 -avd android-26-test -no-window -noaudio -no-boot-anim -memory 2048 -partition-size 1024 &
76
+
77
+ kill-emulator :
78
+ adb emu kill
0 commit comments