import("$tizen_core/build/hash.gni")
template("merge_manifests") {
    forward_variables_from(invoker, [ "manifests" ])

    target = target_name
    package_manifest = "${root_out_dir}/$native_out_dir/tizen-manifest.xml"
    action(target) {
        command = "$tizen_core/tz merge --out {{output}}"
        description = "MANIFEST {{output}}"
        sources = manifests
        sources += ["//tizen-manifest.xml"]
        outputs = [ package_manifest ]
        args = [
            "-w",
            rebase_path("//tizen-manifest.xml", root_out_dir),
        ]
        args += rebase_path(manifests, root_out_dir)
    }

    calc_hash("$target.hash") {
        file_to_hash = package_manifest
        deps = [ ":$target" ]
    }
}
