chore(release): prepare public source release
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
[package]
|
||||
name = "asmmember"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
readme.workspace = true
|
||||
publish.workspace = true
|
||||
description = "List managed assembly members with AI-friendly output."
|
||||
keywords.workspace = true
|
||||
categories.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
common = { path = "../common", default-features = false }
|
||||
managed = { path = "../managed" }
|
||||
lexopt.workspace = true
|
||||
regex-lite.workspace = true
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
assert_cmd.workspace = true
|
||||
predicates.workspace = true
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
//! Public entry point for the `asmmember` command crate.
|
||||
|
||||
mod cli;
|
||||
|
||||
pub use cli::main_entry;
|
||||
@@ -0,0 +1,5 @@
|
||||
//! Binary entry point for `asmmember`.
|
||||
|
||||
fn main() {
|
||||
std::process::exit(asmmember::main_entry());
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
//! Integration tests for the `asmmember` command.
|
||||
|
||||
use assert_cmd::Command;
|
||||
use predicates::prelude::*;
|
||||
use serde_json::Value;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn cargo_command() -> Command {
|
||||
Command::cargo_bin("asmmember").expect("binary")
|
||||
}
|
||||
|
||||
fn workspace_root() -> PathBuf {
|
||||
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("..")
|
||||
.join("..")
|
||||
.canonicalize()
|
||||
.expect("workspace root")
|
||||
}
|
||||
|
||||
fn managed_fixture_dir() -> PathBuf {
|
||||
workspace_root()
|
||||
.join("fixtures")
|
||||
.join("managed")
|
||||
.join("bin")
|
||||
}
|
||||
|
||||
fn fixture_assembly() -> PathBuf {
|
||||
managed_fixture_dir().join("GameAssembly.dll")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn help_includes_examples_and_binding_usage() {
|
||||
let mut command = cargo_command();
|
||||
command
|
||||
.arg("--help")
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains("--assembly"))
|
||||
.stdout(predicate::str::contains("--binding"))
|
||||
.stdout(predicate::str::contains("--user-code-only"))
|
||||
.stdout(predicate::str::contains("ConvertFrom-Json"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn emits_methods_fields_and_properties_as_json() {
|
||||
let mut command = cargo_command();
|
||||
let output = command
|
||||
.arg("--assembly")
|
||||
.arg(fixture_assembly())
|
||||
.arg("Game.UI.Windows.Windows.SpaceCraftConstructionWindow")
|
||||
.arg("--match")
|
||||
.arg("Build|Project|Launch|Queue|Complete")
|
||||
.arg("--binding")
|
||||
.arg("public,nonpublic,instance,static")
|
||||
.arg("--user-code-only")
|
||||
.arg("--json")
|
||||
.assert()
|
||||
.success()
|
||||
.get_output()
|
||||
.stdout
|
||||
.clone();
|
||||
let payload = serde_json::from_slice::<Value>(&output).expect("json payload");
|
||||
let entries = payload.as_array().expect("array payload");
|
||||
assert!(
|
||||
entries
|
||||
.iter()
|
||||
.any(|entry| entry["kind"] == "method" && entry["name"] == "StartProject")
|
||||
);
|
||||
assert!(
|
||||
entries
|
||||
.iter()
|
||||
.any(|entry| entry["kind"] == "field" && entry["name"] == "_buildTicks")
|
||||
);
|
||||
assert!(
|
||||
entries
|
||||
.iter()
|
||||
.any(|entry| entry["kind"] == "property" && entry["name"] == "ProjectName")
|
||||
);
|
||||
assert!(!entries.iter().any(|entry| {
|
||||
entry["kind"] == "field"
|
||||
&& entry["name"]
|
||||
.as_str()
|
||||
.is_some_and(|name| name.contains("BackingField"))
|
||||
}));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn supports_type_names_from_powershell_pipeline() {
|
||||
let binary = assert_cmd::cargo::cargo_bin("asmmember");
|
||||
let assembly = fixture_assembly();
|
||||
let script = format!(
|
||||
"'Game.UI.Windows.Windows.SpaceCraftConstructionWindow' | & '{}' --assembly '{}' --input-format lines --match Project --json",
|
||||
binary.display(),
|
||||
assembly.display()
|
||||
);
|
||||
|
||||
let mut command = Command::new("pwsh");
|
||||
command
|
||||
.arg("-NoProfile")
|
||||
.arg("-Command")
|
||||
.arg(script)
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(predicate::str::contains("\"name\":\"StartProject\""));
|
||||
}
|
||||
Reference in New Issue
Block a user