// Copyright (C) 2019 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package { default_applicable_licenses: ["Android-Apache-2.0"], } // Genrule for handwritten statsd configs. java_genrule { name: "statsd-config-protos", host_supported: true, srcs: [ "res/statsd-configs/**/*.pb", ], out: ["statsd-config-protos.jar"], tools: ["soong_zip"], /* * Loops over all subdirectories under res/statsd-configs/ and copy all *.pb configs within to * an assets/statsd-configs/ directory, which gets packed into a .jar file and ends up under the * assets/statsd-configs/ directory in the package, which can then be read with asset manager * in the APK. * * If a config fails to parse, an error is thrown and the build will fail. */ cmd: "mkdir $(genDir)/pb && protos=($(locations res/statsd-configs/**/*.pb)) " + "&& for file in $${protos[@]} ; do cp $$file $(genDir)/pb/ ; done " + "&& $(location soong_zip) -jar -o $(out) -C $(genDir)/pb -P assets/statsd-configs -D $(genDir)/pb", } // This library enables additional listeners dependent on platform apis. java_library { name: "collector-device-lib-platform", defaults: ["tradefed_errorprone_defaults"], srcs: [ "src/**/*.java", ], static_libs: [ "collector-device-lib", "statsdprotonano", "statsd-helper", "statsd-config-protos", ], }