oops, imports= was in fact being used

This commit is contained in:
Ben Fry
2023-01-19 20:31:58 -05:00
parent 31a6c0668f
commit 701f8646cd
4 changed files with 20 additions and 13 deletions
@@ -46,8 +46,11 @@ public class AvailableContribution extends Contribution {
this.link = params.get("download");
categories = parseCategories(params);
// Only used by Libraries and Modes
imports = parseImports(params, IMPORTS_PROPERTY);
exports = parseImports(params, EXPORTS_PROPERTY);
name = params.get("name");
// formerly authorList (but not a list, just free text)
authors = params.get("authors");
@@ -371,14 +374,14 @@ public class AvailableContribution extends Contribution {
writer.println("minRevision=" + minRev);
writer.println("maxRevision=" + maxRev);
if (getType() == ContributionType.LIBRARY) {
if (importList != null) {
writer.println("imports=" + importList.join(","));
}
if (exportList != null) {
writer.println("exports=" + importList.join(","));
}
// Only used by Libraries and Modes
if (importList != null) {
writer.println("imports=" + importList.join(","));
}
if (exportList != null) {
writer.println("exports=" + importList.join(","));
}
if (getType() == ContributionType.EXAMPLES) {
if (compatibleContribsList != null) {
writer.println(MODES_PROPERTY + "=" + compatibleContribsList);
@@ -101,8 +101,9 @@ abstract public class Contribution {
* behavior of importing all packages in their library.
* As of 230118, no Libraries use this with Processing 4.
* <p/>
* For Modes, several list processing.mode.java.JavaMode as its import,
* however this is not used for anything, and it's only JavaMode.
* For Modes, this may specify another Mode it depends upon, i.e.
* several list processing.mode.java.JavaMode as its import.
*
* @return null if no entries found
*/
public StringList getImports() {
@@ -66,8 +66,11 @@ public abstract class LocalContribution extends Contribution {
name = properties.get("name");
id = properties.get("id");
categories = parseCategories(properties);
// Only used by Libraries and Modes
imports = parseImports(properties, IMPORTS_PROPERTY);
exports = parseImports(properties, EXPORTS_PROPERTY);
if (name == null) {
name = folder.getName();
}
@@ -120,7 +120,7 @@ public class ModeContribution extends LocalContribution {
}
public String initLoader(Base base, String className) throws Exception {
private String initLoader(Base base, String className) throws Exception {
File modeDirectory = new File(folder, getTypeName());
if (modeDirectory.exists()) {
Messages.log("checking mode folder regarding class name " + className);
@@ -147,17 +147,17 @@ public class ModeContribution extends LocalContribution {
// mode.properties), add the dependencies to the classloader
Map<String, Mode> installedModes = new HashMap<>();
for(Mode m: base.getModeList()){
for (Mode m : base.getModeList()) {
// Base.log("Mode contrib: " + m.getClass().getName() + " : "+ m.getFolder());
installedModes.put(m.getClass().getName(), m);
}
for (String modeImport: imports) {
for (String modeImport : imports) {
if (installedModes.containsKey(modeImport)) {
Messages.log("Found mode dependency " + modeImport);
File modeFolder = installedModes.get(modeImport).getFolder();
File[] archives = Util.listJarFiles(new File(modeFolder, "mode"));
if (archives != null && archives.length > 0) {
if (archives != null) {
for (File archive : archives) {
// Base.log("Adding jar dependency: " + archives[i].getAbsolutePath());
extraUrls.add(archive.toURI().toURL());