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