| 96 | } |
| 97 | |
| 98 | private void prunePackages() { |
| 99 | String sha1 = System.getProperty("defold.editor.sha1"); |
| 100 | String resourcesPath = System.getProperty("defold.resourcespath"); |
| 101 | if (sha1 != null && resourcesPath != null) { |
| 102 | try { |
| 103 | File dir = new File(resourcesPath, "packages"); |
| 104 | if (dir.exists() && dir.isDirectory()) { |
| 105 | Collection<File> files = FileUtils.listFiles(dir, new WildcardFileFilter("defold-*.jar"), FalseFileFilter.FALSE); |
| 106 | for (File f : files) { |
| 107 | if (!f.getName().contains(sha1)) { |
| 108 | f.delete(); |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | } catch (Throwable t) { |
| 113 | t.printStackTrace(); |
| 114 | logger.error("could not prune packages", t); |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * The editor loads its namespaces in parallel. Since these namespaces import classes, |