Compare commits

..

No commits in common. "6f54789dd966a7b90d4e477d318465876c0a2bac" and "5efbc8c064f7dfe9c77f465fdb6fb9114dcc1090" have entirely different histories.

5 changed files with 47 additions and 64 deletions

View file

@ -87,19 +87,12 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
for (var directory : mainSourceDirectories()) { for (var directory : mainSourceDirectories()) {
sources.addAll(FileUtils.getJavaFileList(directory)); sources.addAll(FileUtils.getJavaFileList(directory));
} }
if (sources.isEmpty()) {
if (!silent()) {
System.err.println("No main source files found.");
}
} else {
executeBuildSources( executeBuildSources(
compileMainClasspath(), compileMainClasspath(),
compileMainModulePath(), compileMainModulePath(),
sources, sources,
buildMainDirectory()); buildMainDirectory());
} }
}
/** /**
* Part of the {@link #execute} operation, builds the test sources. * Part of the {@link #execute} operation, builds the test sources.
@ -112,19 +105,12 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
for (var directory : testSourceDirectories()) { for (var directory : testSourceDirectories()) {
sources.addAll(FileUtils.getJavaFileList(directory)); sources.addAll(FileUtils.getJavaFileList(directory));
} }
if (sources.isEmpty()) {
if (!silent()) {
System.err.println("No test source files found.");
}
} else {
executeBuildSources( executeBuildSources(
compileTestClasspath(), compileTestClasspath(),
compileTestModulePath(), compileTestModulePath(),
sources, sources,
buildTestDirectory()); buildTestDirectory());
} }
}
/** /**
* Part of the {@link #execute} operation, build sources to a destination. * Part of the {@link #execute} operation, build sources to a destination.

View file

@ -42,17 +42,16 @@ public class RunOperation extends AbstractProcessOperation<RunOperation> {
args.add(FileUtils.joinPaths(modulePath())); args.add(FileUtils.joinPaths(modulePath()));
} }
if (mainClass() != null && !mainClass().isEmpty()) {
if (module() != null && !module().isEmpty()) { if (module() != null && !module().isEmpty()) {
args.add("-m"); args.add("-m");
args.add(module() + "/" + mainClass()); args.add(module());
} else args.add(mainClass());
} }
else if (!silent()) { else if (mainClass() != null && !mainClass().isEmpty()){
System.err.println("No main class or module specified."); args.add(mainClass());
} }
args.addAll(runOptions()); args.addAll(runOptions());
return args; return args;
} }

View file

@ -1 +1 @@
2.3.1-SNAPSHOT 2.3.0

View file

@ -331,17 +331,15 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileRuntimeDependenciesBitly() { void testGetCompileRuntimeDependenciesBitly() {
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 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 dependencies = resolver.getDirectDependencies(compile, runtime); var dependencies = resolver.getDirectDependencies(compile, runtime);
assertNotNull(dependencies); assertNotNull(dependencies);
assertEquals(6, dependencies.size()); assertEquals(4, dependencies.size());
assertEquals(""" assertEquals("""
org.jetbrains.kotlin:kotlin-stdlib:2.1.10 org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22
org.jetbrains.kotlin:kotlin-stdlib-common:2.1.10 com.squareup.okhttp3:okhttp:4.11.0
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10 com.squareup.okhttp3:logging-interceptor:4.11.0
com.squareup.okhttp3:okhttp:4.12.0 org.json:json:20230618""", StringUtils.join(dependencies, "\n"));
com.squareup.okhttp3:logging-interceptor:4.12.0
org.json:json:20250107""", StringUtils.join(dependencies, "\n"));
} }
@Test @Test
@ -704,22 +702,22 @@ public class TestDependencyResolver {
@Test @Test
void testGetCompileRuntimeTransitiveDependenciesBitly() { void testGetCompileRuntimeTransitiveDependenciesBitly() {
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 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 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:2.0.0 net.thauvin.erik:bitly-shorten:0.9.4-SNAPSHOT
org.jetbrains.kotlin:kotlin-stdlib:2.1.10 org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22
org.jetbrains.kotlin:kotlin-stdlib-common:2.1.10 com.squareup.okhttp3:okhttp:4.11.0
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10 com.squareup.okhttp3:logging-interceptor:4.11.0
com.squareup.okhttp3:okhttp:4.12.0 org.json:json:20230618
com.squareup.okhttp3:logging-interceptor:4.12.0 org.jetbrains.kotlin:kotlin-stdlib:1.8.22
org.json:json:20250107 org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22
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
org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.10 com.squareup.okio:okio-jvm:3.2.0""", StringUtils.join(dependencies, "\n"));
com.squareup.okio:okio:3.6.0
com.squareup.okio:okio-jvm:3.6.0""", StringUtils.join(dependencies, "\n"));
} }
@Test @Test

View file

@ -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(2, 0, 0))); .include(new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(0, 9, 4, "SNAPSHOT")));
assertEquals(StringUtils.convertLineSeparator(""" assertEquals(StringUtils.convertLineSeparator("""
net.thauvin.erik:bitly-shorten:2.0.0 net.thauvin.erik:bitly-shorten:0.9.4-SNAPSHOT
org.jetbrains.kotlin:kotlin-stdlib:2.1.10 org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22
org.jetbrains:annotations:13.0 org.jetbrains.kotlin:kotlin-stdlib:1.8.22
org.jetbrains.kotlin:kotlin-stdlib-common:2.1.10 org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10 org.jetbrains:annotations:13.0
org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.10 org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22
com.squareup.okhttp3:okhttp:4.12.0 com.squareup.okhttp3:okhttp:4.11.0
com.squareup.okio:okio:3.6.0 com.squareup.okio:okio:3.2.0
com.squareup.okio:okio-jvm:3.6.0 com.squareup.okio:okio-jvm:3.2.0
com.squareup.okhttp3:logging-interceptor:4.12.0 com.squareup.okhttp3:logging-interceptor:4.11.0
org.json:json:20250107 org.json:json:20230618
"""), dependencies.generateTransitiveDependencyTree(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), compile, runtime)); """), dependencies.generateTransitiveDependencyTree(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY), compile, runtime));
} }
} }