mirror of
https://gitee.com/dcren/initializr.git
synced 2025-12-17 17:41:31 +08:00
Merge pull request #864 from govi20
* pr/864: Polish "Add gitignore for VS Code" Add gitignore for VS Code
This commit is contained in:
@@ -39,17 +39,20 @@ public class GitIgnore {
|
|||||||
|
|
||||||
private final GitIgnoreSection netBeans = new GitIgnoreSection("NetBeans");
|
private final GitIgnoreSection netBeans = new GitIgnoreSection("NetBeans");
|
||||||
|
|
||||||
|
private final GitIgnoreSection vscode = new GitIgnoreSection("VS Code");
|
||||||
|
|
||||||
public void write(PrintWriter writer) throws IOException {
|
public void write(PrintWriter writer) throws IOException {
|
||||||
this.general.write(writer);
|
this.general.write(writer);
|
||||||
this.sts.write(writer);
|
this.sts.write(writer);
|
||||||
this.intellijIdea.write(writer);
|
this.intellijIdea.write(writer);
|
||||||
this.netBeans.write(writer);
|
this.netBeans.write(writer);
|
||||||
|
this.vscode.write(writer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return this.general.getItems().isEmpty() && this.sts.getItems().isEmpty()
|
return this.general.getItems().isEmpty() && this.sts.getItems().isEmpty()
|
||||||
&& this.intellijIdea.getItems().isEmpty()
|
&& this.intellijIdea.getItems().isEmpty()
|
||||||
&& this.netBeans.getItems().isEmpty();
|
&& this.netBeans.getItems().isEmpty() && this.vscode.getItems().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public GitIgnoreSection getGeneral() {
|
public GitIgnoreSection getGeneral() {
|
||||||
@@ -68,6 +71,10 @@ public class GitIgnore {
|
|||||||
return this.netBeans;
|
return this.netBeans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GitIgnoreSection getVscode() {
|
||||||
|
return this.vscode;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Representation of a section of a {@code .gitignore} file.
|
* Representation of a section of a {@code .gitignore} file.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ public class GitProjectGenerationConfiguration {
|
|||||||
gitIgnore.getIntellijIdea().add(".idea", "*.iws", "*.iml", "*.ipr");
|
gitIgnore.getIntellijIdea().add(".idea", "*.iws", "*.iml", "*.ipr");
|
||||||
gitIgnore.getNetBeans().add("/nbproject/private/", "/nbbuild/", "/dist/",
|
gitIgnore.getNetBeans().add("/nbproject/private/", "/nbbuild/", "/dist/",
|
||||||
"/nbdist/", "/.nb-gradle/");
|
"/nbdist/", "/.nb-gradle/");
|
||||||
|
gitIgnore.getVscode().add(".vscode/");
|
||||||
return gitIgnore;
|
return gitIgnore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class GitProjectGenerationConfigurationTests {
|
|||||||
ProjectDescription description = new ProjectDescription();
|
ProjectDescription description = new ProjectDescription();
|
||||||
description.setBuildSystem(new GradleBuildSystem());
|
description.setBuildSystem(new GradleBuildSystem());
|
||||||
assertThat(generateGitIgnore(description)).contains("### STS ###",
|
assertThat(generateGitIgnore(description)).contains("### STS ###",
|
||||||
"### IntelliJ IDEA ###", "### NetBeans ###");
|
"### IntelliJ IDEA ###", "### NetBeans ###", "### VS Code ###");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user