Home | History | Annotate | Download | only in skqp
      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-axt
     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 	<option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
     63 	<option name="config-descriptor:metadata" key="parameter" value="multi_abi" />
     64 	<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
     65 	<option name="cleanup-apks" value="true" />
     66 	<option name="test-file-name" value="CtsSkQPTestCases.apk" />
     67 	</target_preparer>
     68 	<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
     69 	<option name="package" value="org.skia.skqp" />
     70 	<option name="runtime-hint" value="7m" />
     71 	</test>
     72 	</configuration>
     73 EOM
     74 
     75 [ -f platform_tools/android/apps/skqp/src/main/assets/.gitignore ] && \
     76     git rm platform_tools/android/apps/skqp/src/main/assets/.gitignore
     77 
     78 git add                                                       \
     79     Android.bp                                                \
     80     MODULE_LICENSE_BSD                                        \
     81     include/config/SkUserConfig.h                             \
     82     include/config/SkUserConfigManual.h                       \
     83     platform_tools/android/apps/skqp/src/main/Android.mk      \
     84     platform_tools/android/apps/skqp/src/main/AndroidTest.xml \
     85     platform_tools/android/apps/skqp/src/main/assets
     86