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