Skip to content

Commit d95bc83

Browse files
committed
Add Java (maven) support
1 parent 81a2992 commit d95bc83

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/crufty/artifact_type.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,28 @@
33
pub enum ArtifactType {
44
Rust,
55
Scala,
6+
JavaMaven,
67
Custom {
78
pattern: &'static str,
89
name: &'static str,
910
files: &'static [&'static str],
1011
},
1112
}
1213

13-
pub fn builtin() -> [ArtifactType; 2] {
14-
[ArtifactType::Rust, ArtifactType::Scala]
14+
pub fn builtin() -> [ArtifactType; 3] {
15+
[
16+
ArtifactType::Rust,
17+
ArtifactType::Scala,
18+
ArtifactType::JavaMaven,
19+
]
1520
}
1621

1722
impl ArtifactType {
1823
pub fn pattern(&self) -> &'static str {
1924
match self {
2025
ArtifactType::Rust => "**/target",
2126
ArtifactType::Scala => "**/target",
27+
ArtifactType::JavaMaven => "**/target",
2228
ArtifactType::Custom { pattern, .. } => pattern,
2329
}
2430
}
@@ -27,6 +33,7 @@ impl ArtifactType {
2733
match self {
2834
ArtifactType::Rust => "Rust",
2935
ArtifactType::Scala => "Scala",
36+
ArtifactType::JavaMaven => "Java",
3037
ArtifactType::Custom { name, .. } => name,
3138
}
3239
}
@@ -35,6 +42,7 @@ impl ArtifactType {
3542
match self {
3643
ArtifactType::Rust => vec!["Cargo.toml".to_string()],
3744
ArtifactType::Scala => vec!["build.sbt".to_string()],
45+
ArtifactType::JavaMaven => vec!["pom.xml".to_string()],
3846
ArtifactType::Custom { files, .. } => {
3947
files.iter().map(|s| s.to_string()).collect()
4048
}

0 commit comments

Comments
 (0)