Skip to content

Commit eca28d7

Browse files
authored
Try #53:
2 parents b392652 + 501eb99 commit eca28d7

File tree

10 files changed

+35
-20
lines changed

10 files changed

+35
-20
lines changed

examples/dodge-the-creeps/rust/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ publish = false
88
crate-type = ["cdylib"]
99

1010
[dependencies]
11-
godot = { path = "../../../godot", features = ["minimal"] }
11+
godot = { path = "../../../godot", default-features = false, features = ["formatted", "convenience"] }
1212
rand = "0.8"

godot-codegen/Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ name = "godot-codegen"
33
version = "0.1.0"
44
edition = "2021"
55
rust-version = "1.63"
6+
license = "MPL-2.0"
7+
keywords = ["gamedev", "godot", "engine", "codegen"]
8+
categories = ["game-engines", "graphics"]
69

7-
# Note: features not additive, but this is an internal crate
810
[features]
911
codegen-fmt = []
10-
minimal = ["codegen-fmt"]
12+
codegen-full = []
1113

1214
[dependencies]
1315
quote = "1"

godot-codegen/src/class_generator.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub(crate) fn generate_class_files(
2626

2727
let mut modules = vec![];
2828
for class in api.classes.iter() {
29-
#[cfg(feature = "minimal")]
29+
#[cfg(not(feature = "codegen-full"))]
3030
if !crate::SELECTED_CLASSES.contains(&class.name.as_str()) {
3131
continue;
3232
}
@@ -277,7 +277,7 @@ fn make_enums(enums: &Option<Vec<ClassEnum>>, _class_name: &str, _ctx: &Context)
277277
}
278278
}
279279

280-
#[cfg(feature = "minimal")]
280+
#[cfg(not(feature = "codegen-full"))]
281281
fn is_type_excluded(ty: &str, ctx: &mut Context) -> bool {
282282
let is_class_excluded = |class: &str| !crate::SELECTED_CLASSES.contains(&class);
283283

@@ -308,7 +308,7 @@ fn is_method_excluded(method: &Method, #[allow(unused_variables)] ctx: &mut Cont
308308
// As such support could be added later (if at all), with possibly safe interfaces (e.g. Vec for void*+size pairs)
309309

310310
// -- FIXME remove when impl complete
311-
#[cfg(feature = "minimal")]
311+
#[cfg(not(feature = "codegen-full"))]
312312
if method
313313
.return_value
314314
.as_ref()
@@ -333,12 +333,12 @@ fn is_method_excluded(method: &Method, #[allow(unused_variables)] ctx: &mut Cont
333333
.map_or(false, |args| args.iter().any(|arg| arg.type_.contains("*")))
334334
}
335335

336-
#[cfg(not(feature = "minimal"))]
336+
#[cfg(feature = "codegen-full")]
337337
fn is_function_excluded(_function: &UtilityFunction, _ctx: &mut Context) -> bool {
338338
false
339339
}
340340

341-
#[cfg(feature = "minimal")]
341+
#[cfg(not(feature = "codegen-full"))]
342342
fn is_function_excluded(function: &UtilityFunction, ctx: &mut Context) -> bool {
343343
function
344344
.return_type

godot-codegen/src/context.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ impl<'a> Context<'a> {
3232

3333
for class in api.classes.iter() {
3434
let class_name = class.name.as_str();
35-
#[cfg(feature = "minimal")]
35+
36+
#[cfg(not(feature = "codegen-full"))]
3637
if !crate::SELECTED_CLASSES.contains(&class_name) {
3738
continue;
3839
}

godot-codegen/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ struct GeneratedModule {
188188
// Shared config
189189

190190
// Classes for minimal config
191-
#[cfg(feature = "minimal")]
191+
#[cfg(not(feature = "codegen-full"))]
192192
const SELECTED_CLASSES: &[&str] = &[
193193
"AnimatedSprite2D",
194194
"Area2D",

godot-core/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ keywords = ["gamedev", "godot", "engine", "2d", "3d"] # possibly: "ffi"
88
categories = ["game-engines", "graphics"]
99

1010
[features]
11-
default = ["convenience"]
11+
default = []
1212
trace = []
13-
convenience = []
1413
codegen-fmt = ["godot-ffi/codegen-fmt"]
15-
minimal = ["godot-ffi/minimal"]
14+
codegen-full = ["godot-codegen/codegen-full"]
15+
convenience = []
1616
unit-test = ["godot-ffi/unit-test"] # If this crate is built for a downstream unit test
1717

1818
[dependencies]

godot-ffi/Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ name = "godot-ffi"
33
version = "0.1.0"
44
edition = "2021"
55
rust-version = "1.63"
6+
license = "MPL-2.0"
7+
keywords = ["gamedev", "godot", "engine", "ffi"]
8+
categories = ["game-engines", "graphics"]
69

710
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
811

912
[features]
1013
codegen-fmt = ["godot-codegen/codegen-fmt"]
11-
minimal = ["godot-codegen/minimal"]
14+
#codegen-full = ["godot-codegen/codegen-full"]
1215
unit-test = [] # If this crate is built for a downstream unit test
1316

1417
[dependencies]

godot-macros/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name = "godot-macros"
33
version = "0.1.0"
44
edition = "2021"
55
rust-version = "1.63"
6+
license = "MPL-2.0"
7+
keywords = ["gamedev", "godot", "engine", "derive", "macro"]
8+
categories = ["game-engines", "graphics"]
69

710
[lib]
811
proc-macro = true

godot/Cargo.toml

+10-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@ name = "godot"
33
version = "0.1.0"
44
edition = "2021"
55
rust-version = "1.63"
6+
license = "MPL-2.0"
7+
keywords = ["gamedev", "godot", "engine", "2d", "3d"] # possibly: "ffi"
8+
categories = ["game-engines", "graphics"]
69

710
[features]
8-
default = ["convenience"]
11+
default = ["convenience", "__internal-full"]
12+
convenience = ["godot-core/convenience"]
13+
formatted = ["godot-core/codegen-fmt"]
914
trace = ["godot-core/trace"]
10-
convenience = []
11-
codegen-fmt = ["godot-core/codegen-fmt"]
12-
minimal = ["godot-core/minimal"]
13-
unit-test = []
15+
16+
# Private features, they are under no stability guarantee
17+
__internal-full = ["godot-core/codegen-full"]
18+
__internal-unit-test = []
1419

1520
[dependencies]
1621
godot-core = { path = "../godot-core" }

itest/rust/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "itest"
33
version = "0.1.0"
44
edition = "2021"
55
rust-version = "1.63"
6+
publish = false
67

78
[lib]
89
crate-type = ["cdylib"]
@@ -12,7 +13,7 @@ default = []
1213
trace = ["godot/trace"]
1314

1415
[dependencies]
15-
godot = { path = "../../godot", features = ["minimal"] }
16+
godot = { path = "../../godot", default-features = false, features = ["formatted", "convenience"] }
1617

1718
[build-dependencies]
1819
quote = "1"

0 commit comments

Comments
 (0)