From 920a57cdd7b63d6f8a0357908f294584d5d9947d Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 8 Dec 2021 10:21:57 +1030 Subject: [PATCH] Update to netbeans 12.6 --- nbproject/build-impl.xml | 400 ++++++++++++++++++++++------------ nbproject/genfiles.properties | 4 +- nbproject/project.properties | 8 +- 3 files changed, 266 insertions(+), 146 deletions(-) diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index 17ac4b8..fa792c7 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -49,9 +49,236 @@ is divided into following sections: - + + + + + + + + + + + + +package netbeans; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; + +public class CoalesceKeyvalue extends Task { + private String property; + + public void setProperty(String property) { + this.property = property; + } + + private String value; + + public void setValue(String value) { + this.value = value; + } + + private String valueSep; + + public void setValueSep(String valueSep) { + this.valueSep = valueSep; + } + + private String entrySep; + + public void setEntrySep(String entrySep) { + this.entrySep = entrySep; + } + + private String multiSep; + + public void setMultiSep(String multiSep) { + this.multiSep = multiSep; + } + + private String outSep; + + public void setOutSep(String outSep) { + this.outSep = outSep; + } + + @Override + public void execute() throws BuildException { + List<String> result = new ArrayList<>(); + Map<String, List<String>> module2Paths = new HashMap<>(); + + for (String entry : value.split(Pattern.quote(entrySep))) { + String[] keyValue = entry.split(Pattern.quote(valueSep), 2); + if (keyValue.length == 1) { + result.add(keyValue[0]); + } else { + module2Paths.computeIfAbsent(keyValue[0], s -> new ArrayList<>()) + .add(keyValue[1].trim()); + } + } + module2Paths.entrySet() + .stream() + .forEach(e -> result.add(e.getKey() + valueSep + e.getValue().stream().collect(Collectors.joining(multiSep)))); + getProject().setProperty(property, result.stream().collect(Collectors.joining(" " + entrySep))); + } + +} + + + + +package netbeans; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; + +public class ModsourceRegexp extends Task { + private String property; + + public void setProperty(String property) { + this.property = property; + } + + private String filePattern; + + public void setFilePattern(String filePattern) { + this.filePattern = filePattern; + } + + private String modsource; + + public void setModsource(String modsource) { + this.modsource = modsource; + } + + private List<String> expandGroup(String grp) { + List<String> exp = new ArrayList<>(); + String item = ""; + int depth = 0; + + for (int i = 0; i < grp.length(); i++) { + char c = grp.charAt(i); + switch (c) { + case '{': + if (depth++ == 0) { + continue; + } + break; + case '}': + if (--depth == 0) { + exp.add(item); + continue; + } + break; + case ',': + if (depth == 1) { + exp.add(item); + item = ""; + continue; + } + default: + break; + } + item = item + c; + } + return exp; + } + + private List<String> pathVariants(String spec) { + return pathVariants(spec, new ArrayList<>()); + } + + private List<String> pathVariants(String spec, List<String> res) { + int start = spec.indexOf('{'); + if (start == -1) { + res.add(spec); + return res; + } + int depth = 1; + int end; + for (end = start + 1; end < spec.length() && depth > 0; end++) { + char c = spec.charAt(end); + switch (c) { + case '{': depth++; break; + case '}': depth--; break; + } + } + String prefix = spec.substring(0, start); + String suffix = spec.substring(end); + expandGroup(spec.substring(start, end)).stream().forEach(item -> { + pathVariants(prefix + item + suffix, res); + }); + return res; + } + + private String toRegexp2(String spec, String filepattern, String separator) { + List<String> prefixes = new ArrayList<>(); + List<String> suffixes = new ArrayList<>(); + pathVariants(spec).forEach(item -> { + suffixes.add(item); + }); + String tail = ""; + String separatorString = separator; + if ("\\".equals(separatorString)) { + separatorString = "\\\\"; + } + if (filepattern != null && !Objects.equals(filepattern, tail)) { + tail = separatorString + filepattern; + } + return "([^" + separatorString +"]+)\\Q" + separator + "\\E(" + suffixes.stream().collect(Collectors.joining("|")) + ")" + tail; + } + + @Override + public void execute() throws BuildException { + getProject().setProperty(property, toRegexp2(modsource, filePattern, getProject().getProperty("file.separator"))); + } + +} + + + + +package netbeans; + +import java.io.File; +import java.util.Arrays; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.types.selectors.BaseExtendSelector; + +public class ModuleInfoSelector extends BaseExtendSelector { + + @Override + public boolean isSelected(File basedir, String filename, File file) throws BuildException { + String extension = Arrays.stream(getParameters()) + .filter(p -> "extension".equals(p.getName())) + .map(p -> p.getValue()) + .findAny() + .get(); + return !new File(file, "module-info." + extension).exists(); + } + +} + + + + + + + + @@ -87,9 +314,6 @@ is divided into following sections: - - self.setSelected(!new java.io.File(file, "module-info.java").exists()); - @@ -859,131 +1083,6 @@ is divided into following sections: - - - - - - - - - - function coalesce(input, keyValueSeparator, multiSeparator, entrySeparator) { - var result = []; - var values = {}; - - (typeof input === "string" ? input.split(entrySeparator) : input).forEach(function(entry) { - var idx = entry.indexOf(keyValueSeparator); - if (idx < 1) { - result.push(entry); - } else { - var key = entry.substring(0, idx); - var val = entry.substring(idx + 1); - if (!values[key]) { - values[key] = []; - } - values[key].push(val.trim()); - } - }); - Object.keys(values).sort().forEach(function(k) { - result.push(k + keyValueSeparator + values[k].join(multiSeparator)); - }); - return result.join(" " + entrySeparator); - } - self.project.setProperty(attributes.get("property"), - coalesce(attributes.get("value"), - attributes.get("value-sep"), - attributes.get("entry-sep"), - attributes.get("multi-sep") - )); - - - - - - - - - function expandGroup(grp) { - var exp = []; - var item = ""; - var depth = 0; - - for (i = 0; i < grp.length; i++) { - var c = grp[i]; - switch (c) { - case '{': - if (depth++ === 0) { - continue; - } - break; - case '}': - if (--depth === 0) { - exp.push(item); - continue; - } - break; - case ',': - if (depth === 1) { - exp.push(item); - item = ""; - continue; - } - default: - break; - } - item = item + c; - } - return exp; - } - - function pathVariants(spec, res) { - res = res || []; - var start = spec.indexOf('{'); - if (start === -1) { - res.push(spec); - return res; - } - var depth = 1; - var end; - for (end = start + 1; end < spec.length && depth > 0; end++) { - var c = spec[end]; - switch (c) { - case '{': depth++; break; - case '}': depth--; break; - } - } - var prefix = spec.substring(0, start); - var suffix = spec.substring(end); - expandGroup(spec.slice(start, end)).forEach(function (item) { - pathVariants(prefix + item + suffix, res); - }) - return res; - } - - function toRegexp2(spec, filepattern, separator) { - var prefixes = []; - var suffixes = []; - pathVariants(spec).forEach(function(item) { - suffixes.push(item); - }); - var tail = ""; - var separatorString = separator; - if (separatorString == "\\") { - separatorString = "\\\\"; - } - if (filepattern && filepattern != tail) { - tail = separatorString + filepattern; - } - return "([^" + separatorString +"]+)\\Q" + separator + "\\E(" + suffixes.join("|") + ")" + tail; - } - self.project.setProperty(attributes.get("property"), - toRegexp2(attributes.get("modsource"), attributes.get("filepattern"), self.project.getProperty("file.separator"))); - - - - - @@ -1052,7 +1151,7 @@ is divided into following sections: - + @@ -1068,6 +1167,17 @@ is divided into following sections: + + + + + + + + + + + @@ -1078,7 +1188,7 @@ is divided into following sections: - + @@ -1232,6 +1342,18 @@ is divided into following sections: + + + + + + + + + + + + @@ -1481,9 +1603,9 @@ is divided into following sections: - - self.setSelected(!new java.io.File(file, "module-info.class").exists()); - + + + @@ -1492,7 +1614,7 @@ is divided into following sections: - + @@ -1525,7 +1647,7 @@ is divided into following sections: - + @@ -1642,6 +1764,7 @@ is divided into following sections: + @@ -1696,7 +1819,10 @@ is divided into following sections: - + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 7d6d351..9cb8da4 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=32069288@1.6.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=d287ed4e -nbproject/build-impl.xml.script.CRC32=11e54fa7 -nbproject/build-impl.xml.stylesheet.CRC32=0f0529df@1.6.1 +nbproject/build-impl.xml.script.CRC32=727ac37b +nbproject/build-impl.xml.stylesheet.CRC32=d1ebcf0f@1.14 diff --git a/nbproject/project.properties b/nbproject/project.properties index 76b3556..81e958a 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -36,9 +36,6 @@ dist.jlink.dir=${dist.dir}/jlink dist.jlink.output=${dist.jlink.dir}/notzed.nativez endorsed.classpath= excludes= -file.reference.javafx.base.jar=/data/linux-amd64/javafx-sdk-11.0.2/lib/javafx.base.jar -file.reference.javafx.controls.jar=/data/linux-amd64/javafx-sdk-11.0.2/lib/javafx.controls.jar -file.reference.javafx.graphics.jar=/data/linux-amd64/javafx-sdk-11.0.2/lib/javafx.graphics.jar includes=** jar.compress=false javac.classpath= @@ -46,10 +43,7 @@ javac.classpath= javac.compilerargs=-Xlint:unchecked javac.deprecation=false javac.external.vm=false -javac.modulepath=\ - ${file.reference.javafx.base.jar}:\ - ${file.reference.javafx.graphics.jar}:\ - ${file.reference.javafx.controls.jar} +javac.modulepath= javac.processormodulepath= javac.processorpath=\ ${javac.classpath} -- 2.39.5