mirror of
https://github.com/rife2/bld
synced 2026-04-26 17:54:09 +02:00
Compare commits
7 commits
5efbc8c064
...
6f54789dd9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f54789dd9 | ||
|
|
82fe6a3aa4 | ||
|
|
52e8a6ce6a | ||
|
|
f33108a3f0 | ||
|
|
f4db05581b | ||
|
|
ba1dad4eb3 | ||
|
|
82705b952b |
|
|
@ -87,11 +87,18 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
|
||||||
for (var directory : mainSourceDirectories()) {
|
for (var directory : mainSourceDirectories()) {
|
||||||
sources.addAll(FileUtils.getJavaFileList(directory));
|
sources.addAll(FileUtils.getJavaFileList(directory));
|
||||||
}
|
}
|
||||||
executeBuildSources(
|
|
||||||
compileMainClasspath(),
|
if (sources.isEmpty()) {
|
||||||
compileMainModulePath(),
|
if (!silent()) {
|
||||||
sources,
|
System.err.println("No main source files found.");
|
||||||
buildMainDirectory());
|
}
|
||||||
|
} else {
|
||||||
|
executeBuildSources(
|
||||||
|
compileMainClasspath(),
|
||||||
|
compileMainModulePath(),
|
||||||
|
sources,
|
||||||
|
buildMainDirectory());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -105,11 +112,18 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
|
||||||
for (var directory : testSourceDirectories()) {
|
for (var directory : testSourceDirectories()) {
|
||||||
sources.addAll(FileUtils.getJavaFileList(directory));
|
sources.addAll(FileUtils.getJavaFileList(directory));
|
||||||
}
|
}
|
||||||
executeBuildSources(
|
|
||||||
compileTestClasspath(),
|
if (sources.isEmpty()) {
|
||||||
compileTestModulePath(),
|
if (!silent()) {
|
||||||
sources,
|
System.err.println("No test source files found.");
|
||||||
buildTestDirectory());
|
}
|
||||||
|
} else {
|
||||||
|
executeBuildSources(
|
||||||
|
compileTestClasspath(),
|
||||||
|
compileTestModulePath(),
|
||||||
|
sources,
|
||||||
|
buildTestDirectory());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -42,16 +42,17 @@ public class RunOperation extends AbstractProcessOperation<RunOperation> {
|
||||||
args.add(FileUtils.joinPaths(modulePath()));
|
args.add(FileUtils.joinPaths(modulePath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (module() != null && !module().isEmpty()) {
|
if (mainClass() != null && !mainClass().isEmpty()) {
|
||||||
args.add("-m");
|
if (module() != null && !module().isEmpty()) {
|
||||||
args.add(module());
|
args.add("-m");
|
||||||
|
args.add(module() + "/" + mainClass());
|
||||||
|
} else args.add(mainClass());
|
||||||
}
|
}
|
||||||
else if (mainClass() != null && !mainClass().isEmpty()){
|
else if (!silent()) {
|
||||||
args.add(mainClass());
|
System.err.println("No main class or module specified.");
|
||||||
}
|
}
|
||||||
|
|
||||||
args.addAll(runOptions());
|
args.addAll(runOptions());
|
||||||
|
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
2.3.0
|
2.3.1-SNAPSHOT
|
||||||
|
|
@ -331,15 +331,17 @@ public class TestDependencyResolver {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testGetCompileRuntimeDependenciesBitly() {
|
void testGetCompileRuntimeDependenciesBitly() {
|
||||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY), new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(0, 9, 4, "SNAPSHOT")));
|
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(2, 0, 0)));
|
||||||
var dependencies = resolver.getDirectDependencies(compile, runtime);
|
var dependencies = resolver.getDirectDependencies(compile, runtime);
|
||||||
assertNotNull(dependencies);
|
assertNotNull(dependencies);
|
||||||
assertEquals(4, dependencies.size());
|
assertEquals(6, dependencies.size());
|
||||||
assertEquals("""
|
assertEquals("""
|
||||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22
|
org.jetbrains.kotlin:kotlin-stdlib:2.1.10
|
||||||
com.squareup.okhttp3:okhttp:4.11.0
|
org.jetbrains.kotlin:kotlin-stdlib-common:2.1.10
|
||||||
com.squareup.okhttp3:logging-interceptor:4.11.0
|
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10
|
||||||
org.json:json:20230618""", StringUtils.join(dependencies, "\n"));
|
com.squareup.okhttp3:okhttp:4.12.0
|
||||||
|
com.squareup.okhttp3:logging-interceptor:4.12.0
|
||||||
|
org.json:json:20250107""", StringUtils.join(dependencies, "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -702,22 +704,22 @@ public class TestDependencyResolver {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testGetCompileRuntimeTransitiveDependenciesBitly() {
|
void testGetCompileRuntimeTransitiveDependenciesBitly() {
|
||||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY), new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(0, 9, 4, "SNAPSHOT")));
|
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(2, 0, 0)));
|
||||||
var dependencies = resolver.getAllDependencies(compile, runtime);
|
var dependencies = resolver.getAllDependencies(compile, runtime);
|
||||||
assertNotNull(dependencies);
|
assertNotNull(dependencies);
|
||||||
assertEquals(11, dependencies.size());
|
assertEquals(11, dependencies.size());
|
||||||
assertEquals("""
|
assertEquals("""
|
||||||
net.thauvin.erik:bitly-shorten:0.9.4-SNAPSHOT
|
net.thauvin.erik:bitly-shorten:2.0.0
|
||||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22
|
org.jetbrains.kotlin:kotlin-stdlib:2.1.10
|
||||||
com.squareup.okhttp3:okhttp:4.11.0
|
org.jetbrains.kotlin:kotlin-stdlib-common:2.1.10
|
||||||
com.squareup.okhttp3:logging-interceptor:4.11.0
|
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10
|
||||||
org.json:json:20230618
|
com.squareup.okhttp3:okhttp:4.12.0
|
||||||
org.jetbrains.kotlin:kotlin-stdlib:1.8.22
|
com.squareup.okhttp3:logging-interceptor:4.12.0
|
||||||
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22
|
org.json:json:20250107
|
||||||
com.squareup.okio:okio:3.2.0
|
|
||||||
org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22
|
|
||||||
org.jetbrains:annotations:13.0
|
org.jetbrains:annotations:13.0
|
||||||
com.squareup.okio:okio-jvm:3.2.0""", StringUtils.join(dependencies, "\n"));
|
org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.10
|
||||||
|
com.squareup.okio:okio:3.6.0
|
||||||
|
com.squareup.okio:okio-jvm:3.6.0""", StringUtils.join(dependencies, "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
|
|
@ -359,19 +359,19 @@ public class TestDependencySet {
|
||||||
@Test
|
@Test
|
||||||
void testGenerateDependencyTreeCompileRuntime() {
|
void testGenerateDependencyTreeCompileRuntime() {
|
||||||
var dependencies = new DependencySet()
|
var dependencies = new DependencySet()
|
||||||
.include(new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(0, 9, 4, "SNAPSHOT")));
|
.include(new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(2, 0, 0)));
|
||||||
assertEquals(StringUtils.convertLineSeparator("""
|
assertEquals(StringUtils.convertLineSeparator("""
|
||||||
└─ net.thauvin.erik:bitly-shorten:0.9.4-SNAPSHOT
|
└─ net.thauvin.erik:bitly-shorten:2.0.0
|
||||||
├─ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22
|
├─ org.jetbrains.kotlin:kotlin-stdlib:2.1.10
|
||||||
│ ├─ org.jetbrains.kotlin:kotlin-stdlib:1.8.22
|
│ └─ org.jetbrains:annotations:13.0
|
||||||
│ │ ├─ org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22
|
├─ org.jetbrains.kotlin:kotlin-stdlib-common:2.1.10
|
||||||
│ │ └─ org.jetbrains:annotations:13.0
|
├─ org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10
|
||||||
│ └─ org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22
|
│ └─ org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.10
|
||||||
├─ com.squareup.okhttp3:okhttp:4.11.0
|
├─ com.squareup.okhttp3:okhttp:4.12.0
|
||||||
│ └─ com.squareup.okio:okio:3.2.0
|
│ └─ com.squareup.okio:okio:3.6.0
|
||||||
│ └─ com.squareup.okio:okio-jvm:3.2.0
|
│ └─ com.squareup.okio:okio-jvm:3.6.0
|
||||||
├─ com.squareup.okhttp3:logging-interceptor:4.11.0
|
├─ com.squareup.okhttp3:logging-interceptor:4.12.0
|
||||||
└─ org.json:json:20230618
|
└─ org.json:json:20250107
|
||||||
"""), dependencies.generateTransitiveDependencyTree(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY), compile, runtime));
|
"""), dependencies.generateTransitiveDependencyTree(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), compile, runtime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue