mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-25 16:27:11 -07:00
Migrated syntax to Java 8+
This commit is contained in:
parent
6d082c1bac
commit
e69f4fe554
5 changed files with 21 additions and 23 deletions
|
@ -132,11 +132,9 @@ public class BldBuild extends AbstractRife2Build {
|
||||||
f.perms(0755);
|
f.perms(0755);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
b.dir("lib", l -> {
|
b.dir("lib", l -> l.file("bld-wrapper.jar", f -> f.move(path(tmp, "lib", "bld", "bld-wrapper.jar"))));
|
||||||
l.file("bld-wrapper.jar", f -> f.move(path(tmp, "lib", "bld", "bld-wrapper.jar")));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
t.dir("lib", l -> l.delete());
|
t.dir("lib", DirBuilder::delete);
|
||||||
});
|
});
|
||||||
|
|
||||||
zipBldOperation
|
zipBldOperation
|
||||||
|
|
|
@ -89,20 +89,19 @@ public class Xml2MavenMetadata extends Xml2Data implements MavenMetadata {
|
||||||
public void endDocument()
|
public void endDocument()
|
||||||
throws SAXException {
|
throws SAXException {
|
||||||
// determine latest stable version by removing pre-release qualifiers
|
// determine latest stable version by removing pre-release qualifiers
|
||||||
var filtered_versions = new TreeSet<VersionNumber>();
|
var filtered_versions = new TreeSet<>(versions_.stream()
|
||||||
filtered_versions.addAll(versions_.stream()
|
.filter(v -> {
|
||||||
.filter(v -> {
|
if (v.qualifier() == null) return true;
|
||||||
if (v.qualifier() == null) return true;
|
var q = v.qualifier().toLowerCase();
|
||||||
var q = v.qualifier().toLowerCase();
|
return !q.startsWith("rc") &&
|
||||||
return !q.startsWith("rc") &&
|
!q.startsWith("cr") &&
|
||||||
!q.startsWith("cr") &&
|
!q.contains("milestone") &&
|
||||||
!q.contains("milestone") &&
|
!MILESTONE.matcher(q).matches() &&
|
||||||
!MILESTONE.matcher(q).matches() &&
|
!q.contains("beta") &&
|
||||||
!q.contains("beta") &&
|
!BETA.matcher(q).matches() &&
|
||||||
!BETA.matcher(q).matches() &&
|
!q.contains("alpha") &&
|
||||||
!q.contains("alpha") &&
|
!ALPHA.matcher(q).matches();
|
||||||
!ALPHA.matcher(q).matches();
|
}).toList());
|
||||||
}).toList());
|
|
||||||
|
|
||||||
// only replace the stable version from the metadata when
|
// only replace the stable version from the metadata when
|
||||||
// something remained from the filtering, then use the
|
// something remained from the filtering, then use the
|
||||||
|
|
|
@ -364,10 +364,10 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
|
||||||
public T fromArguments(List<String> arguments) {
|
public T fromArguments(List<String> arguments) {
|
||||||
String package_name = null;
|
String package_name = null;
|
||||||
String project_name = null;
|
String project_name = null;
|
||||||
if (arguments.size() > 0) {
|
if (!arguments.isEmpty()) {
|
||||||
package_name = arguments.remove(0);
|
package_name = arguments.remove(0);
|
||||||
}
|
}
|
||||||
if (arguments.size() > 0) {
|
if (!arguments.isEmpty()) {
|
||||||
project_name = arguments.remove(0);
|
project_name = arguments.remove(0);
|
||||||
}
|
}
|
||||||
if ((package_name == null || project_name == null) && System.console() == null) {
|
if ((package_name == null || project_name == null) && System.console() == null) {
|
||||||
|
|
|
@ -27,13 +27,13 @@ public class CreateOperation {
|
||||||
String type = null;
|
String type = null;
|
||||||
String package_name = null;
|
String package_name = null;
|
||||||
String project_name = null;
|
String project_name = null;
|
||||||
if (arguments.size() > 0) {
|
if (!arguments.isEmpty()) {
|
||||||
type = arguments.remove(0);
|
type = arguments.remove(0);
|
||||||
}
|
}
|
||||||
if (arguments.size() > 0) {
|
if (!arguments.isEmpty()) {
|
||||||
package_name = arguments.remove(0);
|
package_name = arguments.remove(0);
|
||||||
}
|
}
|
||||||
if (arguments.size() > 0) {
|
if (!arguments.isEmpty()) {
|
||||||
project_name = arguments.remove(0);
|
project_name = arguments.remove(0);
|
||||||
}
|
}
|
||||||
if ((type == null || package_name == null || project_name == null) && System.console() == null) {
|
if ((type == null || package_name == null || project_name == null) && System.console() == null) {
|
||||||
|
|
|
@ -94,6 +94,7 @@ public class JarOperation extends AbstractOperation<JarOperation> {
|
||||||
// don't use putAll since Attributes does an instanceof check
|
// don't use putAll since Attributes does an instanceof check
|
||||||
// on the map being passed in, causing it to fail if it's not
|
// on the map being passed in, causing it to fail if it's not
|
||||||
// and instance of Attributes
|
// and instance of Attributes
|
||||||
|
//noinspection UseBulkOperation
|
||||||
attributes.put(entry.getKey(), entry.getValue());
|
attributes.put(entry.getKey(), entry.getValue());
|
||||||
// ^^^ READ above, don't use putAll
|
// ^^^ READ above, don't use putAll
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue