Configuration files are excluded from packaging
authorEugene Ostroukhov <eugeneo@symbian.org>
Thu, 25 Mar 2010 14:10:40 -0700
changeset 283 c035b31473c1
parent 282 39bbb3a15d6f
child 284 5a06888861c3
Configuration files are excluded from packaging
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java	Thu Mar 25 12:51:27 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/util/ProjectUtils.java	Thu Mar 25 14:10:40 2010 -0700
@@ -268,10 +268,40 @@
 
         addWrtNature(project);
 
+        excludeResources(project);
+
         monitor.done();
         return project;
     }
 
+    private static void excludeResources(IProject project) {
+        IFile file = project.getFile(IProjectDescription.DESCRIPTION_FILE_NAME);
+        if (file.exists()) {
+            exclude(file);
+        }
+        IFolder settings = project.getFolder(".settings");
+        if (settings.exists()) {
+            excludeFolder(settings);
+            exclude(settings);
+        }
+    }
+
+    private static void excludeFolder(IFolder folder) {
+        exclude(folder);
+        try {
+            IResource[] members = folder.members();
+            for (IResource resource : members) {
+                if (resource.getType() == IResource.FOLDER) {
+                    excludeFolder((IFolder) resource);
+                } else {
+                    exclude(resource);
+                }
+            }
+        } catch (CoreException e) {
+            Activator.log(e);
+        }
+    }
+
     public static List<Object> filterExternalProjectEntries(List<Object> fileSystemObjects) {
         List<Object> result = new LinkedList<Object>();
         for (Object object : fileSystemObjects) {