Skip to content

Commit 0939eb5

Browse files
Project: adds node_modules and .git filters to new projects.
1 parent 4402f3a commit 0939eb5

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

source/v2/phasereditor/phasereditor.project.core/src/phasereditor/project/core/PhaserProjectNature.java

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2222
package phasereditor.project.core;
2323

24+
import org.eclipse.core.resources.FileInfoMatcherDescription;
2425
import org.eclipse.core.resources.ICommand;
2526
import org.eclipse.core.resources.IProject;
2627
import org.eclipse.core.resources.IProjectDescription;
2728
import org.eclipse.core.resources.IProjectNature;
2829
import org.eclipse.core.resources.IResource;
30+
import org.eclipse.core.resources.IResourceFilterDescription;
2931
import org.eclipse.core.runtime.CoreException;
3032
import org.eclipse.core.runtime.IProgressMonitor;
3133
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -35,8 +37,7 @@ public class PhaserProjectNature implements IProjectNature {
3537

3638
public static final String NATURE_IDS[] = { ProjectCore.PHASER_PROJECT_NATURE };
3739

38-
public static void addPhaserNature(IProject project, IProgressMonitor monitor)
39-
throws CoreException {
40+
public static void addPhaserNature(IProject project, IProgressMonitor monitor) throws CoreException {
4041
if (monitor != null && monitor.isCanceled()) {
4142
throw new OperationCanceledException();
4243
}
@@ -109,7 +110,7 @@ public void configure() throws CoreException {
109110
// add the builder
110111
IProjectDescription desc = _project.getDescription();
111112
ICommand[] commands = desc.getBuildSpec();
112-
113+
113114
boolean found = false;
114115

115116
String builderId = ProjectCore.PHASER_BUILDER_ID;
@@ -120,7 +121,7 @@ public void configure() throws CoreException {
120121
break;
121122
}
122123
}
123-
124+
124125
if (!found) {
125126

126127
// Phaser builder command
@@ -142,6 +143,30 @@ public void configure() throws CoreException {
142143
// javaProv.configure();
143144

144145
_project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
146+
147+
{
148+
_project.createFilter(
149+
150+
IResourceFilterDescription.EXCLUDE_ALL
151+
152+
| IResourceFilterDescription.FOLDERS
153+
154+
| IResourceFilterDescription.INHERITABLE
155+
156+
, new FileInfoMatcherDescription("org.eclipse.ui.ide.patternFilterMatcher", "node_modules"),
157+
IResource.BACKGROUND_REFRESH, new NullProgressMonitor());
158+
159+
_project.createFilter(
160+
161+
IResourceFilterDescription.EXCLUDE_ALL
162+
163+
| IResourceFilterDescription.FOLDERS
164+
165+
| IResourceFilterDescription.INHERITABLE
166+
167+
, new FileInfoMatcherDescription("org.eclipse.ui.ide.patternFilterMatcher", ".git"),
168+
IResource.BACKGROUND_REFRESH, new NullProgressMonitor());
169+
}
145170
}
146171

147172
@Override

0 commit comments

Comments
 (0)