Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
package new assets-artifacts
Browse files Browse the repository at this point in the history
boozook committed Jun 12, 2024
1 parent 809d56c commit 840583a
Showing 5 changed files with 144 additions and 296 deletions.
122 changes: 30 additions & 92 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cargo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ toml.workspace = true
toml_edit = { version = "0.22", features = ["serde"] }
regex.workspace = true
byteorder = "1.5"
zip = { version = "1.1", features = ["time"] }
zip = { version = "2.1", features = ["time"] }
walkdir = "2.5"

anyhow = "1.0"
4 changes: 4 additions & 0 deletions cargo/src/assets/plan.rs
Original file line number Diff line number Diff line change
@@ -757,3 +757,7 @@ pub enum AssetKind {
Package,
Dev,
}

impl AssetKind {
pub fn is_dev(&self) -> bool { matches!(self, Self::Dev) }
}
16 changes: 6 additions & 10 deletions cargo/src/main.rs
Original file line number Diff line number Diff line change
@@ -83,15 +83,13 @@ fn execute(config: &Config) -> CargoResult<()> {

cli::cmd::Cmd::Package => {
let deps_tree = crate::utils::cargo::meta_deps::meta_deps(config)?;
let assets_new = assets::proto::build_all(config, &deps_tree)?;

let assets = assets::build(config)?;
let assets = assets::proto::build_all(config, &deps_tree)?;
let products = build::build(config)?;

log::debug!("assets artifacts: old:{} / new:{}", assets.len(), assets_new.len());
log::debug!("assets artifacts: {}", assets.len());
log::debug!("build artifacts: {}", products.len());

package::build_all(config, assets, assets_new, products)?;
package::build_all(config, assets, products)?;
},

cli::cmd::Cmd::Run => {
@@ -150,10 +148,9 @@ fn execute(config: &Config) -> CargoResult<()> {
}

let deps_tree = crate::utils::cargo::meta_deps::meta_deps(config)?;
let assets_new = assets::proto::build_all(config, &deps_tree)?;

// build requested package(s):
let assets = assets::build(config)?;
let assets = assets::proto::build_all(config, &deps_tree)?;
let mut products = build::build(config)?;

// filter products with expected:
@@ -178,16 +175,15 @@ fn execute(config: &Config) -> CargoResult<()> {
})
.count();

let packages = package::build_all(config, assets, assets_new, products)?;
let packages = package::build_all(config, assets, products)?;
match packages.len() {
1 => (),
0 => bail!("No packages have been produced, nothing to run."),
n => bail!("Produced {n} packages but should be 1, can't choose one."),
}
let package = packages.first().unwrap();

config.log()
.build_finished(true, Some(package.package.package_id()));
config.log().build_finished(true, Some(package.package_id));


{
Loading

0 comments on commit 840583a

Please sign in to comment.