mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-26 00:37:10 -07:00
More Windows tweaks
This commit is contained in:
parent
35887e7d06
commit
7face792f2
2 changed files with 19 additions and 1 deletions
|
@ -161,7 +161,9 @@ public record Repository(String location, String username, String password) {
|
|||
var separator = "/";
|
||||
var result = new StringBuilder();
|
||||
if (isLocal()) {
|
||||
separator = File.separator;
|
||||
if (isWindowsLocation()) {
|
||||
separator = File.separator;
|
||||
}
|
||||
if (location().startsWith("file://")) {
|
||||
result.append(location().substring("file://".length()));
|
||||
} else {
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
package rife.bld.dependencies;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.condition.EnabledOnOs;
|
||||
import org.junit.jupiter.api.condition.OS;
|
||||
import rife.ioc.HierarchicalProperties;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
@ -78,11 +80,25 @@ public class TestRepository {
|
|||
assertEquals("/local/repo/groupId3/artifactId3/", repository3.getArtifactLocation("groupId3", "artifactId3"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnabledOnOs(OS.WINDOWS)
|
||||
void testArtifactLocationWindows() {
|
||||
var repository1 = new Repository("c:\\local\\repo");
|
||||
assertNotNull(repository1);
|
||||
assertEquals("c:\\local\\repo\\groupId1\\artifactId1\\", repository1.getArtifactLocation("groupId1", "artifactId1"));
|
||||
|
||||
var repository2 = new Repository("E:\\local\\repo");
|
||||
assertNotNull(repository2);
|
||||
assertEquals("E:\\local\\repo\\groupId2\\artifactId2\\", repository2.getArtifactLocation("groupId2", "artifactId2"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testIsLocal() {
|
||||
assertFalse(new Repository("http://my.repo").isLocal());
|
||||
assertTrue(new Repository("file:///local/repo").isLocal());
|
||||
assertTrue(new Repository("//local/repo").isLocal());
|
||||
assertTrue(new Repository("c:\\local\\repo").isLocal());
|
||||
assertTrue(new Repository("E:\\local\\repo").isLocal());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue