mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-26 08:37:11 -07:00
Replaced all append("x") with append('x')
This commit is contained in:
parent
102d3d3586
commit
60deb1906a
11 changed files with 27 additions and 27 deletions
|
@ -1546,22 +1546,22 @@ public class BaseProject extends BuildExecutor {
|
||||||
var finger_print = new StringBuilder();
|
var finger_print = new StringBuilder();
|
||||||
for (var repository : repositories()) {
|
for (var repository : repositories()) {
|
||||||
finger_print.append(repository.toString());
|
finger_print.append(repository.toString());
|
||||||
finger_print.append("\n");
|
finger_print.append('\n');
|
||||||
}
|
}
|
||||||
for (var entry : dependencies().entrySet()) {
|
for (var entry : dependencies().entrySet()) {
|
||||||
finger_print.append(entry.getKey());
|
finger_print.append(entry.getKey());
|
||||||
finger_print.append("\n");
|
finger_print.append('\n');
|
||||||
if (entry.getValue() != null) {
|
if (entry.getValue() != null) {
|
||||||
for (var dependency : entry.getValue()) {
|
for (var dependency : entry.getValue()) {
|
||||||
finger_print.append(dependency.toString());
|
finger_print.append(dependency.toString());
|
||||||
finger_print.append("\n");
|
finger_print.append('\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finger_print.append(downloadSources());
|
finger_print.append(downloadSources());
|
||||||
finger_print.append("\n");
|
finger_print.append('\n');
|
||||||
finger_print.append(downloadJavadoc());
|
finger_print.append(downloadJavadoc());
|
||||||
finger_print.append("\n");
|
finger_print.append('\n');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var digest = MessageDigest.getInstance("SHA-1");
|
var digest = MessageDigest.getInstance("SHA-1");
|
||||||
|
|
|
@ -399,7 +399,7 @@ public class BuildExecutor {
|
||||||
fuzzy_regexp.append(ch);
|
fuzzy_regexp.append(ch);
|
||||||
fuzzy_regexp.append("\\E.*");
|
fuzzy_regexp.append("\\E.*");
|
||||||
}
|
}
|
||||||
fuzzy_regexp.append("$");
|
fuzzy_regexp.append('$');
|
||||||
var fuzzy_pattern = Pattern.compile(fuzzy_regexp.toString());
|
var fuzzy_pattern = Pattern.compile(fuzzy_regexp.toString());
|
||||||
matches.addAll(buildCommands().keySet().stream()
|
matches.addAll(buildCommands().keySet().stream()
|
||||||
.filter(c -> fuzzy_pattern.matcher(c.toLowerCase()).matches())
|
.filter(c -> fuzzy_pattern.matcher(c.toLowerCase()).matches())
|
||||||
|
|
|
@ -130,9 +130,9 @@ public record Dependency(String groupId, String artifactId, VersionNumber versio
|
||||||
*/
|
*/
|
||||||
public String toFileName() {
|
public String toFileName() {
|
||||||
var result = new StringBuilder(artifactId());
|
var result = new StringBuilder(artifactId());
|
||||||
result.append("-").append(version());
|
result.append('-').append(version());
|
||||||
if (!classifier().isEmpty()) {
|
if (!classifier().isEmpty()) {
|
||||||
result.append("-").append(classifier());
|
result.append('-').append(classifier());
|
||||||
}
|
}
|
||||||
result.append(".").append(type());
|
result.append(".").append(type());
|
||||||
return result.toString();
|
return result.toString();
|
||||||
|
@ -142,13 +142,13 @@ public record Dependency(String groupId, String artifactId, VersionNumber versio
|
||||||
public String toString() {
|
public String toString() {
|
||||||
var result = new StringBuilder(groupId).append(":").append(artifactId);
|
var result = new StringBuilder(groupId).append(":").append(artifactId);
|
||||||
if (!version.equals(VersionNumber.UNKNOWN)) {
|
if (!version.equals(VersionNumber.UNKNOWN)) {
|
||||||
result.append(":").append(version);
|
result.append(':').append(version);
|
||||||
}
|
}
|
||||||
if (!classifier.isEmpty()) {
|
if (!classifier.isEmpty()) {
|
||||||
result.append(":").append(classifier);
|
result.append(':').append(classifier);
|
||||||
}
|
}
|
||||||
if (!type.isEmpty() && !"jar".equals(type)) {
|
if (!type.isEmpty() && !"jar".equals(type)) {
|
||||||
result.append("@").append(type);
|
result.append('@').append(type);
|
||||||
}
|
}
|
||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,15 +315,15 @@ public class DependencyResolver {
|
||||||
|
|
||||||
return getArtifactLocations().stream().map(a -> {
|
return getArtifactLocations().stream().map(a -> {
|
||||||
var result = new StringBuilder();
|
var result = new StringBuilder();
|
||||||
result.append(version).append("/").append(dependency_.artifactId()).append("-").append(pom_version);
|
result.append(version).append('/').append(dependency_.artifactId()).append('-').append(pom_version);
|
||||||
if (!dependency_.classifier().isEmpty()) {
|
if (!dependency_.classifier().isEmpty()) {
|
||||||
result.append("-").append(dependency_.classifier());
|
result.append('-').append(dependency_.classifier());
|
||||||
}
|
}
|
||||||
var type = dependency_.type();
|
var type = dependency_.type();
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
type = "jar";
|
type = "jar";
|
||||||
}
|
}
|
||||||
result.append(".").append(type);
|
result.append('.').append(type);
|
||||||
|
|
||||||
return a.appendPath(result.toString());
|
return a.appendPath(result.toString());
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
|
@ -159,9 +159,9 @@ public record Repository(String location, String username, String password) {
|
||||||
result.append(location());
|
result.append(location());
|
||||||
}
|
}
|
||||||
if (!location().endsWith("/")) {
|
if (!location().endsWith("/")) {
|
||||||
result.append("/");
|
result.append('/');
|
||||||
}
|
}
|
||||||
return result.append(group_path).append("/").append(artifactId).append("/").toString();
|
return result.append(group_path).append('/').append(artifactId).append('/').toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -181,11 +181,11 @@ public record Repository(String location, String username, String password) {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
var result = new StringBuilder(location);
|
var result = new StringBuilder(location);
|
||||||
if (username() != null) {
|
if (username() != null) {
|
||||||
result.append(":");
|
result.append(':');
|
||||||
try {
|
try {
|
||||||
result.append(StringEncryptor.MD5HLO.performEncryption(username(), null));
|
result.append(StringEncryptor.MD5HLO.performEncryption(username(), null));
|
||||||
if (password() != null) {
|
if (password() != null) {
|
||||||
result.append(":");
|
result.append(':');
|
||||||
result.append(StringEncryptor.MD5HLO.performEncryption(password(), null));
|
result.append(StringEncryptor.MD5HLO.performEncryption(password(), null));
|
||||||
}
|
}
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
|
|
@ -223,7 +223,7 @@ public record VersionNumber(Integer major, Integer minor, Integer revision, Stri
|
||||||
version.append(minorInt());
|
version.append(minorInt());
|
||||||
}
|
}
|
||||||
if (revision != null) {
|
if (revision != null) {
|
||||||
version.append(".");
|
version.append('.');
|
||||||
version.append(revisionInt());
|
version.append(revisionInt());
|
||||||
}
|
}
|
||||||
if (qualifier != null && !qualifier.isEmpty()) {
|
if (qualifier != null && !qualifier.isEmpty()) {
|
||||||
|
|
|
@ -165,15 +165,15 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
||||||
protected void executePublishArtifacts(Repository repository, VersionNumber actualVersion) {
|
protected void executePublishArtifacts(Repository repository, VersionNumber actualVersion) {
|
||||||
// upload artifacts
|
// upload artifacts
|
||||||
for (var artifact : artifacts()) {
|
for (var artifact : artifacts()) {
|
||||||
var artifact_name = new StringBuilder(info().artifactId()).append("-").append(actualVersion);
|
var artifact_name = new StringBuilder(info().artifactId()).append('-').append(actualVersion);
|
||||||
if (!artifact.classifier().isEmpty()) {
|
if (!artifact.classifier().isEmpty()) {
|
||||||
artifact_name.append("-").append(artifact.classifier());
|
artifact_name.append('-').append(artifact.classifier());
|
||||||
}
|
}
|
||||||
var type = artifact.type();
|
var type = artifact.type();
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
type = "jar";
|
type = "jar";
|
||||||
}
|
}
|
||||||
artifact_name.append(".").append(type);
|
artifact_name.append('.').append(type);
|
||||||
|
|
||||||
executePublishFileArtifact(repository, artifact.file(), info().version() + "/" + artifact_name);
|
executePublishFileArtifact(repository, artifact.file(), info().version() + "/" + artifact_name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -364,7 +364,7 @@ public class Wrapper {
|
||||||
var location = getWrapperDownloadLocation(version);
|
var location = getWrapperDownloadLocation(version);
|
||||||
var result = new StringBuilder(location);
|
var result = new StringBuilder(location);
|
||||||
if (!location.endsWith("/")) {
|
if (!location.endsWith("/")) {
|
||||||
result.append("/");
|
result.append('/');
|
||||||
}
|
}
|
||||||
result.append(fileName);
|
result.append(fileName);
|
||||||
return result.toString();
|
return result.toString();
|
||||||
|
|
|
@ -134,7 +134,7 @@ public class WrapperExtensionResolver {
|
||||||
contents.append(fingerPrintHash_);
|
contents.append(fingerPrintHash_);
|
||||||
for (var file : localArtifacts_) {
|
for (var file : localArtifacts_) {
|
||||||
if (file.exists() && file.canRead()) {
|
if (file.exists() && file.canRead()) {
|
||||||
contents.append("\n").append(file.lastModified()).append(":").append(file.getAbsolutePath());
|
contents.append("\n").append(file.lastModified()).append(':').append(file.getAbsolutePath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,7 @@ public class TestJarOperation {
|
||||||
while (e.hasMoreElements()) {
|
while (e.hasMoreElements()) {
|
||||||
var jar_entry = e.nextElement();
|
var jar_entry = e.nextElement();
|
||||||
content.append(jar_entry.getName());
|
content.append(jar_entry.getName());
|
||||||
content.append("\n");
|
content.append('\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ public class TestJarOperation {
|
||||||
while (e.hasMoreElements()) {
|
while (e.hasMoreElements()) {
|
||||||
var jar_entry = e.nextElement();
|
var jar_entry = e.nextElement();
|
||||||
content.append(jar_entry.getName());
|
content.append(jar_entry.getName());
|
||||||
content.append("\n");
|
content.append('\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class TestWarOperation {
|
||||||
while (e.hasMoreElements()) {
|
while (e.hasMoreElements()) {
|
||||||
var jar_entry = e.nextElement();
|
var jar_entry = e.nextElement();
|
||||||
content.append(jar_entry.getName());
|
content.append(jar_entry.getName());
|
||||||
content.append("\n");
|
content.append('\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue