From: Not Zed Date: Tue, 7 Dec 2021 23:14:24 +0000 (+1030) Subject: Update to netbeans 12.6 X-Git-Url: https://code.zedzone.au/cvs?a=commitdiff_plain;h=3dbc875787977333ac30e061ec7a83b3b2ee04c0;p=jjmpeg Update to netbeans 12.6 Change to unversioned javafx library. --- diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index b99e03e..b1cab23 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()); - @@ -877,131 +1101,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"))); - - - - - @@ -1076,7 +1175,7 @@ is divided into following sections: - + @@ -1092,6 +1191,17 @@ is divided into following sections: + + + + + + + + + + + @@ -1102,7 +1212,7 @@ is divided into following sections: - + @@ -1256,6 +1366,18 @@ is divided into following sections: + + + + + + + + + + + + @@ -1511,9 +1633,9 @@ is divided into following sections: - - self.setSelected(!new java.io.File(file, "module-info.class").exists()); - + + + @@ -1522,7 +1644,7 @@ is divided into following sections: - + @@ -1555,7 +1677,7 @@ is divided into following sections: - + @@ -1672,6 +1794,7 @@ is divided into following sections: + @@ -1735,7 +1858,10 @@ is divided into following sections: - + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 25527d6..7a55b4f 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=6ecd1560 -nbproject/build-impl.xml.script.CRC32=2c0bce54 -nbproject/build-impl.xml.stylesheet.CRC32=0f0529df@1.6.1 +nbproject/build-impl.xml.script.CRC32=be3f04f6 +nbproject/build-impl.xml.stylesheet.CRC32=d1ebcf0f@1.14 diff --git a/nbproject/project.properties b/nbproject/project.properties index d7de40b..03af6c8 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.jjmpeg endorsed.classpath= excludes= -file.reference.javafx.base.jar=/data/linux-amd64/javafx-sdk-13/lib/javafx.base.jar -file.reference.javafx.controls.jar=/data/linux-amd64/javafx-sdk-13/lib/javafx.controls.jar -file.reference.javafx.graphics.jar=/data/linux-amd64/javafx-sdk-13/lib/javafx.graphics.jar includes=** jar.compress=false javac.classpath= @@ -47,10 +44,8 @@ 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}:\ - ${reference.notzed_nativez.notzed_nativez_jar} + ${reference.notzed_nativez.notzed_nativez_jar}:\ + ${libs.JavaFX.classpath} javac.processormodulepath= javac.processorpath=\ ${javac.classpath}