From: Not Zed Date: Wed, 8 Dec 2021 00:28:17 +0000 (+1030) Subject: Update to netbeans 12.6 X-Git-Url: https://code.zedzone.au/cvs?a=commitdiff_plain;ds=sidebyside;p=zcl Update to netbeans 12.6 --- diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index 489097b..462367f 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()); - @@ -868,131 +1092,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"))); - - - - - @@ -1061,7 +1160,7 @@ is divided into following sections: - + @@ -1077,6 +1176,17 @@ is divided into following sections: + + + + + + + + + + + @@ -1087,7 +1197,7 @@ is divided into following sections: - + @@ -1241,6 +1351,18 @@ is divided into following sections: + + + + + + + + + + + + @@ -1490,9 +1612,9 @@ is divided into following sections: - - self.setSelected(!new java.io.File(file, "module-info.class").exists()); - + + + @@ -1501,7 +1623,7 @@ is divided into following sections: - + @@ -1534,7 +1656,7 @@ is divided into following sections: - + @@ -1651,6 +1773,7 @@ is divided into following sections: + @@ -1714,7 +1837,10 @@ is divided into following sections: - + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index c2d597c..b8d59fa 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=e7caf820 -nbproject/build-impl.xml.script.CRC32=2c69bf13 -nbproject/build-impl.xml.stylesheet.CRC32=0f0529df@1.6.1 +nbproject/build-impl.xml.script.CRC32=6e87119f +nbproject/build-impl.xml.stylesheet.CRC32=d1ebcf0f@1.16 diff --git a/nbproject/project.properties b/nbproject/project.properties index f1aaa57..266d9e1 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -44,7 +44,8 @@ javac.compilerargs=-Xlint:unchecked javac.deprecation=false javac.external.vm=false javac.modulepath=\ - ${reference.notzed_nativez.notzed_nativez_jar} + ${reference.notzed_nativez.notzed_nativez_jar}:\ + ${libs.JavaFX.classpath} javac.processormodulepath= javac.processorpath=\ ${javac.classpath}