-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bd616a
commit 2417560
Showing
9 changed files
with
198 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,78 @@ | ||
debug: | ||
./gradlew :unity-ads:assembleDebug | ||
|
||
release: | ||
./gradlew :unity-ads:assembleRelease | ||
|
||
clean: | ||
./gradlew :unity-ads:clean | ||
|
||
test: test-hosted | ||
coverage: | ||
./gradlew -i jacocoTestReport --debug | ||
|
||
test-local: push-test-server-address exec-tests | ||
coverage-ci: debug test-ci coverage | ||
|
||
test-unit-tests: push-test-server-address exec-unit-tests | ||
zip: release | ||
cp unity-ads/build/outputs/aar/unity-ads-release.aar unity-ads.aar | ||
zip -9r unity-ads.aar.zip unity-ads.aar | ||
rm unity-ads.aar | ||
|
||
build-test-apk: clean | ||
./gradlew :unity-ads:assembleAndroidTest --full-stacktrace | ||
javadoc: | ||
./gradlew :unity-ads:javadoc | ||
|
||
test-emulator: exec-tests | ||
device-connected: | ||
adb get-state 1>/dev/null 2>&1 && echo 'Device Attached' && exit 0 || echo 'Device NOT Attached' && exit -1 | ||
|
||
test-hosted: push-test-server-address-hosted exec-tests | ||
wake-up-device: | ||
scripts/wakeUpDevice.sh | ||
|
||
test-usb: push-test-server-address-local setup-adb-reverse exec-only-unit-tests dismantle-adb-reverse | ||
test: device-connected wake-up-device run-all-tests | ||
|
||
exec-tests: exec-unit-tests exec-hybrid-tests | ||
test-local: device-connected wake-up-device push-test-server-address-ip run-all-tests | ||
|
||
exec-unit-tests: clean | ||
adb shell input keyevent 82 | ||
./gradlew :unity-ads:connectedCheck --full-stacktrace -Pandroid.testInstrumentationRunnerArguments.class=com.unity3d.ads.test.LegacyTestSuite | ||
test-local-webview-staging: device-connected wake-up-device push-test-server-address-staging run-all-tests | ||
|
||
exec-hybrid-tests: clean | ||
adb shell input keyevent 82 | ||
./gradlew :unity-ads:connectedCheck --full-stacktrace -Pandroid.testInstrumentationRunnerArguments.class=com.unity3d.ads.test.HybridTestSuite | ||
test-local-staging-localhost: device-connected wake-up-device push-test-server-address-localhost run-all-tests | ||
|
||
push-test-server-address: | ||
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 | ||
adb push testServerAddress.txt /data/local/tmp | ||
run-all-tests: test-instrumentation test-legacy test-integration | ||
|
||
push-test-server-address-hosted: | ||
echo "https://unity-ads-test-server.unityads.unity3d.com" > testServerAddress.txt | ||
adb push testServerAddress.txt /data/local/tmp | ||
test-ci: | ||
./gradlew connectedDebugAndroidTest -i -w --stacktrace -Pandroid.testInstrumentationRunnerArguments.class=com.unity3d.ads.test.InstrumentationTestSuite,com.unity3d.ads.test.LegacyTestSuite | ||
|
||
push-test-server-address-local: | ||
echo "https://localhost:8080" > testServerAddress.txt | ||
adb push testServerAddress.txt /data/local/tmp | ||
test-instrumentation: | ||
./gradlew connectedDebugAndroidTest -i -w --stacktrace -Pandroid.testInstrumentationRunnerArguments.class=com.unity3d.ads.test.InstrumentationTestSuite | ||
|
||
setup-adb-reverse: | ||
adb reverse tcp:8080 tcp:8080 | ||
test-legacy: | ||
./gradlew connectedDebugAndroidTest -i -w --stacktrace -Pandroid.testInstrumentationRunnerArguments.class=com.unity3d.ads.test.LegacyTestSuite | ||
|
||
dismantle-adb-reverse: | ||
adb reverse --remove-all | ||
test-integration: | ||
./gradlew connectedDebugAndroidTest -i -w --stacktrace -Pandroid.testInstrumentationRunnerArguments.class=com.unity3d.ads.test.IntegrationTestSuite | ||
|
||
javadoc: | ||
./gradlew :unity-ads:javadoc | ||
push-test-server-address-ip: | ||
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 | ||
adb push testServerAddress.txt /data/local/tmp | ||
|
||
zip: release | ||
cp unity-ads/build/outputs/aar/unity-ads-release.aar unity-ads.aar | ||
zip -9r unity-ads.aar.zip unity-ads.aar | ||
rm unity-ads.aar | ||
push-test-server-address-staging: | ||
echo "https://unity-ads-test-server.unityads.unity3d.com" > testServerAddress.txt | ||
adb push testServerAddress.txt /data/local/tmp | ||
|
||
verify-release-build: | ||
if [[ -f "unity-ads.aar.zip" ]]; then \ | ||
echo 'unity-ads.aar.zip exists'; \ | ||
else \ | ||
echo 'unity-ads.aar.zip does not exist'; \ | ||
exit 1; \ | ||
fi; | ||
push-test-server-address-localhost: | ||
echo "http://localhost:8080" > testServerAddress.txt | ||
adb push testServerAddress.txt /data/local/tmp | ||
|
||
use-local-webview: | ||
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" | ||
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" | ||
sed -i '' 's/return baseURI + getWebViewBranch() + "\/" + flavor + "\/config.json";/return "new-ip";/' "unity-ads/src/main/java/com/unity3d/services/core/properties/SdkProperties.java" | ||
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" | ||
|
||
use-public-webview: | ||
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" | ||
sed -i '' 's/return ".*";/return baseURI + getWebViewBranch() + "\/" + flavor + "\/config.json";/' "unity-ads/src/main/java/com/unity3d/services/core/properties/SdkProperties.java" | ||
|
||
create-android-26-emulator: | ||
${ANDROID_HOME}/tools/bin/sdkmanager --install "system-images;android-26;google_apis;x86" | ||
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 | ||
|
||
start-android-26-emulator: | ||
${ANDROID_HOME}/emulator/emulator -port 5556 -avd android-26-test -no-window -noaudio -no-boot-anim -memory 2048 -partition-size 1024 & | ||
|
||
kill-emulator: | ||
adb emu kill |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash -e | ||
wakefulness=$(adb shell dumpsys power | grep 'mWakefulness=' | cut -d "=" -f2) | ||
|
||
if [[ "$wakefulness" == "Awake" ]] ; then | ||
echo "Device Awake" | ||
exit 0; | ||
else | ||
echo "Waking up device" | ||
adb shell input keyevent KEYCODE_WAKEUP | ||
fi | ||
|
||
adb shell input keyevent 82 | ||
|
||
displaySB2=$(adb shell dumpsys power | grep 'mHoldingDisplaySuspendBlocker=' | cut -d "=" -f2) | ||
wakeLockSB2=$(adb shell dumpsys power | grep 'mHoldingWakeLockSuspendBlocker='| cut -d "=" -f2) | ||
if [[ "$displaySB2" == "true" && "$wakeLockSB2" == "false" ]] ; then | ||
echo "Unlocking device with passcode 5168" | ||
adb shell input text 5168 && adb shell input keyevent 66 | ||
fi | ||
|
||
if [[ "$wakefulness" == "Awake" ]] ; then | ||
echo "Device Awake" | ||
exit 0; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.