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