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