• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Copyright (C) 2017 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    // See: http://go/android-license-faq
19    default_applicable_licenses: [
20        "Android-Apache-2.0",
21    ],
22}
23
24android_test {
25    name: "RSTest_Compat",
26    sdk_version: "current",
27    srcs: [
28        "src/**/*.java",
29        ":RSUnitTests_java_gui",
30        ":RSUnitTests_java_supportlibsrc_gen",
31        ":RSTest_Compat-rscript{RSTest_Compat.srcjar}",
32    ],
33    resource_zips: [
34        ":RSTest_Compat-rscript{RSTest_Compat.res.zip}",
35    ],
36    static_libs: [
37        "androidx.test.rules",
38        "android-support-v8-renderscript",
39    ],
40    min_sdk_version: "8",
41}
42
43genrule {
44    name: "RSTest_Compat-rscript",
45    srcs: [
46        ":RSUnitTests_rscript_supportlibsrc_gen",
47        ":rs_script_api",
48        ":rs_clang_headers",
49    ],
50    tools: [
51        "llvm-rs-cc",
52        "soong_zip",
53    ],
54    out: [
55        "RSTest_Compat.srcjar",
56        "RSTest_Compat.res.zip",
57    ],
58    cmd: "for f in $(locations :RSUnitTests_rscript_supportlibsrc_gen); do " +
59        "  $(location llvm-rs-cc) -o $(genDir)/res/raw -p $(genDir)/src " +
60        "  -rs-package-name=androidx.renderscript " +
61        "  -I $$(dirname $$(echo $(locations :rs_script_api) | awk '{ print $$1 }')) " +
62        "  -I $$(dirname $$(echo $(locations :rs_clang_headers) | awk '{ print $$1 }')) $${f}; " +
63        "done && " +
64        "$(location soong_zip) -srcjar -o $(location RSTest_Compat.srcjar) -C $(genDir)/src -D $(genDir)/src &&" +
65        "$(location soong_zip) -o $(location RSTest_Compat.res.zip) -C $(genDir)/res -D $(genDir)/res",
66}
67