Skip to content

Commit c77603b

Browse files
committed
HOLIDAY DUMP
1 parent c18ae77 commit c77603b

File tree

49 files changed

+5863
-5962
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+5863
-5962
lines changed

codegen/Cargo.bootstrap.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ version = "0.1.0"
55
edition = "2024"
66

77
[dependencies]
8+
9+
# {{ANALYZED_CRATE}}
810
bevy_mod_scripting_bindings = { path = "{{BMS_BINDINGS_PATH}}" }
9-
bevy_reflect = { version = "0.17", features = [
10-
"smol_str",
11-
"glam",
12-
"petgraph",
13-
"smallvec",
14-
"uuid",
15-
] }
11+
12+
# bevy_reflect = { version = "0.17", features = [
13+
# "smol_str",
14+
# "glam",
15+
# "petgraph",
16+
# "smallvec",
17+
# "uuid",
18+
# ] }
1619

1720
[workspace]

codegen/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ syn = { version = "2", features = ["parsing"], default-features = false }
6262
itertools = "0.12"
6363
chrono = "0.4"
6464
pretty_assertions = "1.3"
65+
regex = "1"
6566

6667
[dependencies]
6768
crate_feature_graph = { workspace = true, features = ["dot_parser", "serde"] }
@@ -81,6 +82,7 @@ serde = { workspace = true, features = ["std"] }
8182
prettyplease = { workspace = true }
8283
convert_case = { workspace = true }
8384
chrono = { workspace = true }
85+
regex = { workspace = true }
8486

8587
[build-dependencies]
8688
toml = "0.8"

codegen/crates/crate_feature_graph/bin/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub fn main() -> std::io::Result<()> {
4848
let mut graph = WorkspaceGraph::from(workspace);
4949

5050
let root = args.root_package;
51-
log::info!(
51+
log::debug!(
5252
"Calculating features for root: {:?} with features: {:?}, default features: {}",
5353
root,
5454
args.features,

codegen/crates/crate_feature_graph/src/feature.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ use log::error;
1717
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1818
pub struct CrateName(pub(crate) String);
1919

20+
impl AsRef<str> for CrateName {
21+
fn as_ref(&self) -> &str {
22+
&self.0
23+
}
24+
}
25+
2026
impl<'a, T: Borrow<Package>> From<&'a T> for CrateName {
2127
fn from(pkg: &'a T) -> Self {
2228
CrateName(pkg.borrow().name.clone())

codegen/crates/crate_feature_graph/src/graph.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ impl WorkspaceGraph {
227227

228228
// finally filter out nodes we don't want to show but connect edges
229229
if !only_show_crates.is_empty() {
230-
log::info!("Filtering to only show crates: {only_show_crates:?}");
230+
log::debug!("Filtering to only show crates: {only_show_crates:?}");
231231
let only_show_crates: HashSet<_> = only_show_crates
232232
.into_iter()
233233
.map(|s| s.to_string())
@@ -237,14 +237,14 @@ impl WorkspaceGraph {
237237
.filter(|c| !only_show_crates.contains(&c.to_string()))
238238
.collect();
239239

240-
log::info!(
240+
log::debug!(
241241
"Removing and interconnecting {} nodes, out of {}",
242242
to_remove.len(),
243243
visualiser_graph.node_count()
244244
);
245245

246246
for n in to_remove {
247-
log::info!("Removing node {n}");
247+
log::debug!("Removing node {n}");
248248
let node_index =
249249
match visualiser_graph.find_node_by_opt(|node| node.contains(&n.to_string())) {
250250
Some(n) => n,
@@ -408,7 +408,7 @@ impl WorkspaceGraph {
408408
}
409409
}
410410

411-
log::info!("Parsed features map: {features_map:?}");
411+
log::debug!("Parsed features map: {features_map:?}");
412412
self.calculate_enabled_features_and_dependencies(features_map, false);
413413
}
414414

@@ -454,7 +454,7 @@ impl WorkspaceGraph {
454454

455455
open_set.extend(enabled_crates.keys().cloned());
456456

457-
log::info!("Starting feature calculation with open set: {open_set:?}");
457+
log::debug!("Starting feature calculation with open set: {open_set:?}");
458458

459459
while let Some(krate) = open_set.pop_front() {
460460
log::trace!("Processing crate `{krate}`");

codegen/src/args.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ impl WorkspaceMeta {
284284

285285
/// Returns true if the given crate is in the workspace and if the plugin will run on it
286286
pub fn is_workspace_and_included_crate(&self, crate_name: &str) -> bool {
287+
// TODO: temp
287288
self.include_crates
288289
.as_ref()
289290
.map(|include_crates| include_crates.contains(&crate_name.to_owned()))

codegen/src/bin/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![feature(rustc_private)]
2-
use bevy_mod_scripting_codegen::{driver::driver_main, *};
2+
use bevy_mod_scripting_codegen::{driver::rustc_driver_main, *};
33
// use rustc_log::LoggerConfig;
44

55
extern crate rustc_log;
@@ -10,5 +10,5 @@ fn main() {
1010
.parse_filters(&std::env::var("RUST_LOG").unwrap_or_else(|_| "warn".into()))
1111
.init();
1212

13-
driver_main(BevyAnalyzer);
13+
rustc_driver_main(BevyAnalyzer::initialize_from_env());
1414
}

0 commit comments

Comments
 (0)