Skip to content

Commit

Permalink
Add Godot4.x support
Browse files Browse the repository at this point in the history
  • Loading branch information
anosatsuk124 committed Nov 5, 2023
1 parent 69c153b commit 764a00d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Excellent if
- <a href="https://swift.org/">Swift</a>
- <a href="https://gradle.com/">Gradle</a>
- <a href="https://ziglang.org/">Zig</a>
- <a href="https://godotengine.org/">Godot 4.x</a>
</p>
<p align="center">
Pull requests are welcome, it's <a href="https://github.com/tbillington/kondo/pull/76/files">easy to extend</a>!
Expand Down
8 changes: 8 additions & 0 deletions kondo-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const FILE_PUBSPEC_YAML: &str = "pubspec.yaml";
const FILE_ELIXIR_MIX: &str = "mix.exs";
const FILE_SWIFT_PACKAGE: &str = "Package.swift";
const FILE_BUILD_ZIG: &str = "build.zig";
const FILE_GODOT_4_PROJECT: &str = "project.godot";

const PROJECT_CARGO_DIRS: [&str; 1] = ["target"];
const PROJECT_NODE_DIRS: [&str; 2] = ["node_modules", ".angular"];
Expand Down Expand Up @@ -66,6 +67,7 @@ const PROJECT_PUB_DIRS: [&str; 4] = [
const PROJECT_ELIXIR_DIRS: [&str; 1] = ["_build"];
const PROJECT_SWIFT_DIRS: [&str; 2] = [".build", ".swiftpm"];
const PROJECT_ZIG_DIRS: [&str; 1] = ["zig-cache"];
const PROJECT_GODOT_4_DIRS: [&str; 1] = [".godot"];

const PROJECT_CARGO_NAME: &str = "Cargo";
const PROJECT_NODE_NAME: &str = "Node";
Expand All @@ -83,6 +85,7 @@ const PROJECT_PUB_NAME: &str = "Pub";
const PROJECT_ELIXIR_NAME: &str = "Elixir";
const PROJECT_SWIFT_NAME: &str = "Swift";
const PROJECT_ZIG_NAME: &str = "Zig";
const PROJECT_GODOT_4_NAME: &str = "Godot 4.x";

#[derive(Debug, Clone)]
pub enum ProjectType {
Expand All @@ -103,6 +106,7 @@ pub enum ProjectType {
Elixir,
Swift,
Zig,
Godot4,
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -137,6 +141,7 @@ impl Project {
ProjectType::Swift => &PROJECT_SWIFT_DIRS,
ProjectType::Gradle => &PROJECT_GRADLE_DIRS,
ProjectType::Zig => &PROJECT_ZIG_DIRS,
ProjectType::Godot4 => &PROJECT_GODOT_4_DIRS,
}
}

Expand Down Expand Up @@ -243,6 +248,7 @@ impl Project {
ProjectType::Swift => PROJECT_SWIFT_NAME,
ProjectType::Gradle => PROJECT_GRADLE_NAME,
ProjectType::Zig => PROJECT_ZIG_NAME,
ProjectType::Godot4 => PROJECT_GODOT_4_NAME,
}
}

Expand Down Expand Up @@ -347,6 +353,7 @@ impl Iterator for ProjectIter {
FILE_BUILD_GRADLE => Some(ProjectType::Gradle),
FILE_BUILD_GRADLE_KTS => Some(ProjectType::Gradle),
FILE_BUILD_ZIG => Some(ProjectType::Zig),
FILE_GODOT_4_PROJECT => Some(ProjectType::Godot4),
file_name if file_name.ends_with(FILE_UNREAL_SUFFIX) => {
Some(ProjectType::Unreal)
}
Expand Down Expand Up @@ -442,6 +449,7 @@ pub fn clean(project_path: &str) -> Result<(), Box<dyn error::Error>> {
FILE_ELIXIR_MIX => Some(ProjectType::Elixir),
FILE_SWIFT_PACKAGE => Some(ProjectType::Swift),
FILE_BUILD_ZIG => Some(ProjectType::Zig),
FILE_GODOT_4_PROJECT => Some(ProjectType::Godot4),
_ => None,
};
if let Some(project_type) = p_type {
Expand Down

0 comments on commit 764a00d

Please sign in to comment.