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

Commit 658988a0 authored by Mårten Kongstad's avatar Mårten Kongstad
Browse files

record-finalized-flags: convert to Rust

Bug: 377676163
Test: m record-finalized-flags
Test: atest record-finalized-flags-test
Merged-In: Id6cc4dea2e0bf13858d4f698fecffe2537161bb2
Change-Id: Id6cc4dea2e0bf13858d4f698fecffe2537161bb2
parent 90ed0c95
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
Cargo.lock
target/
+23 −2
Original line number Diff line number Diff line
sh_binary_host {
package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

rust_defaults {
    name: "record-finalized-flags-defaults",
    edition: "2021",
    clippy_lints: "android",
    lints: "android",
    srcs: ["src/main.rs"],
    rustlibs: [
        "libanyhow",
    ],
}

rust_binary_host {
    name: "record-finalized-flags",
    src: "record-finalized-flags.sh",
    defaults: ["record-finalized-flags-defaults"],
}

rust_test_host {
    name: "record-finalized-flags-test",
    defaults: ["record-finalized-flags-defaults"],
    test_suites: ["general-tests"],
}
+12 −0
Original line number Diff line number Diff line
# Cargo.toml file to allow rapid development of record-finalized-flags using
# cargo. Soong is the official Android build system, and the only system
# guaranteed to support record-finalized-flags. If there is ever any issue with
# the cargo setup, support for cargo will be dropped and this file removed.

[package]
name = "record-finalized-flags"
version = "0.1.0"
edition = "2021"

[dependencies]
anyhow = { path = "../../../../external/rust/android-crates-io/crates/anyhow" }
+0 −18
Original line number Diff line number Diff line
#!/bin/bash -e
#
# Copyright 2024 Google Inc. All rights reserved.
#
# 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.

# TODO: implement this tool
echo "record-finalized-flags.sh $*"
+30 −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.
 */

//! `record-finalized-flags` is a tool to create a snapshot (intended to be stored in
//! prebuilts/sdk) of the flags used with @FlaggedApi APIs
use anyhow::Result;

fn main() -> Result<()> {
    println!("{:?}", std::env::args());
    Ok(())
}

#[cfg(test)]
mod tests {
    #[test]
    fn test() {}
}