// Copyright (C) 2024 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"], } filegroup { name: "sts-sdk-samples-srcs", srcs: [ "package/**/*", ], exclude_srcs: [ "package/**/.*", ], } genrule { name: "sts-sdk-samples.zip-gen", srcs: [ ":sts-sdk-samples-srcs", ], out: ["sts-sdk-samples.zip"], tools: [ "soong_zip", ], product_variables: { platform_sdk_version: { cmd: "mkdir -p $(genDir)/tmp/ " + "&& cp -rf platform_testing/libraries/sts-common-util/sts-sdk/package/* $(genDir)/tmp/" + "&& mv $(genDir)/tmp/dotidea $(genDir)/tmp/.idea && " + "for tmplfile in $$(find $(genDir)/tmp/ -type f -iname *.template); do " + " echo $${tmplfile}; " + " sed -i 's~{{PLATFORM_SDK_VERSION}}~%d~g' $${tmplfile}; " + " mv $${tmplfile} $${tmplfile/.template/}; " + "done && " + "$(location soong_zip) -o $(out) -C $(genDir)/tmp -D $(genDir)/tmp -D $(genDir)/tmp/.idea", }, }, } prebuilt_etc { name: "sts-sdk-samples.zip", src: ":sts-sdk-samples.zip-gen", }