mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-26 16:38:11 -07:00
Merge branch 'main' into main
This commit is contained in:
commit
7ceb6e3c27
17 changed files with 117 additions and 70 deletions
|
@ -7,8 +7,10 @@ package rife.bld.dependencies;
|
|||
import rife.ioc.HierarchicalProperties;
|
||||
import rife.tools.StringEncryptor;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Contains the information required to locate a Maven-compatible repository.
|
||||
|
@ -106,6 +108,12 @@ public record Repository(String location, String username, String password) {
|
|||
this(location, null, null);
|
||||
}
|
||||
|
||||
private final static Pattern WINDOWS_ABSOLUTE_PATH = Pattern.compile("^\\p{L}:\\\\");
|
||||
|
||||
private boolean isWindowsLocation() {
|
||||
return WINDOWS_ABSOLUTE_PATH.matcher(location()).find();
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this repository is local.
|
||||
*
|
||||
|
@ -114,7 +122,7 @@ public record Repository(String location, String username, String password) {
|
|||
* @since 1.5.10
|
||||
*/
|
||||
public boolean isLocal() {
|
||||
return location().startsWith("/") || location().startsWith("file:");
|
||||
return location().startsWith("/") || location().startsWith("file:") || isWindowsLocation();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -150,9 +158,10 @@ public record Repository(String location, String username, String password) {
|
|||
* @since 1.5.10
|
||||
*/
|
||||
public String getArtifactLocation(String groupId, String artifactId) {
|
||||
var group_path = groupId.replace(".", "/");
|
||||
var separator = "/";
|
||||
var result = new StringBuilder();
|
||||
if (isLocal()) {
|
||||
separator = File.separator;
|
||||
if (location().startsWith("file://")) {
|
||||
result.append(location().substring("file://".length()));
|
||||
} else {
|
||||
|
@ -161,10 +170,11 @@ public record Repository(String location, String username, String password) {
|
|||
} else {
|
||||
result.append(location());
|
||||
}
|
||||
if (!location().endsWith("/")) {
|
||||
result.append('/');
|
||||
if (!location().endsWith(separator)) {
|
||||
result.append(separator);
|
||||
}
|
||||
return result.append(group_path).append('/').append(artifactId).append('/').toString();
|
||||
var group_path = groupId.replace(".", separator);
|
||||
return result.append(group_path).append(separator).append(artifactId).append(separator).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -78,7 +78,7 @@ public class JavacOptions extends ArrayList<String> {
|
|||
*/
|
||||
public JavacOptions encoding(String name) {
|
||||
add("-encoding");
|
||||
add("name");
|
||||
add(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ public class JavadocOptions extends ArrayList<String> {
|
|||
*/
|
||||
public JavadocOptions doclet(String className) {
|
||||
add("-doclet");
|
||||
add("className");
|
||||
add(className);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class JavadocOptions extends ArrayList<String> {
|
|||
*/
|
||||
public JavadocOptions docletPath(String path) {
|
||||
add("-docletpath");
|
||||
add("path");
|
||||
add(path);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ public class JavadocOptions extends ArrayList<String> {
|
|||
*/
|
||||
public JavadocOptions encoding(String name) {
|
||||
add("-encoding");
|
||||
add("name");
|
||||
add(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ public class JavadocOptions extends ArrayList<String> {
|
|||
*/
|
||||
public JavadocOptions locale(String name) {
|
||||
add("-locale");
|
||||
add("name");
|
||||
add(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue