MCPcopy Create free account
hub / github.com/defold/defold / prunePackages

Method prunePackages

editor/src/java/com/defold/editor/Start.java:98–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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,

Callers 1

startMethod · 0.95

Calls 4

existsMethod · 0.65
getNameMethod · 0.65
containsMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected