Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ed0ce71 authored by Herbert Xue's avatar Herbert Xue
Browse files

Convert the otatools.zip to soong for jars, cert files and releasetools

- The jar modules is from $(INTERNAL_OTATOOLS_MODULES_WITH_DEPS).
- The bins will be converted in upcoming change.
- The "otatools-package-temp" is temporary. It will be changed as
  "otatools-package" after all files are ready in soong.

Bug: 395988167
Test: m dist otatools-package-temp
Change-Id: I6739dfe7565d93a25e80eddf9664a5bf6567dde0
parent 76aa47b6
Loading
Loading
Loading
Loading
+65 −0
Original line number Diff line number Diff line
// Copyright (C) 2025 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 {
    // See: http://go/android-license-faq
    default_applicable_licenses: ["Android-Apache-2.0"],
}

java_genrule_host {
    name: "otatools_package_dep_jars",
    tools: ["soong_zip"],
    compile_multilib: "first",
    cmd: "mkdir -p $(genDir)/framework && " +
        "cp $(in) $(genDir)/framework && " +
        "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)/framework",
    srcs: [
        ":apksigner",
        ":boot_signer",
        ":signapk",
        ":verity_signer",
    ],
    out: ["otatools_package_dep_jars.zip"],
}

genrule {
    name: "otatools_package_cert_files",
    tools: ["soong_zip"],
    cmd: "mkdir -p $(genDir)/tmp/ && " +
        "echo $(in) > $(genDir)/tmp/zip_files.list && " +
        "$(location soong_zip) -o $(out) -l $(genDir)/tmp/zip_files.list ",
    srcs: [
        ":soong_generated_otatools_package_filegroup",
    ],
    out: ["otatools_package_cert_files.zip"],
}

java_genrule_host {
    name: "otatools_package",
    tools: ["merge_zips"],
    compile_multilib: "first",
    cmd: "$(location merge_zips) $(out) $(in)",
    srcs: [
        ":otatools_package_cert_files",
        ":otatools_package_dep_jars",
        ":otatools_package_releasetools",
    ],
    // TODO: Rename as "otatools.zip" when the rest files are ready.
    out: ["otatools_temp.zip"],
    dist: {
        targets: [
            "otatools-package-temp",
        ],
    },
}
+9 −0
Original line number Diff line number Diff line
@@ -650,3 +650,12 @@ python_test_host {
        unit_test: true,
    },
}

genrule {
    name: "otatools_package_releasetools",
    tools: ["soong_zip"],
    srcs: ["**/*"],
    cmd: "find build/make/tools/releasetools -name '*.pyc' -prune -o \\( -type f -o -type l \\) -print | sort > $(genDir)/files.txt && " +
        "$(location soong_zip) -o $(out) -C build/make/tools -l $(genDir)/files.txt",
    out: ["otatools_package_releasetools.zip"],
}