Skip to content

Commit 597efd9

Browse files
committed
add support for unreal projects
1 parent 3f6e112 commit 597efd9

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

kondo-lib/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const FILE_ASSEMBLY_CSHARP: &str = "Assembly-CSharp.csproj";
1010
const FILE_STACK_HASKELL: &str = "stack.yaml";
1111
const FILE_SBT_BUILD: &str = "build.sbt";
1212
const FILE_MVN_BUILD: &str = "pom.xml";
13+
const FILE_UNREAL_SUFFIX: &str = ".uproject";
1314

1415
const PROJECT_CARGO_DIRS: [&str; 1] = ["target"];
1516
const PROJECT_NODE_DIRS: [&str; 1] = ["node_modules"];
@@ -25,13 +26,21 @@ const PROJECT_UNITY_DIRS: [&str; 7] = [
2526
const PROJECT_STACK_DIRS: [&str; 1] = [".stack-work"];
2627
const PROJECT_SBT_DIRS: [&str; 2] = ["target", "project/target"];
2728
const PROJECT_MVN_DIRS: [&str; 1] = ["target"];
29+
const PROJECT_UNREAL_DIRS: [&str; 5] = [
30+
"Binaries",
31+
"Build",
32+
"Saved",
33+
"DerivedDataCache",
34+
"Intermediate",
35+
];
2836

2937
const PROJECT_CARGO_NAME: &str = "Cargo";
3038
const PROJECT_NODE_NAME: &str = "Node";
3139
const PROJECT_UNITY_NAME: &str = "Unity";
3240
const PROJECT_STACK_NAME: &str = "Stack";
3341
const PROJECT_SBT_NAME: &str = "SBT";
3442
const PROJECT_MVN_NAME: &str = "Maven";
43+
const PROJECT_UNREAL_NAME: &str = "Unreal";
3544

3645
#[derive(Debug, Clone)]
3746
pub enum ProjectType {
@@ -41,6 +50,7 @@ pub enum ProjectType {
4150
Stack,
4251
SBT,
4352
Maven,
53+
Unreal,
4454
}
4555

4656
#[derive(Debug, Clone)]
@@ -65,6 +75,7 @@ impl Project {
6575
ProjectType::Stack => PROJECT_STACK_DIRS.iter(),
6676
ProjectType::SBT => PROJECT_SBT_DIRS.iter(),
6777
ProjectType::Maven => PROJECT_MVN_DIRS.iter(),
78+
ProjectType::Unreal => PROJECT_UNREAL_DIRS.iter(),
6879
}
6980
.copied()
7081
}
@@ -141,6 +152,7 @@ impl Project {
141152
ProjectType::Stack => PROJECT_STACK_NAME,
142153
ProjectType::SBT => PROJECT_SBT_NAME,
143154
ProjectType::Maven => PROJECT_MVN_NAME,
155+
ProjectType::Unreal => PROJECT_UNREAL_NAME,
144156
}
145157
}
146158
}
@@ -190,6 +202,9 @@ impl Iterator for ProjectIter {
190202
FILE_STACK_HASKELL => Some(ProjectType::Stack),
191203
FILE_SBT_BUILD => Some(ProjectType::SBT),
192204
FILE_MVN_BUILD => Some(ProjectType::Maven),
205+
file_name if file_name.ends_with(FILE_UNREAL_SUFFIX) => {
206+
Some(ProjectType::Unreal)
207+
}
193208
_ => None,
194209
};
195210
if let Some(project_type) = p_type {

kondo/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
9494
for (size, name, type_name) in project_sizes.iter() {
9595
writeln!(
9696
&mut write_handle,
97-
"{:>10} {:<5} {}",
97+
"{:>10} {:<6} {}",
9898
pretty_size(*size),
9999
type_name,
100100
name

0 commit comments

Comments
 (0)