Hal Canary | 6512fa3 | 2019-02-07 14:12:21 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Copyright 2019 Google LLC. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | cd "$(dirname "$0")/../.." |
| 7 | |
| 8 | set -e -x |
| 9 | |
| 10 | [ -f platform_tools/android/apps/skqp/src/main/assets/files.checksum ] || exit 1 |
| 11 | [ -f platform_tools/android/apps/skqp/src/main/assets/skqp/rendertests.txt ] || exit 1 |
| 12 | [ -f platform_tools/android/apps/skqp/src/main/assets/skqp/unittests.txt ] || exit 1 |
| 13 | |
| 14 | python tools/skqp/gn_to_bp.py |
| 15 | python tools/skqp/download_model |
| 16 | python tools/skqp/setup_resources |
| 17 | |
| 18 | touch MODULE_LICENSE_BSD |
| 19 | |
| 20 | cat > platform_tools/android/apps/skqp/src/main/Android.mk <<- "EOM" |
| 21 | # Copyright 2019 Google LLC. |
| 22 | # Use of this source code is governed by a BSD-style license that can be |
| 23 | # found in the LICENSE file. |
| 24 | LOCAL_PATH:= $(call my-dir) |
| 25 | include $(CLEAR_VARS) |
| 26 | LOCAL_MODULE_TAGS := tests optional |
| 27 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) |
| 28 | LOCAL_COMPATIBILITY_SUITE := cts vts general-tests |
| 29 | LOCAL_JAVA_LIBRARIES := android.test.runner.stubs |
| 30 | LOCAL_JNI_SHARED_LIBRARIES := libskqp_app |
| 31 | LOCAL_MULTILIB := both |
| 32 | LOCAL_USE_AAPT2 := true |
| 33 | LOCAL_STATIC_ANDROID_LIBRARIES := android-support-design |
| 34 | LOCAL_STATIC_JAVA_LIBRARIES := ctstestrunner |
| 35 | LOCAL_SRC_FILES := $(call all-java-files-under, java) |
| 36 | LOCAL_PACKAGE_NAME := CtsSkQPTestCases |
| 37 | LOCAL_SDK_VERSION := test_current |
| 38 | include $(BUILD_CTS_PACKAGE) |
| 39 | EOM |
| 40 | |
| 41 | cat > include/config/SkUserConfigManual.h <<- "EOM" |
| 42 | // Copyright 2019 Google LLC. |
| 43 | // Use of this source code is governed by a BSD-style license that can be |
| 44 | // found in the LICENSE file. |
| 45 | #ifndef SkUserConfigManual_DEFINED |
| 46 | #define SkUserConfigManual_DEFINED |
| 47 | // DON'T DEFINE THINGS HERE AS IT WILL RESULT IN DIFFERENCES WITH |
| 48 | // THE VERSION OF SKQP PUBLISHED ON SKIA.ORG |
| 49 | #endif // SkUserConfigManual_DEFINED |
| 50 | EOM |
| 51 | |
| 52 | cat > platform_tools/android/apps/skqp/src/main/AndroidTest.xml <<- "EOM" |
| 53 | <?xml version="1.0" encoding="utf-8"?> |
| 54 | <!-- |
| 55 | Copyright 2019 Google LLC. |
| 56 | Use of this source code is governed by a BSD-style license that can be |
| 57 | found in the LICENSE file. |
| 58 | --> |
| 59 | <configuration description="Config for CTS SkQP test cases"> |
| 60 | <option name="test-suite-tag" value="cts" /> |
| 61 | <option name="config-descriptor:metadata" key="component" value="uitoolkit" /> |
| 62 | <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> |
| 63 | <option name="cleanup-apks" value="true" /> |
| 64 | <option name="test-file-name" value="CtsSkQPTestCases.apk" /> |
| 65 | </target_preparer> |
| 66 | <test class="com.android.tradefed.testtype.AndroidJUnitTest" > |
| 67 | <option name="package" value="org.skia.skqp" /> |
| 68 | <option name="runtime-hint" value="7m" /> |
| 69 | </test> |
| 70 | </configuration> |
| 71 | EOM |
| 72 | |
| 73 | [ -f platform_tools/android/apps/skqp/src/main/assets/.gitignore ] && \ |
| 74 | git rm platform_tools/android/apps/skqp/src/main/assets/.gitignore |
| 75 | |
| 76 | git add \ |
| 77 | Android.bp \ |
| 78 | MODULE_LICENSE_BSD \ |
| 79 | include/config/SkUserConfig.h \ |
| 80 | include/config/SkUserConfigManual.h \ |
| 81 | platform_tools/android/apps/skqp/src/main/Android.mk \ |
| 82 | platform_tools/android/apps/skqp/src/main/AndroidTest.xml \ |
| 83 | platform_tools/android/apps/skqp/src/main/assets |