1//
2// Copyright (C) 2015 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: "HealingBrush",
26    srcs: [
27        "src/**/*.java",
28        ":HealingBrush-rscript{HealingBrush.srcjar}",
29    ],
30    resource_zips: [
31        ":HealingBrush-rscript{HealingBrush.res.zip}",
32    ],
33    static_libs: ["android-support-v8-renderscript"],
34    sdk_version: "current",
35    jni_libs: ["librsjni"],
36}
37
38genrule {
39    name: "HealingBrush-rscript",
40    srcs: [
41        "src/**/*.rscript",
42        ":rs_script_api",
43        ":rs_clang_headers",
44    ],
45    tools: [
46        "llvm-rs-cc",
47        "soong_zip",
48    ],
49    out: [
50        "HealingBrush.srcjar",
51        "HealingBrush.res.zip",
52    ],
53    cmd: "for f in $(locations src/**/*.rscript); do " +
54            "  $(location llvm-rs-cc) -o $(genDir)/res/raw -p $(genDir)/src " +
55            "  -target-api 21 -rs-package-name=androidx.renderscript " +
56            "  -I $$(dirname $$(echo $(locations :rs_script_api) | awk '{ print $$1 }')) " +
57            "  -I $$(dirname $$(echo $(locations :rs_clang_headers) | awk '{ print $$1 }')) $${f}; " +
58            "done && " +
59            "$(location soong_zip) -srcjar -o $(location HealingBrush.srcjar) -C $(genDir)/src -D $(genDir)/src &&" +
60            "$(location soong_zip) -o $(location HealingBrush.res.zip) -C $(genDir)/res -D $(genDir)/res",
61}
62