mirror of
https://github.com/rife2/bld
synced 2026-05-03 04:24:10 +02:00
Compare commits
44 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45c86e7efa | ||
|
|
400dca63d7 | ||
|
|
7b542ac5d0 | ||
|
|
aa10006ce2 | ||
|
|
4de8d3c629 | ||
|
|
44144ce095 | ||
|
|
3160161299 | ||
|
|
b22257ed43 | ||
|
|
25c77ed5df | ||
|
|
21ed5912f0 | ||
|
|
737927da26 | ||
|
|
6fd3948f04 | ||
|
|
c537b584f2 | ||
|
|
7a419ed197 | ||
|
|
9c5928f9b1 | ||
|
|
26ff495b79 | ||
|
|
585325dd46 | ||
|
|
793fde47dc | ||
|
|
fea026a9c6 | ||
|
|
c71a98c6ee | ||
|
|
8ad5414d67 | ||
|
|
684c697896 | ||
|
|
affa9e1dac | ||
|
|
1c70337afb | ||
|
|
25bf0d3595 | ||
|
|
0ec366e90b | ||
|
|
8559696a6a | ||
|
|
6f54789dd9 | ||
|
|
82fe6a3aa4 | ||
|
|
52e8a6ce6a | ||
|
|
f33108a3f0 | ||
|
|
f4db05581b | ||
|
|
ba1dad4eb3 | ||
|
|
82705b952b | ||
|
|
5efbc8c064 | ||
|
|
22752668b7 | ||
|
|
9bea6d47c7 | ||
|
|
b0596911ed | ||
|
|
e9906c0df7 | ||
|
|
d3d7614e7c | ||
|
|
91a621dfea | ||
|
|
5af8ca7b2e | ||
|
|
d6d3c0fc1d | ||
|
|
9158e7296f |
57
.github/workflows/bld.yml
vendored
57
.github/workflows/bld.yml
vendored
|
|
@ -2,6 +2,9 @@ name: bld-ci
|
|||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
env:
|
||||
REPORTS_DIR: "build/test-results/test/"
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -87,7 +90,7 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: [ 17, 20, 21, 22 ]
|
||||
java-version: [ 17, 20, 21, 22, 23, 24, 25 ]
|
||||
|
||||
steps:
|
||||
- name: Checkout source repository
|
||||
|
|
@ -98,25 +101,37 @@ jobs:
|
|||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK ${{ matrix.java-version }}
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'corretto'
|
||||
java-version: ${{ matrix.java-version }}
|
||||
check-latest: true
|
||||
|
||||
- name: Download dependencies
|
||||
run: ./bld clean download
|
||||
|
||||
- name: Compile source
|
||||
run: ./bld compile
|
||||
|
||||
- name: Run tests
|
||||
id: tests
|
||||
run: >-
|
||||
./bld clean download compile test
|
||||
./bld test
|
||||
-Dtest.postgres=true -Dtest.mysql=true -Dtest.mariadb=true -Dtest.oracle=true -Dtest.oracle-free=true
|
||||
-DtestsBadgeUrl=https://rife2.com/tests-badge/update/com.uwyn.rife2/bld
|
||||
-DtestsBadgeApiKey=${{ secrets.TESTS_BADGE_API_KEY }}
|
||||
--reports-dir=${{ env.REPORTS_DIR }}
|
||||
|
||||
- name: Run reporter
|
||||
if: always() && steps.tests.outcome == 'failure'
|
||||
run: ./bld reporter --all
|
||||
|
||||
build-macos:
|
||||
runs-on: macos-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: [ 17, 20, 21, 22 ]
|
||||
java-version: [ 17, 20, 21, 22, 23, 24, 25 ]
|
||||
|
||||
steps:
|
||||
- name: Checkout source repository
|
||||
|
|
@ -127,22 +142,32 @@ jobs:
|
|||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK ${{ matrix.java-version }}
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'corretto'
|
||||
java-version: ${{ matrix.java-version }}
|
||||
check-latest: true
|
||||
|
||||
- name: Download dependencies
|
||||
run: ./bld clean download
|
||||
|
||||
- name: Compile source
|
||||
run: ./bld compile
|
||||
|
||||
- name: Run tests
|
||||
run: >-
|
||||
./bld clean download compile test
|
||||
id: tests
|
||||
run: ./bld test --reports-dir=${{ env.REPORTS_DIR }}
|
||||
|
||||
- name: Run reporter
|
||||
if: always() && steps.tests.outcome == 'failure'
|
||||
run: ./bld reporter --all
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: [ 17, 20, 21, 22 ]
|
||||
java-version: [ 17, 20, 21, 22, 23, 24, 25 ]
|
||||
|
||||
steps:
|
||||
- name: Configure git line endings
|
||||
|
|
@ -156,12 +181,22 @@ jobs:
|
|||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK ${{ matrix.java-version }}
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'corretto'
|
||||
java-version: ${{ matrix.java-version }}
|
||||
check-latest: true
|
||||
|
||||
- name: Download dependencies
|
||||
run: .\bld.bat clean download
|
||||
|
||||
- name: Compile source
|
||||
run: .\bld.bat compile
|
||||
|
||||
- name: Run tests
|
||||
run: >-
|
||||
.\bld.bat clean download compile test
|
||||
id: tests
|
||||
run: .\bld.bat test --reports-dir=${{ env.REPORTS_DIR }}
|
||||
|
||||
- name: Run reporter
|
||||
if: always() && steps.tests.outcome == 'failure'
|
||||
run: .\bld.bat reporter --all
|
||||
|
|
|
|||
8
.github/workflows/pages.yml
vendored
8
.github/workflows/pages.yml
vendored
|
|
@ -37,7 +37,7 @@ jobs:
|
|||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'corretto'
|
||||
java-version: 17
|
||||
|
|
@ -46,14 +46,14 @@ jobs:
|
|||
run: ./bld clean download clean compile javadoc
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v3
|
||||
uses: actions/configure-pages@v5
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v2
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
# Upload generated Javadocs repository
|
||||
path: 'build/javadoc/'
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v2
|
||||
uses: actions/deploy-pages@v4
|
||||
|
|
@ -2,12 +2,12 @@
|
|||
<library name="bld">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/lib/bld" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-2.3.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$PROJECT_DIR$/lib/bld" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-2.2.1-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-2.3.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
<excluded>
|
||||
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />
|
||||
|
|
|
|||
20
CONTRIBUTING.md
Normal file
20
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Contributing
|
||||
|
||||
If you want to contribute to `bld` or customize it, all you have to do is clone the GitHub
|
||||
repository and update the [RIFE2/core](https://github.com/rife2/rife2-core) submodule:
|
||||
|
||||
```console
|
||||
git clone git@github.com:rife2/bld.git
|
||||
cd bld
|
||||
git submodule init
|
||||
git submodule update
|
||||
```
|
||||
|
||||
Then use `bld` to build itself:
|
||||
|
||||
```console
|
||||
./bld compile
|
||||
```
|
||||
|
||||
The project has an IntelliJ IDEA project structure. You can just open it after all
|
||||
the dependencies were downloaded and peruse the code.
|
||||
28
README.md
28
README.md
|
|
@ -1,9 +1,9 @@
|
|||
[](https://opensource.org/licenses/Apache-2.0)
|
||||
[](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
|
||||
[](https://rife2.com/bld)
|
||||
[](https://rife2.com/bld)
|
||||
[](https://github.com/rife2/bld/releases/latest)
|
||||
[](https://maven-badges.herokuapp.com/maven-central/com.uwyn.rife2/bld)
|
||||
[](https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/bld/)
|
||||
[](https://central.sonatype.com/artifact/com.uwyn.rife2/bld)
|
||||
[](https://github.com/rife2/bld/packages/2214741/versions)
|
||||
[](https://github.com/rife2/bld/actions/workflows/bld.yml)
|
||||
[](https://github.com/rife2/rife2/actions/workflows/bld.yml)
|
||||
|
||||
|
|
@ -131,23 +131,7 @@ to post on the [forums](https://forum.uwyn.com) or to join us on [Discord](http
|
|||
|
||||
Read more in the [full documentation](https://github.com/rife2/bld/wiki) and [bld Javadocs](https://rife2.github.io/bld/).
|
||||
|
||||
# Building `bld`
|
||||
# Contributing
|
||||
|
||||
If you want to contribute to `bld` or customize it, all you have to do is clone the GitHub
|
||||
repository and update the [RIFE2/core](https://github.com/rife2/rife2-core) submodule:
|
||||
|
||||
```console
|
||||
git clone git@github.com:rife2/bld.git
|
||||
cd bld
|
||||
git submodule init
|
||||
git submodule update
|
||||
```
|
||||
|
||||
Then use `bld` to build itself:
|
||||
|
||||
```console
|
||||
./bld compile
|
||||
```
|
||||
|
||||
The project has an IntelliJ IDEA project structure. You can just open it after all
|
||||
the dependencies were downloaded and peruse the code.
|
||||
See [CONTIBUTING.md](https://github.com/rife2/bld?tab=contributing-ov-file#readme) for information about
|
||||
contributing to this project.
|
||||
|
|
|
|||
2
core
2
core
|
|
@ -1 +1 @@
|
|||
Subproject commit f8bde83ca806403dd8f37294239ac77dba8ad010
|
||||
Subproject commit fa567721c00d99626ed439db4f0340eadff0ec03
|
||||
Binary file not shown.
|
|
@ -1,11 +1,12 @@
|
|||
bld.downloadExtensionJavadoc=false
|
||||
bld.downloadExtensionSources=true
|
||||
bld.downloadLocation=
|
||||
bld.extension-antlr=com.uwyn.rife2:bld-antlr4:1.4.2
|
||||
bld.extension-archive=com.uwyn.rife2:bld-archive:0.6.2
|
||||
bld.extension-tests=com.uwyn.rife2:bld-tests-badge:1.6.2
|
||||
bld.extension-antlr=com.uwyn.rife2:bld-antlr4:1.4.3
|
||||
bld.extension-archive=com.uwyn.rife2:bld-archive:0.6.3
|
||||
bld.extension-reporter=com.uwyn.rife2:bld-junit-reporter:0.9.2
|
||||
bld.extension-tests=com.uwyn.rife2:bld-tests-badge:1.6.3
|
||||
bld.javaOptions=
|
||||
bld.javacOptions=
|
||||
bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES
|
||||
bld.sourceDirectories=core/src/bld/java
|
||||
bld.version=2.2.1
|
||||
bld.version=2.3.0
|
||||
|
|
@ -7,6 +7,7 @@ package rife;
|
|||
import rife.bld.BuildCommand;
|
||||
import rife.bld.Cli;
|
||||
import rife.bld.dependencies.VersionNumber;
|
||||
import rife.bld.extension.JUnitReporterOperation;
|
||||
import rife.bld.extension.ZipOperation;
|
||||
import rife.bld.operations.*;
|
||||
import rife.bld.publish.*;
|
||||
|
|
@ -33,7 +34,7 @@ public class BldBuild extends AbstractRife2Build {
|
|||
|
||||
repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
|
||||
scope(test)
|
||||
.include(dependency("org.json", "json", version(20250107)));
|
||||
.include(dependency("org.json", "json", version(20250517)));
|
||||
|
||||
var core_dir = new File(workDirectory(), "core");
|
||||
var core_src_dir = new File(core_dir, "src");
|
||||
|
|
@ -86,7 +87,7 @@ public class BldBuild extends AbstractRife2Build {
|
|||
|
||||
publishOperation()
|
||||
.repository(version.isSnapshot() ? repository("rife2-snapshots") : repository("rife2-releases"))
|
||||
.repository(version.isSnapshot() ? repository("sonatype-snapshots") : repository("sonatype-releases"))
|
||||
.repository(version.isSnapshot() ? repository("central-snapshots") : repository("central-releases"))
|
||||
.repository(repository("github"))
|
||||
.info(new PublishInfo()
|
||||
.groupId("com.uwyn.rife2")
|
||||
|
|
@ -161,6 +162,14 @@ public class BldBuild extends AbstractRife2Build {
|
|||
zipBld();
|
||||
}
|
||||
|
||||
@BuildCommand(summary = "Runs the JUnit reporter")
|
||||
public void reporter() throws Exception {
|
||||
new JUnitReporterOperation()
|
||||
.fromProject(this)
|
||||
.failOnSummary(true)
|
||||
.execute();
|
||||
}
|
||||
|
||||
public void publish()
|
||||
throws Exception {
|
||||
all();
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ public record Repository(String location, String username, String password) {
|
|||
public static final Repository SONATYPE_RELEASES_LEGACY = new Repository("https://oss.sonatype.org/service/local/staging/deploy/maven2/");
|
||||
public static final Repository SONATYPE_SNAPSHOTS = new Repository("https://s01.oss.sonatype.org/content/repositories/snapshots/");
|
||||
public static final Repository SONATYPE_SNAPSHOTS_LEGACY = new Repository("https://oss.sonatype.org/content/repositories/snapshots/");
|
||||
public static final String OSSRH_STAGING_API_DOMAIN = "ossrh-staging-api.central.sonatype.com";
|
||||
public static final Repository CENTRAL_RELEASES = new Repository("https://" + OSSRH_STAGING_API_DOMAIN + "/service/local/staging/deploy/maven2/");
|
||||
public static final Repository CENTRAL_SNAPSHOTS = new Repository("https://central.sonatype.com/repository/maven-snapshots/");
|
||||
public static final Repository RIFE2_RELEASES = new Repository("https://repo.rife2.com/releases/");
|
||||
public static final Repository RIFE2_SNAPSHOTS = new Repository("https://repo.rife2.com/snapshots/");
|
||||
|
||||
|
|
@ -98,6 +101,8 @@ public record Repository(String location, String username, String password) {
|
|||
case "SONATYPE_RELEASES_LEGACY" -> Repository.SONATYPE_RELEASES_LEGACY;
|
||||
case "SONATYPE_SNAPSHOTS" -> Repository.SONATYPE_SNAPSHOTS;
|
||||
case "SONATYPE_SNAPSHOTS_LEGACY" -> Repository.SONATYPE_SNAPSHOTS_LEGACY;
|
||||
case "CENTRAL_RELEASES" -> Repository.CENTRAL_RELEASES;
|
||||
case "CENTRAL_SNAPSHOTS" -> Repository.CENTRAL_SNAPSHOTS;
|
||||
default -> new Repository(locationOrName);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,7 @@ import rife.bld.operations.exceptions.OperationOptionException;
|
|||
import rife.tools.exceptions.FileUtilsErrorException;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
|
|
@ -233,6 +230,18 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
|
|||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides classpath entries to use for the operation.
|
||||
*
|
||||
* @param classpath classpath entries for the operation
|
||||
* @return this operation instance
|
||||
* @since 2.3.1
|
||||
*
|
||||
*/
|
||||
public T classpath(File... classpath) {
|
||||
return classpath(List.of(classpath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a list of classpath entries to use for the operation.
|
||||
* <p>
|
||||
|
|
@ -247,6 +256,20 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
|
|||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a list of classpath entries to use for the operation.
|
||||
* <p>
|
||||
* A copy will be created to allow this list to be independently modifiable.
|
||||
*
|
||||
* @param classpath a list of classpath entries for the operation
|
||||
* @return this operation instance
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public T classpath(Collection<File> classpath) {
|
||||
classpath_.addAll(classpath.stream().map(File::getAbsolutePath).toList());
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides module path entries to use for the operation.
|
||||
*
|
||||
|
|
@ -259,6 +282,17 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
|
|||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides module path entries to use for the operation.
|
||||
*
|
||||
* @param modulePath module path entries for the operation
|
||||
* @return this operation instance
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public T modulePath(File... modulePath) {
|
||||
return modulePath(List.of(modulePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a list of module path entries to use for the operation.
|
||||
* <p>
|
||||
|
|
@ -273,6 +307,20 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
|
|||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a list of module path entries to use for the operation.
|
||||
* <p>
|
||||
* A copy will be created to allow this list to be independently modifiable.
|
||||
*
|
||||
* @param modulePath a list of module path entries for the operation
|
||||
* @return this operation instance
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public T modulePath(Collection<File> modulePath) {
|
||||
modulePath_.addAll(modulePath.stream().map(File::getAbsolutePath).toList());
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the main class to launch with the java tool.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -87,12 +87,19 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
|
|||
for (var directory : mainSourceDirectories()) {
|
||||
sources.addAll(FileUtils.getJavaFileList(directory));
|
||||
}
|
||||
|
||||
if (sources.isEmpty()) {
|
||||
if (!silent()) {
|
||||
System.err.println("No main source files found.");
|
||||
}
|
||||
} else {
|
||||
executeBuildSources(
|
||||
compileMainClasspath(),
|
||||
compileMainModulePath(),
|
||||
sources,
|
||||
buildMainDirectory());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Part of the {@link #execute} operation, builds the test sources.
|
||||
|
|
@ -105,12 +112,19 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
|
|||
for (var directory : testSourceDirectories()) {
|
||||
sources.addAll(FileUtils.getJavaFileList(directory));
|
||||
}
|
||||
|
||||
if (sources.isEmpty()) {
|
||||
if (!silent()) {
|
||||
System.err.println("No test source files found.");
|
||||
}
|
||||
} else {
|
||||
executeBuildSources(
|
||||
compileTestClasspath(),
|
||||
compileTestModulePath(),
|
||||
sources,
|
||||
buildTestDirectory());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Part of the {@link #execute} operation, build sources to a destination.
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
/*
|
||||
* Copyright 2001-2023 Geert Bevin (gbevin[remove] at uwyn dot com)
|
||||
* Copyright 2001-2026 Geert Bevin (gbevin[remove] at uwyn dot com)
|
||||
* Licensed under the Apache License, Version 2.0 (the "License")
|
||||
*/
|
||||
package rife.bld.operations;
|
||||
|
||||
import rife.tools.Convert;
|
||||
import rife.tools.FileUtils;
|
||||
import rife.tools.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static rife.bld.operations.CompileOperation.COMPILE_OPTION_MODULE_PATH;
|
||||
|
||||
|
|
@ -22,6 +22,7 @@ import static rife.bld.operations.CompileOperation.COMPILE_OPTION_MODULE_PATH;
|
|||
* @author Geert Bevin (gbevin[remove] at uwyn dot com)
|
||||
* @since 1.5.18
|
||||
*/
|
||||
@SuppressWarnings("UnusedReturnValue")
|
||||
public class JavacOptions extends ArrayList<String> {
|
||||
public enum DebuggingInfo {
|
||||
ALL, NONE, LINES, VAR, SOURCE
|
||||
|
|
@ -35,6 +36,89 @@ public class JavacOptions extends ArrayList<String> {
|
|||
FULL, NONE, ONLY
|
||||
}
|
||||
|
||||
public enum XLintKey {
|
||||
ALL,
|
||||
AUXILIARYCLASS,
|
||||
CAST,
|
||||
CLASSFILE,
|
||||
DANGLING_DOC_COMMENTS,
|
||||
DEP_ANN,
|
||||
DEPRECATION,
|
||||
DIVZERO,
|
||||
EMPTY,
|
||||
EXPORTS,
|
||||
FALLTHROUGH,
|
||||
FINALLY,
|
||||
IDENTITY,
|
||||
INCUBATING,
|
||||
LOSSY_CONVERSIONS,
|
||||
MISSING_EXPLICIT_CTOR,
|
||||
MODULE,
|
||||
NONE,
|
||||
OPENS,
|
||||
OPTIONS,
|
||||
OUTPUT_FILE_CLASH,
|
||||
OVERLOADS,
|
||||
OVERRIDES,
|
||||
PATH,
|
||||
PREVIEW,
|
||||
PROCESSING,
|
||||
RAWTYPES,
|
||||
REMOVAL,
|
||||
REQUIRES_AUTOMATIC,
|
||||
REQUIRES_TRANSITIVE_AUTOMATIC,
|
||||
RESTRICTED,
|
||||
SERIAL,
|
||||
STATIC,
|
||||
STRICTFP,
|
||||
SYNCHRONIZATION,
|
||||
TEXT_BLOCKS,
|
||||
THIS_ESCAPE,
|
||||
TRY,
|
||||
UNCHECKED,
|
||||
VARARGS
|
||||
}
|
||||
|
||||
// Helper method to check if an array is not empty
|
||||
private static <T> boolean isNotEmpty(T[] array) {
|
||||
return array != null && array.length > 0;
|
||||
}
|
||||
|
||||
// Helper method to check if a collection is not empty
|
||||
private static boolean isNotEmpty(Collection<?> collection) {
|
||||
return collection != null && !collection.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to add delimited options
|
||||
*/
|
||||
private JavacOptions addDelimitedOption(String option, Collection<String> values, String separator) {
|
||||
if (isNotEmpty(values)) {
|
||||
var joined = values.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.joining(separator));
|
||||
if (!joined.isEmpty()) {
|
||||
add(option);
|
||||
add(joined);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to add path-based options
|
||||
*/
|
||||
private JavacOptions addPathOption(String option, Collection<String> paths) {
|
||||
return addDelimitedOption(option, paths, File.pathSeparator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to add comma-separated options
|
||||
*/
|
||||
private JavacOptions addCommaSeparatedOption(String option, Collection<String> values) {
|
||||
return addDelimitedOption(option, values, ",");
|
||||
}
|
||||
|
||||
/**
|
||||
* Option to pass to annotation processors
|
||||
*
|
||||
|
|
@ -46,30 +130,79 @@ public class JavacOptions extends ArrayList<String> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies a package to be considered as exported from its defining
|
||||
* module to additional modules or to all unnamed modules when the value
|
||||
* of other-module is ALL-UNNAMED
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions addExports(String... modules) {
|
||||
if (isNotEmpty(modules)) {
|
||||
addExports(Arrays.asList(modules));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies a package to be considered as exported from its defining
|
||||
* module to additional modules or to all unnamed modules when the value
|
||||
* of other-module is ALL-UNNAMED
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions addExports(Collection<String> modules) {
|
||||
return addCommaSeparatedOption("--add-exports", modules);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies additional modules to be considered as required by a given module
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions addReads(String... modules) {
|
||||
if (isNotEmpty(modules)) {
|
||||
addReads(Arrays.asList(modules));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies additional modules to be considered as required by a given module
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions addReads(Collection<String> modules) {
|
||||
return addCommaSeparatedOption("--add-reads", modules);
|
||||
}
|
||||
|
||||
/**
|
||||
* Root modules to resolve in addition to the initial modules,
|
||||
* or all modules on the module path if a module is
|
||||
* ALL-MODULE-PATH.
|
||||
* or all modules on the module path if a module is ALL-MODULE-PATH
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions addModules(String... modules) {
|
||||
return addModules(Arrays.asList(modules));
|
||||
if (isNotEmpty(modules)) {
|
||||
addModules(Arrays.asList(modules));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Root modules to resolve in addition to the initial modules,
|
||||
* or all modules on the module path if a module is
|
||||
* ALL-MODULE-PATH.
|
||||
* or all modules on the module path if a module is ALL-MODULE-PATH
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions addModules(List<String> modules) {
|
||||
add("--add-modules");
|
||||
add(StringUtils.join(modules, ","));
|
||||
return this;
|
||||
public JavacOptions addModules(Collection<String> modules) {
|
||||
return addCommaSeparatedOption("--add-modules", modules);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -84,6 +217,19 @@ public class JavacOptions extends ArrayList<String> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fallback target module for files created by annotation processors,
|
||||
* if none specified or inferred
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions defaultModuleForCreatedFiles(String module) {
|
||||
add("--default-module-for-created-files");
|
||||
add(module);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output source locations where deprecated APIs are used
|
||||
*
|
||||
|
|
@ -96,7 +242,7 @@ public class JavacOptions extends ArrayList<String> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Enable preview language features. To be used in conjunction with {@link #release}.
|
||||
* Enable preview language features. To be used in conjunction with {@link #release}
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
|
|
@ -113,7 +259,10 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions endorsedDirs(File... dirs) {
|
||||
return endorsedDirs(Arrays.asList(dirs));
|
||||
if (isNotEmpty(dirs)) {
|
||||
endorsedDirs(Arrays.asList(dirs));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -122,9 +271,12 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions endorsedDirs(List<File> dirs) {
|
||||
public JavacOptions endorsedDirs(Collection<File> dirs) {
|
||||
if (isNotEmpty(dirs)) {
|
||||
return endorsedDirsStrings(dirs.stream().map(File::getAbsolutePath).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override location of endorsed standards path
|
||||
|
|
@ -133,7 +285,10 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions endorsedDirs(Path... dirs) {
|
||||
return endorsedDirsPaths(Arrays.asList(dirs));
|
||||
if (isNotEmpty(dirs)) {
|
||||
endorsedDirsPaths(Arrays.asList(dirs));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -142,9 +297,12 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions endorsedDirsPaths(List<Path> dirs) {
|
||||
public JavacOptions endorsedDirsPaths(Collection<Path> dirs) {
|
||||
if (isNotEmpty(dirs)) {
|
||||
return endorsedDirs(dirs.stream().map(Path::toFile).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override location of endorsed standards path
|
||||
|
|
@ -153,7 +311,10 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions endorsedDirs(String... dirs) {
|
||||
return endorsedDirsStrings(Arrays.asList(dirs));
|
||||
if (isNotEmpty(dirs)) {
|
||||
endorsedDirsStrings(Arrays.asList(dirs));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -162,10 +323,8 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions endorsedDirsStrings(List<String> dirs) {
|
||||
add("-endorseddirs");
|
||||
add(String.join(",", dirs));
|
||||
return this;
|
||||
public JavacOptions endorsedDirsStrings(Collection<String> dirs) {
|
||||
return addCommaSeparatedOption("-endorseddirs", dirs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -175,7 +334,10 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions extDirs(File... dirs) {
|
||||
return extDirs(Arrays.asList(dirs));
|
||||
if (isNotEmpty(dirs)) {
|
||||
extDirs(Arrays.asList(dirs));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -184,9 +346,12 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions extDirs(List<File> dirs) {
|
||||
public JavacOptions extDirs(Collection<File> dirs) {
|
||||
if (isNotEmpty(dirs)) {
|
||||
return extDirsStrings(dirs.stream().map(File::getAbsolutePath).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override location of installed extensions
|
||||
|
|
@ -195,7 +360,10 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions extDirs(Path... dirs) {
|
||||
return extDirsPaths(Arrays.asList(dirs));
|
||||
if (isNotEmpty(dirs)) {
|
||||
extDirsPaths(Arrays.asList(dirs));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -204,9 +372,12 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions extDirsPaths(List<Path> dirs) {
|
||||
public JavacOptions extDirsPaths(Collection<Path> dirs) {
|
||||
if (isNotEmpty(dirs)) {
|
||||
return extDirs(dirs.stream().map(Path::toFile).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override location of installed extensions
|
||||
|
|
@ -215,7 +386,10 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions extDirs(String... dirs) {
|
||||
return extDirsStrings(Arrays.asList(dirs));
|
||||
if (isNotEmpty(dirs)) {
|
||||
extDirsStrings(Arrays.asList(dirs));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -224,25 +398,35 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions extDirsStrings(List<String> dirs) {
|
||||
add("-extdirs");
|
||||
add(String.join(",", dirs));
|
||||
return this;
|
||||
public JavacOptions extDirsStrings(Collection<String> dirs) {
|
||||
return addCommaSeparatedOption("-extdirs", dirs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the Java SE release was set.
|
||||
* Indicates whether the Java SE release was set
|
||||
*
|
||||
* @return {@code true} if the release was set; or
|
||||
* {@code false} otherwise
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public boolean containsRelease() {
|
||||
return contains("-release");
|
||||
return contains("--release");
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile for the specified Java SE release.
|
||||
* Overrides or augments a module with classes and resources in JAR files or directories
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions patchModule(String module) {
|
||||
add("--patch-module");
|
||||
add(module);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile for the specified Java SE release
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
|
|
@ -253,6 +437,30 @@ public class JavacOptions extends ArrayList<String> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide source compatibility with the specified Java SE release
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions source(int version) {
|
||||
add("--source");
|
||||
add(Convert.toString(version));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate class files suitable for the specified Java SE release
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions target(int version) {
|
||||
add("--target");
|
||||
add(Convert.toString(version));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate debugging info
|
||||
*
|
||||
|
|
@ -318,7 +526,10 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions limitModules(String... modules) {
|
||||
return limitModules(Arrays.asList(modules));
|
||||
if (isNotEmpty(modules)) {
|
||||
limitModules(Arrays.asList(modules));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -327,10 +538,8 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions limitModules(List<String> modules) {
|
||||
add("--limit-modules");
|
||||
add(StringUtils.join(modules, ","));
|
||||
return this;
|
||||
public JavacOptions limitModules(Collection<String> modules) {
|
||||
return addCommaSeparatedOption("--limit-modules", modules);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -340,7 +549,10 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions module(String... modules) {
|
||||
return module(Arrays.asList(modules));
|
||||
if (isNotEmpty(modules)) {
|
||||
module(Arrays.asList(modules));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -349,20 +561,22 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions module(List<String> modules) {
|
||||
add("--module");
|
||||
add(StringUtils.join(modules, ","));
|
||||
return this;
|
||||
public JavacOptions module(Collection<String> modules) {
|
||||
return addCommaSeparatedOption("--module", modules);
|
||||
}
|
||||
|
||||
/**
|
||||
* /**
|
||||
* Specify where to find application modules
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions modulePath(File... paths) {
|
||||
return modulePath(Arrays.asList(paths));
|
||||
if (isNotEmpty(paths)) {
|
||||
modulePath(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -371,9 +585,12 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 1.6.2
|
||||
*/
|
||||
public JavacOptions modulePath(List<File> paths) {
|
||||
public JavacOptions modulePath(Collection<File> paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
return modulePathStrings(paths.stream().map(File::getAbsolutePath).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify where to find application modules
|
||||
|
|
@ -382,7 +599,10 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions modulePath(Path... paths) {
|
||||
return modulePathPaths(Arrays.asList(paths));
|
||||
if (isNotEmpty(paths)) {
|
||||
modulePathPaths(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -391,8 +611,11 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions modulePathPaths(List<Path> paths) {
|
||||
return modulePath(paths.stream().map(Path::toFile).toList());
|
||||
public JavacOptions modulePathPaths(Collection<Path> paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
return modulePathStrings(paths.stream().map(Path::toString).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -402,7 +625,10 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions modulePath(String... paths) {
|
||||
return modulePathStrings(Arrays.asList(paths));
|
||||
if (isNotEmpty(paths)) {
|
||||
modulePathStrings(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -411,9 +637,43 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions modulePathStrings(List<String> paths) {
|
||||
add(COMPILE_OPTION_MODULE_PATH);
|
||||
add(FileUtils.joinPaths(paths));
|
||||
public JavacOptions modulePathStrings(Collection<String> paths) {
|
||||
return addPathOption(COMPILE_OPTION_MODULE_PATH, paths);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify where to find input source files for multiple modules
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions moduleSourcePathStrings(Collection<String> paths) {
|
||||
return addPathOption("--module-source-path", paths);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify where to find input source files for multiple modules
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions moduleSourcePathPaths(Collection<Path> paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
return moduleSourcePathStrings(paths.stream().map(Path::toString).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify where to find input source files for multiple modules
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions moduleSourcePath(Collection<File> paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
return moduleSourcePathStrings(paths.stream().map(File::getPath).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -423,8 +683,11 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions moduleSourcePath(File path) {
|
||||
return moduleSourcePath(path.getAbsolutePath());
|
||||
public JavacOptions moduleSourcePath(File... paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
moduleSourcePath(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -433,8 +696,11 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions moduleSourcePath(Path path) {
|
||||
return moduleSourcePath(path.toFile());
|
||||
public JavacOptions moduleSourcePath(String... paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
moduleSourcePathStrings(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -443,9 +709,10 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions moduleSourcePath(String path) {
|
||||
add("--module-source-path");
|
||||
add(path);
|
||||
public JavacOptions moduleSourcePath(Path... paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
moduleSourcePathPaths(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -484,7 +751,7 @@ public class JavacOptions extends ArrayList<String> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Control whether annotation processing and/or compilation is done.
|
||||
* Control whether annotation processing and/or compilation is done
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
|
|
@ -501,7 +768,10 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions processors(String... classnames) {
|
||||
return processors(Arrays.asList(classnames));
|
||||
if (isNotEmpty(classnames)) {
|
||||
processors(Arrays.asList(classnames));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -510,10 +780,8 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions processors(List<String> classnames) {
|
||||
add("-processor");
|
||||
add(StringUtils.join(classnames, ","));
|
||||
return this;
|
||||
public JavacOptions processors(Collection<String> classnames) {
|
||||
return addCommaSeparatedOption("-processor", classnames);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -522,8 +790,11 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions processorModulePath(File path) {
|
||||
return processorModulePath(path.getAbsolutePath());
|
||||
public JavacOptions processorModulePath(File... paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
processorModulePath(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -532,8 +803,11 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions processorModulePath(Path path) {
|
||||
return processorModulePath(path.toFile());
|
||||
public JavacOptions processorModulePath(Path... paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
processorModulePathPaths(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -542,9 +816,46 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions processorModulePath(String path) {
|
||||
add("--processor-module-path");
|
||||
add(path);
|
||||
public JavacOptions processorModulePath(String... paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
processorModulePathStrings(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify a module path where to find annotation processors
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions processorModulePathPaths(Collection<Path> paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
return processorModulePathStrings(paths.stream().map(Path::toString).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify a module path where to find annotation processors
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions processorModulePathStrings(Collection<String> paths) {
|
||||
return addPathOption("--processor-module-path", paths);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify a module path where to find annotation processors
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions processorModulePath(Collection<File> paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
return processorModulePathStrings(paths.stream().map(File::getAbsolutePath).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -554,34 +865,77 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions processorPath(File path) {
|
||||
return processorPath(path.getAbsolutePath());
|
||||
public JavacOptions processorPath(String... paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
processorPathStrings(Arrays.asList(paths));
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify where to find annotation processors
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions processorPath(Path path) {
|
||||
return processorPath(path.toFile());
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify where to find annotation processors
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions processorPath(String path) {
|
||||
add("--processor-path");
|
||||
add(path);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that API used is available in the specified profile
|
||||
* Specify where to find annotation processors
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions processorPath(File... paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
processorPath(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify where to find annotation processors
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions processorPath(Path... paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
processorPathPaths(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify where to find annotation processors
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions processorPathStrings(Collection<String> paths) {
|
||||
return addPathOption("--processor-path", paths);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify where to find annotation processors
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions processorPath(Collection<File> paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
return processorPathStrings(paths.stream().map(File::getAbsolutePath).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify where to find annotation processors
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions processorPathPaths(Collection<Path> paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
return processorPathStrings(paths.stream().map(Path::toString).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the API used is available in the specified profile
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
|
|
@ -645,8 +999,11 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 1.5.18
|
||||
*/
|
||||
public JavacOptions upgradeModulePath(File path) {
|
||||
return upgradeModulePath(path.getAbsolutePath());
|
||||
public JavacOptions upgradeModulePath(File... paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
upgradeModulePath(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -655,8 +1012,11 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions upgradeModulePath(Path path) {
|
||||
return upgradeModulePath(path.toFile());
|
||||
public JavacOptions upgradeModulePath(Path... paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
upgradeModulePathPaths(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -665,9 +1025,46 @@ public class JavacOptions extends ArrayList<String> {
|
|||
* @return this list of options
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavacOptions upgradeModulePath(String path) {
|
||||
add("--upgrade-module-path");
|
||||
add(path);
|
||||
public JavacOptions upgradeModulePath(String... paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
upgradeModulePathStrings(Arrays.asList(paths));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override location of upgradeable modules
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions upgradeModulePathStrings(Collection<String> paths) {
|
||||
return addPathOption("--upgrade-module-path", paths);
|
||||
}
|
||||
|
||||
/**
|
||||
* Override location of upgradeable modules
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions upgradeModulePath(Collection<File> paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
return upgradeModulePathStrings(paths.stream().map(File::getAbsolutePath).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override location of upgradeable modules
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions upgradeModulePathPaths(Collection<Path> paths) {
|
||||
if (isNotEmpty(paths)) {
|
||||
return upgradeModulePathStrings(paths.stream().map(Path::toString).toList());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -681,4 +1078,78 @@ public class JavacOptions extends ArrayList<String> {
|
|||
add("-Werror");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable recommended warning categories
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions xLint() {
|
||||
add("-Xlint");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning categories to enable
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions xLint(XLintKey... keys) {
|
||||
if (isNotEmpty(keys)) {
|
||||
xLint(Arrays.asList(keys));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning categories to enable
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions xLint(Collection<XLintKey> keys) {
|
||||
if (isNotEmpty(keys)) {
|
||||
return addXLintOption(keys, "");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning categories to disable
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions xLintDisable(XLintKey... keys) {
|
||||
if (isNotEmpty(keys)) {
|
||||
xLintDisable(Arrays.asList(keys));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning categories to disable
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions xLintDisable(Collection<XLintKey> keys) {
|
||||
if (isNotEmpty(keys)) {
|
||||
return addXLintOption(keys, "-");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private JavacOptions addXLintOption(Collection<XLintKey> keys, String prefix) {
|
||||
if (isNotEmpty(keys)) {
|
||||
var keyString = keys.stream()
|
||||
.map(key -> key.name().replace('_', '-').toLowerCase())
|
||||
.collect(Collectors.joining("," + prefix, prefix, ""));
|
||||
|
||||
add("-Xlint:" + keyString);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ import rife.bld.BldVersion;
|
|||
import rife.bld.dependencies.*;
|
||||
import rife.bld.dependencies.exceptions.DependencyException;
|
||||
import rife.bld.operations.exceptions.OperationOptionException;
|
||||
import rife.bld.operations.exceptions.RestApiException;
|
||||
import rife.bld.operations.exceptions.SignException;
|
||||
import rife.bld.operations.exceptions.UploadException;
|
||||
import rife.bld.publish.*;
|
||||
|
|
@ -27,6 +28,7 @@ import java.time.ZoneId;
|
|||
import java.time.ZonedDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static rife.bld.dependencies.Dependency.*;
|
||||
import static rife.bld.publish.MetadataBuilder.SNAPSHOT_TIMESTAMP_FORMATTER;
|
||||
|
|
@ -40,6 +42,9 @@ import static rife.tools.StringUtils.encodeHexLower;
|
|||
* @since 1.5.7
|
||||
*/
|
||||
public class PublishOperation extends AbstractOperation<PublishOperation> {
|
||||
private static final String OSSRH_STAGING_MANUAL_SEARCH = "https://" + Repository.OSSRH_STAGING_API_DOMAIN + "/manual/search/repositories";
|
||||
private static final String OSSRH_STAGING_MANUAL_UPLOAD = "https://" + Repository.OSSRH_STAGING_API_DOMAIN + "/manual/upload/repository/";
|
||||
|
||||
private boolean offline_ = false;
|
||||
private HierarchicalProperties properties_ = null;
|
||||
private ArtifactRetriever retriever_ = null;
|
||||
|
|
@ -87,6 +92,11 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
|||
executePublishArtifacts(repository, actual_version);
|
||||
executePublishPom(repository, actual_version);
|
||||
executePublishMetadata(repository, moment);
|
||||
|
||||
if (!info().version().isSnapshot() &&
|
||||
repository.location().contains(Repository.OSSRH_STAGING_API_DOMAIN)) {
|
||||
executeCloseOSSRHStagingRepository(repository);
|
||||
}
|
||||
}
|
||||
if (!silent()) {
|
||||
System.out.println("Publishing finished successfully.");
|
||||
|
|
@ -133,14 +143,18 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
|||
var resolution = new VersionResolution(properties());
|
||||
var resolver = new DependencyResolver(resolution, artifactRetriever(), List.of(repository), new Dependency(info().groupId(), info().artifactId(), info().version()));
|
||||
var snapshot_meta = resolver.getSnapshotMavenMetadata();
|
||||
snapshot_build_number = snapshot_meta.getSnapshotBuildNumber() + 1;
|
||||
var build_number_meta = snapshot_meta.getSnapshotBuildNumber();
|
||||
if (build_number_meta == null) {
|
||||
throw new DependencyException("Snapshot metadata build number doesn't exist.");
|
||||
}
|
||||
snapshot_build_number = build_number_meta + 1;
|
||||
} catch (DependencyException e) {
|
||||
// start the build number from the beginning
|
||||
System.out.println("Unable to retrieve previous snapshot metadata, using first build number.");
|
||||
System.out.println("This is expected for a first publication or for publication to a staging repository.");
|
||||
}
|
||||
|
||||
// adapt the actual version that's use by the artifacts
|
||||
// adapt the actual version used by the artifacts
|
||||
var snapshot_qualifier = snapshot_timestamp + "-" + snapshot_build_number;
|
||||
actual_version = info().version().withQualifier(snapshot_qualifier);
|
||||
|
||||
|
|
@ -161,7 +175,7 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
|||
.info(info())
|
||||
.updated(moment)
|
||||
.build(),
|
||||
info().version() + "/" + repository.getMetadataName(), true);
|
||||
info().version() + "/" + repository.getMetadataName(), false);
|
||||
return actual_version;
|
||||
}
|
||||
|
||||
|
|
@ -181,7 +195,7 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
|||
artifact_name.append('-').append(artifact.classifier());
|
||||
}
|
||||
var type = artifact.type();
|
||||
if (type == null || TYPE_JAR.equals(type) || TYPE_MODULAR_JAR.equals(type) || TYPE_CLASSPATH_JAR.equals(type)) {
|
||||
if (TYPE_JAR.equals(type) || TYPE_MODULAR_JAR.equals(type) || TYPE_CLASSPATH_JAR.equals(type)) {
|
||||
type = TYPE_JAR;
|
||||
}
|
||||
artifact_name.append('.').append(type);
|
||||
|
|
@ -470,12 +484,8 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
|||
var builder = HttpRequest.newBuilder()
|
||||
.PUT(body)
|
||||
.uri(URI.create(url))
|
||||
.header(HEADER_USER_AGENT, "bld/" + BldVersion.getVersion() +
|
||||
" (" + System.getProperty("os.name") + "; " + System.getProperty("os.version") + "; " + System.getProperty("os.arch") + ") " +
|
||||
"(" + System.getProperty("java.vendor") + " " + System.getProperty("java.vm.name") + "; " + System.getProperty("java.version") + "; " + System.getProperty("java.vm.version") + ")");
|
||||
if (repository.username() != null && repository.password() != null) {
|
||||
builder.header(HEADER_AUTHORIZATION, basicAuthorizationHeader(repository.username(), repository.password()));
|
||||
}
|
||||
.header(HEADER_USER_AGENT, constructBldUserAgent());
|
||||
applyAuthorization(repository, builder);
|
||||
var request = builder.build();
|
||||
|
||||
HttpResponse<String> response;
|
||||
|
|
@ -501,6 +511,105 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
|||
}
|
||||
}
|
||||
|
||||
private static String constructBldUserAgent() {
|
||||
return "bld/" + BldVersion.getVersion() +
|
||||
" (" + System.getProperty("os.name") + "; " + System.getProperty("os.version") + "; " + System.getProperty("os.arch") + ") " +
|
||||
"(" + System.getProperty("java.vendor") + " " + System.getProperty("java.vm.name") + "; " + System.getProperty("java.version") + "; " + System.getProperty("java.vm.version") + ")";
|
||||
}
|
||||
|
||||
private static void applyAuthorization(Repository repository, HttpRequest.Builder builder) {
|
||||
if (repository.username() != null && repository.password() != null) {
|
||||
builder.header(HEADER_AUTHORIZATION, basicAuthorizationHeader(repository.username(), repository.password()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Part of the {@link #execute} operation, closes the OSSRH staging API repository.
|
||||
*
|
||||
* @param repository the repository to close a staging repository in
|
||||
* @since 2.2.2
|
||||
*/
|
||||
protected void executeCloseOSSRHStagingRepository(Repository repository) {
|
||||
var url_search = OSSRH_STAGING_MANUAL_SEARCH;
|
||||
System.out.print("Finding open staging repositories at: " + url_search + " ... ");
|
||||
System.out.flush();
|
||||
try {
|
||||
var builder_search = HttpRequest.newBuilder()
|
||||
.GET()
|
||||
.uri(URI.create(url_search))
|
||||
.header(HEADER_USER_AGENT, constructBldUserAgent());
|
||||
applyAuthorization(repository, builder_search);
|
||||
var request_list = builder_search.build();
|
||||
|
||||
HttpResponse<String> response_search;
|
||||
try {
|
||||
response_search = client_.send(request_list, HttpResponse.BodyHandlers.ofString());
|
||||
} catch (IOException e) {
|
||||
System.out.print("I/O error");
|
||||
throw new RestApiException(url_search, e);
|
||||
} catch (InterruptedException e) {
|
||||
System.out.print("interrupted");
|
||||
throw new RestApiException(url_search, e);
|
||||
}
|
||||
|
||||
if (response_search.statusCode() >= 200 &&
|
||||
response_search.statusCode() < 300) {
|
||||
System.out.println("done");
|
||||
|
||||
var pattern_key = Pattern.compile("\\{\\s*\"key\"\\s*:\\s*\"([^\"]+)\"\\s*,\\s*\"state\"\\s*:\\s*\"open\"");
|
||||
var matcher_key = pattern_key.matcher(response_search.body());
|
||||
if (matcher_key.find()) {
|
||||
var key = matcher_key.group(1);
|
||||
System.out.println("Found open staging repository with key: " + key);
|
||||
|
||||
var url_close = OSSRH_STAGING_MANUAL_UPLOAD + key;
|
||||
System.out.print("Closing the staging repository at: " + url_close + " ... ");
|
||||
System.out.flush();
|
||||
var builder_close = HttpRequest.newBuilder()
|
||||
.POST(BodyPublishers.ofString(""))
|
||||
.uri(URI.create(url_close))
|
||||
.header(HEADER_USER_AGENT, constructBldUserAgent());
|
||||
applyAuthorization(repository, builder_close);
|
||||
var request_close = builder_close.build();
|
||||
|
||||
HttpResponse<String> response_close;
|
||||
try {
|
||||
response_close = client_.send(request_close, HttpResponse.BodyHandlers.ofString());
|
||||
} catch (IOException e) {
|
||||
System.out.print("I/O error");
|
||||
throw new RestApiException(url_close, e);
|
||||
} catch (InterruptedException e) {
|
||||
System.out.print("interrupted");
|
||||
throw new RestApiException(url_close, e);
|
||||
}
|
||||
|
||||
if (response_close.statusCode() >= 200 &&
|
||||
response_close.statusCode() < 300) {
|
||||
System.out.print("done");
|
||||
} else {
|
||||
System.out.println("failed");
|
||||
var pattern_error = Pattern.compile("\\s*\"error\"\\s*:\\s*\"([^\"]*)\"");
|
||||
var matcher_error = pattern_error.matcher(response_close.body());
|
||||
if (matcher_error.find()) {
|
||||
var error = matcher_error.group(1);
|
||||
System.out.print(error.translateEscapes());
|
||||
}
|
||||
throw new RestApiException(url_close, response_close.statusCode());
|
||||
}
|
||||
}
|
||||
else {
|
||||
System.out.print("No open staging repository found.");
|
||||
throw new RestApiException(url_search);
|
||||
}
|
||||
} else {
|
||||
System.out.print("failed");
|
||||
throw new RestApiException(url_search, response_search.statusCode());
|
||||
}
|
||||
} finally {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures a publish operation from a {@link BaseProject}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ public class RunOperation extends AbstractProcessOperation<RunOperation> {
|
|||
else if (mainClass() != null && !mainClass().isEmpty()){
|
||||
args.add(mainClass());
|
||||
}
|
||||
else if (!silent()) {
|
||||
System.err.println("No main class or module specified.");
|
||||
}
|
||||
|
||||
args.addAll(runOptions());
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright 2001-2023 Geert Bevin (gbevin[remove] at uwyn dot com)
|
||||
* Licensed under the Apache License, Version 2.0 (the "License")
|
||||
*/
|
||||
package rife.bld.operations.exceptions;
|
||||
|
||||
import rife.tools.HttpUtils;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* When thrown, indicates that something went wrong during the use of a rest API call.
|
||||
*
|
||||
* @author Geert Bevin (gbevin[remove] at uwyn dot com)
|
||||
* @since 2.2.2
|
||||
*/
|
||||
public class RestApiException extends RuntimeException {
|
||||
@Serial private static final long serialVersionUID = -6753423938407177328L;
|
||||
|
||||
private final String url_;
|
||||
|
||||
public RestApiException(String url, int status) {
|
||||
super("An error occurred while using rest API at '" + url + "'\nHTTP status code " + status + " : " + HttpUtils.statusReason(status));
|
||||
url_ = url;
|
||||
}
|
||||
|
||||
public RestApiException(String url, Throwable cause) {
|
||||
super("An error occurred while using rest API at '" + url + "'", cause);
|
||||
url_ = url;
|
||||
}
|
||||
|
||||
public RestApiException(String url) {
|
||||
super("An error occurred while using rest API at '" + url + "'");
|
||||
url_ = url;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url_;
|
||||
}
|
||||
}
|
||||
|
|
@ -45,9 +45,9 @@ public class Wrapper {
|
|||
public static final String WRAPPER_PROPERTIES = WRAPPER_PREFIX + ".properties";
|
||||
|
||||
static final String MAVEN_CENTRAL = "https://repo1.maven.org/maven2/";
|
||||
static final String SONATYPE_SNAPSHOTS = "https://s01.oss.sonatype.org/content/repositories/snapshots/";
|
||||
static final String CENTRAL_SNAPSHOTS = "https://central.sonatype.com/repository/maven-snapshots/";
|
||||
static final String DOWNLOAD_LOCATION = MAVEN_CENTRAL + "com/uwyn/rife2/bld/${version}/";
|
||||
static final String DOWNLOAD_LOCATION_SNAPSHOT = SONATYPE_SNAPSHOTS + "com/uwyn/rife2/bld/${version}/";
|
||||
static final String DOWNLOAD_LOCATION_SNAPSHOT = CENTRAL_SNAPSHOTS + "com/uwyn/rife2/bld/${version}/";
|
||||
static final String BLD_CACHE = "bld.cache";
|
||||
static final String BLD_FILENAME = "bld-${version}.jar";
|
||||
static final String BLD_SOURCES_FILENAME = "bld-${version}-sources.jar";
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
2.2.1
|
||||
2.3.1-SNAPSHOT
|
||||
|
|
@ -26,7 +26,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testInstantiation() {
|
||||
var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "com.uwyn.rife2:rife2:1.8.0")),
|
||||
ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0)));
|
||||
ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0)));
|
||||
assertNotNull(resolver);
|
||||
assertEquals(new VersionNumber(1,8,0), resolver.resolution().overrideVersion(new Dependency("com.uwyn.rife2", "rife2")));
|
||||
assertTrue(resolver.repositories().contains(MAVEN_CENTRAL));
|
||||
|
|
@ -36,38 +36,38 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testNotFound() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.org.unknown", "voidthing"));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.org.unknown", "voidthing"));
|
||||
assertFalse(resolver.exists());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCheckExistence() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
assertTrue(resolver.exists());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCheckExistenceVersion() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0)));
|
||||
assertTrue(resolver.exists());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCheckExistenceMissingVersion() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 3, 9)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 3, 9)));
|
||||
assertFalse(resolver.exists());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCheckVersionOverride() {
|
||||
var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "com.uwyn.rife2:rife2:1.8.0")),
|
||||
ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 3, 9)));
|
||||
ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 3, 9)));
|
||||
assertEquals(new VersionNumber(1, 8, 0), resolver.resolveVersion());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testListVersions() {
|
||||
var resolver1 = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var resolver1 = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var versions1 = resolver1.listVersions();
|
||||
assertNotNull(versions1);
|
||||
assertFalse(versions1.isEmpty());
|
||||
|
|
@ -75,7 +75,7 @@ public class TestDependencyResolver {
|
|||
assertTrue(versions1.contains(new VersionNumber(1, 0, 0)));
|
||||
assertTrue(versions1.contains(new VersionNumber(1, 2, 1)));
|
||||
|
||||
var resolver2 = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server"));
|
||||
var resolver2 = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server"));
|
||||
var versions2 = resolver2.listVersions();
|
||||
assertNotNull(versions2);
|
||||
assertFalse(versions2.isEmpty());
|
||||
|
|
@ -86,7 +86,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetLatestVersion() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var version = resolver.latestVersion();
|
||||
assertNotNull(version);
|
||||
assertTrue(version.compareTo(new VersionNumber(1, 4)) >= 0);
|
||||
|
|
@ -94,7 +94,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetReleaseVersion() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var version = resolver.releaseVersion();
|
||||
assertNotNull(version);
|
||||
assertTrue(version.compareTo(new VersionNumber(1, 4)) >= 0);
|
||||
|
|
@ -102,7 +102,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testMetadata() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0)));
|
||||
var metadata = resolver.getMavenMetadata();
|
||||
assertNotNull(metadata);
|
||||
assertTrue(metadata.getLatest().compareTo(resolver.dependency().version()) > 0);
|
||||
|
|
@ -111,16 +111,16 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testSnapshotMetadata() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT")));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
|
||||
var metadata = resolver.getSnapshotMavenMetadata();
|
||||
assertNotNull(metadata);
|
||||
assertEquals("20230307.195509", metadata.getSnapshotTimestamp());
|
||||
assertEquals(4, metadata.getSnapshotBuildNumber());
|
||||
assertEquals("20230408.014123", metadata.getSnapshotTimestamp());
|
||||
assertEquals(7, metadata.getSnapshotBuildNumber());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetCompileDependenciesRIFE2() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var dependencies = resolver.getDirectDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(0, dependencies.size());
|
||||
|
|
@ -128,7 +128,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileDependenciesRIFE2Snapshot() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT")));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
|
||||
var dependencies = resolver.getDirectDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(0, dependencies.size());
|
||||
|
|
@ -136,7 +136,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileDependenciesGoogleApi() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.google.apis", "google-api-services-youtube", new VersionGeneric("v3-rev20240514-2.0.0")));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.google.apis", "google-api-services-youtube", new VersionGeneric("v3-rev20240514-2.0.0")));
|
||||
var dependencies = resolver.getDirectDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(1, dependencies.size());
|
||||
|
|
@ -146,7 +146,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileDependenciesJetty() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var dependencies = resolver.getDirectDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(4, dependencies.size());
|
||||
|
|
@ -159,7 +159,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileDependenciesAssertJ() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.assertj", "assertj-joda-time", new VersionNumber(2, 2, 0)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.assertj", "assertj-joda-time", new VersionNumber(2, 2, 0)));
|
||||
var dependencies = resolver.getDirectDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(1, dependencies.size());
|
||||
|
|
@ -169,7 +169,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileDependenciesSwagger() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("io.swagger.core.v3", "swagger-core", new VersionNumber(2,2,27)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("io.swagger.core.v3", "swagger-core", new VersionNumber(2,2,27)));
|
||||
var dependencies = resolver.getDirectDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(11, dependencies.size());
|
||||
|
|
@ -190,7 +190,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testGetCompileDependenciesJettyOverride1() {
|
||||
var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.16")),
|
||||
ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var dependencies = resolver.getDirectDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(4, dependencies.size());
|
||||
|
|
@ -204,7 +204,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testGetCompileDependenciesJettyOverride2() {
|
||||
var resolver = new DependencyResolver(new VersionResolution(new HierarchicalProperties().put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.11,org.eclipse.jetty:jetty-io:11.0.13,org.eclipse.jetty:jetty-server:11.0.15")),
|
||||
ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var dependencies = resolver.getDirectDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(4, dependencies.size());
|
||||
|
|
@ -217,7 +217,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileRuntimeDependenciesJunit() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.junit.jupiter", "junit-jupiter", new VersionNumber(5, 9, 2)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.junit.jupiter", "junit-jupiter", new VersionNumber(5, 9, 2)));
|
||||
var dependencies_compile = resolver.getDirectDependencies(compile, runtime);
|
||||
assertNotNull(dependencies_compile);
|
||||
assertEquals(3, dependencies_compile.size());
|
||||
|
|
@ -229,7 +229,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileDependenciesSpringBoot() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.springframework.boot", "spring-boot-starter", new VersionNumber(3, 0, 4)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.springframework.boot", "spring-boot-starter", new VersionNumber(3, 0, 4)));
|
||||
var dependencies = resolver.getDirectDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(6, dependencies.size());
|
||||
|
|
@ -244,7 +244,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileDependenciesMaven() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.apache.maven", "maven-core", new VersionNumber(3, 9, 0)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.apache.maven", "maven-core", new VersionNumber(3, 9, 0)));
|
||||
var dependencies = resolver.getDirectDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(26, dependencies.size());
|
||||
|
|
@ -279,7 +279,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileDependenciesPlay() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19)));
|
||||
var dependencies = resolver.getDirectDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(25, dependencies.size());
|
||||
|
|
@ -313,7 +313,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileDependenciesVaadin() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.vaadin", "vaadin", new VersionNumber(23, 3, 7)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.vaadin", "vaadin", new VersionNumber(23, 3, 7)));
|
||||
var dependencies = resolver.getDirectDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(9, dependencies.size());
|
||||
|
|
@ -331,20 +331,22 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
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, RIFE2_SNAPSHOTS), new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(2, 0, 0)));
|
||||
var dependencies = resolver.getDirectDependencies(compile, runtime);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(4, dependencies.size());
|
||||
assertEquals(6, dependencies.size());
|
||||
assertEquals("""
|
||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22
|
||||
com.squareup.okhttp3:okhttp:4.11.0
|
||||
com.squareup.okhttp3:logging-interceptor:4.11.0
|
||||
org.json:json:20230618""", StringUtils.join(dependencies, "\n"));
|
||||
org.jetbrains.kotlin:kotlin-stdlib:2.1.10
|
||||
org.jetbrains.kotlin:kotlin-stdlib-common:2.1.10
|
||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10
|
||||
com.squareup.okhttp3:okhttp:4.12.0
|
||||
com.squareup.okhttp3:logging-interceptor:4.12.0
|
||||
org.json:json:20250107""", StringUtils.join(dependencies, "\n"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetCompileTransitiveDependenciesRIFE2() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var dependencies = resolver.getAllDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(1, dependencies.size());
|
||||
|
|
@ -354,17 +356,17 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileTransitiveDependenciesRIFE2Snapshot() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT")));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
|
||||
var dependencies = resolver.getAllDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(1, dependencies.size());
|
||||
assertEquals("""
|
||||
com.uwyn.rife2:rife2:1.4.1-SNAPSHOT""", StringUtils.join(dependencies, "\n"));
|
||||
com.uwyn.rife2:rife2:1.5.18-SNAPSHOT""", StringUtils.join(dependencies, "\n"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetCompileTransitiveDependenciesJetty() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var dependencies = resolver.getAllDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(6, dependencies.size());
|
||||
|
|
@ -379,7 +381,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileTransitiveDependenciesJettyExclusion() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS),
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS),
|
||||
new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))
|
||||
.exclude("org.slf4j", "slf4j-api"));
|
||||
var dependencies = resolver.getAllDependencies(compile);
|
||||
|
|
@ -395,7 +397,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileTransitiveDependenciesJettyFullGroupExclusion() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS),
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS),
|
||||
new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))
|
||||
.exclude("org.eclipse.jetty", "*"));
|
||||
var dependencies = resolver.getAllDependencies(compile);
|
||||
|
|
@ -409,7 +411,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileTransitiveDependenciesJettyFullArtifactExclusion() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS),
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS),
|
||||
new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))
|
||||
.exclude("*", "jetty-http")
|
||||
.exclude("*", "slf4j-api"));
|
||||
|
|
@ -425,7 +427,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileTransitiveDependenciesJettyFullExclusion() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS),
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS),
|
||||
new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))
|
||||
.exclude("*", "*"));
|
||||
var dependencies = resolver.getAllDependencies(compile);
|
||||
|
|
@ -437,8 +439,8 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileTransitiveDependenciesJettyAndSlfj() {
|
||||
var dependencies = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))).getAllDependencies(compile);
|
||||
var dependencies2 = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 6))).getAllDependencies(compile, runtime);
|
||||
var dependencies = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14))).getAllDependencies(compile);
|
||||
var dependencies2 = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 6))).getAllDependencies(compile, runtime);
|
||||
assertNotNull(dependencies);
|
||||
assertNotNull(dependencies2);
|
||||
assertEquals(6, dependencies.size());
|
||||
|
|
@ -457,7 +459,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileRuntimeTransitiveDependenciesJunit() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.junit.jupiter", "junit-jupiter", new VersionNumber(5, 9, 2)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.junit.jupiter", "junit-jupiter", new VersionNumber(5, 9, 2)));
|
||||
var dependencies_compile = resolver.getAllDependencies(compile, runtime);
|
||||
assertNotNull(dependencies_compile);
|
||||
assertEquals(8, dependencies_compile.size());
|
||||
|
|
@ -480,7 +482,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileTransitiveDependenciesSpringBoot() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.springframework.boot", "spring-boot-starter", new VersionNumber(3, 0, 4)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.springframework.boot", "spring-boot-starter", new VersionNumber(3, 0, 4)));
|
||||
var dependencies = resolver.getAllDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(18, dependencies.size());
|
||||
|
|
@ -507,7 +509,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileTransitiveDependenciesMaven() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.apache.maven", "maven-core", new VersionNumber(3, 9, 0)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.apache.maven", "maven-core", new VersionNumber(3, 9, 0)));
|
||||
var dependencies = resolver.getAllDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(32, dependencies.size());
|
||||
|
|
@ -548,7 +550,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileTransitiveDependenciesPlay() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19)));
|
||||
var dependencies = resolver.getAllDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(48, dependencies.size());
|
||||
|
|
@ -605,7 +607,7 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
void testGetCompileTransitiveDependenciesVaadin() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.vaadin", "vaadin", new VersionNumber(23, 3, 7)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.vaadin", "vaadin", new VersionNumber(23, 3, 7)));
|
||||
var dependencies = resolver.getAllDependencies(compile);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(88, dependencies.size());
|
||||
|
|
@ -702,27 +704,27 @@ public class TestDependencyResolver {
|
|||
|
||||
@Test
|
||||
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, RIFE2_SNAPSHOTS), new Dependency("net.thauvin.erik", "bitly-shorten", new VersionNumber(2, 0, 0)));
|
||||
var dependencies = resolver.getAllDependencies(compile, runtime);
|
||||
assertNotNull(dependencies);
|
||||
assertEquals(11, dependencies.size());
|
||||
assertEquals("""
|
||||
net.thauvin.erik:bitly-shorten:0.9.4-SNAPSHOT
|
||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22
|
||||
com.squareup.okhttp3:okhttp:4.11.0
|
||||
com.squareup.okhttp3:logging-interceptor:4.11.0
|
||||
org.json:json:20230618
|
||||
org.jetbrains.kotlin:kotlin-stdlib:1.8.22
|
||||
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
|
||||
net.thauvin.erik:bitly-shorten:2.0.0
|
||||
org.jetbrains.kotlin:kotlin-stdlib:2.1.10
|
||||
org.jetbrains.kotlin:kotlin-stdlib-common:2.1.10
|
||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10
|
||||
com.squareup.okhttp3:okhttp:4.12.0
|
||||
com.squareup.okhttp3:logging-interceptor:4.12.0
|
||||
org.json:json:20250107
|
||||
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
|
||||
void testGetCompileRuntimeTransitiveDependenciesMariaDb() {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.mariadb.jdbc", "mariadb-java-client", new VersionNumber(3, 1, 3)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.mariadb.jdbc", "mariadb-java-client", new VersionNumber(3, 1, 3)));
|
||||
var dependencies_compile = resolver.getAllDependencies(compile, runtime);
|
||||
assertNotNull(dependencies_compile);
|
||||
assertEquals(9, dependencies_compile.size());
|
||||
|
|
@ -746,7 +748,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependency()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -768,7 +770,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencySources()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -791,7 +793,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencySourcesJavadoc()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -815,17 +817,17 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencySnapshot()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT")));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2);
|
||||
assertEquals("""
|
||||
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4.jar""", StringUtils.join(result, "\n"));
|
||||
https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7.jar""", StringUtils.join(result, "\n"));
|
||||
|
||||
var files = FileUtils.getFileList(tmp1);
|
||||
assertEquals(1, files.size());
|
||||
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4.jar"));
|
||||
assertTrue(files.contains("rife2-1.5.18-20230408.014123-7.jar"));
|
||||
|
||||
assertTrue(FileUtils.getFileList(tmp2).isEmpty());
|
||||
} finally {
|
||||
|
|
@ -837,19 +839,19 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencySnapshotSources()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT")));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2, CLASSIFIER_SOURCES);
|
||||
assertEquals("""
|
||||
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4.jar
|
||||
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4-sources.jar""", StringUtils.join(result, "\n"));
|
||||
https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7.jar
|
||||
https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7-sources.jar""", StringUtils.join(result, "\n"));
|
||||
|
||||
var files = FileUtils.getFileList(tmp1);
|
||||
assertEquals(2, files.size());
|
||||
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4.jar"));
|
||||
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4-sources.jar"));
|
||||
assertTrue(files.contains("rife2-1.5.18-20230408.014123-7.jar"));
|
||||
assertTrue(files.contains("rife2-1.5.18-20230408.014123-7-sources.jar"));
|
||||
|
||||
assertTrue(FileUtils.getFileList(tmp2).isEmpty());
|
||||
} finally {
|
||||
|
|
@ -861,21 +863,21 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencySnapshotSourcesJavadoc()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT")));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2, CLASSIFIER_SOURCES, CLASSIFIER_JAVADOC);
|
||||
assertEquals("""
|
||||
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4.jar
|
||||
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4-sources.jar
|
||||
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4-javadoc.jar""", StringUtils.join(result, "\n"));
|
||||
https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7.jar
|
||||
https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7-sources.jar
|
||||
https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7-javadoc.jar""", StringUtils.join(result, "\n"));
|
||||
|
||||
var files = FileUtils.getFileList(tmp1);
|
||||
assertEquals(3, files.size());
|
||||
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4.jar"));
|
||||
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4-javadoc.jar"));
|
||||
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4-sources.jar"));
|
||||
assertTrue(files.contains("rife2-1.5.18-20230408.014123-7.jar"));
|
||||
assertTrue(files.contains("rife2-1.5.18-20230408.014123-7-javadoc.jar"));
|
||||
assertTrue(files.contains("rife2-1.5.18-20230408.014123-7-sources.jar"));
|
||||
|
||||
assertTrue(FileUtils.getFileList(tmp2).isEmpty());
|
||||
} finally {
|
||||
|
|
@ -887,7 +889,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencySourcesModule()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2"));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2"));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -910,7 +912,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencySourcesJavadocModule()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2"));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2"));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -934,19 +936,19 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencySnapshotModule()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT")));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2);
|
||||
assertEquals("""
|
||||
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4.jar""", StringUtils.join(result, "\n"));
|
||||
https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7.jar""", StringUtils.join(result, "\n"));
|
||||
|
||||
assertTrue(FileUtils.getFileList(tmp1).isEmpty());
|
||||
|
||||
var files = FileUtils.getFileList(tmp2);
|
||||
assertEquals(1, files.size());
|
||||
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4.jar"));
|
||||
assertTrue(files.contains("rife2-1.5.18-20230408.014123-7.jar"));
|
||||
} finally {
|
||||
FileUtils.deleteDirectory(tmp1);
|
||||
FileUtils.deleteDirectory(tmp2);
|
||||
|
|
@ -956,21 +958,21 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencySnapshotSourcesModule()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT")));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2, CLASSIFIER_SOURCES);
|
||||
assertEquals("""
|
||||
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4.jar
|
||||
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4-sources.jar""", StringUtils.join(result, "\n"));
|
||||
https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7.jar
|
||||
https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7-sources.jar""", StringUtils.join(result, "\n"));
|
||||
|
||||
assertTrue(FileUtils.getFileList(tmp1).isEmpty());
|
||||
|
||||
var files = FileUtils.getFileList(tmp2);
|
||||
assertEquals(2, files.size());
|
||||
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4.jar"));
|
||||
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4-sources.jar"));
|
||||
assertTrue(files.contains("rife2-1.5.18-20230408.014123-7.jar"));
|
||||
assertTrue(files.contains("rife2-1.5.18-20230408.014123-7-sources.jar"));
|
||||
} finally {
|
||||
FileUtils.deleteDirectory(tmp1);
|
||||
FileUtils.deleteDirectory(tmp2);
|
||||
|
|
@ -980,23 +982,23 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencySnapshotSourcesJavadocModule()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 1, "SNAPSHOT")));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 5, 18, "SNAPSHOT")));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
var result = resolver.getAllDependencies(compile).transferIntoDirectory(VersionResolution.dummy(), ArtifactRetriever.instance(), resolver.repositories(), tmp1, tmp2, CLASSIFIER_SOURCES, CLASSIFIER_JAVADOC);
|
||||
assertEquals("""
|
||||
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4.jar
|
||||
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4-sources.jar
|
||||
https://s01.oss.sonatype.org/content/repositories/snapshots/:https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/rife2/1.4.1-SNAPSHOT/rife2-1.4.1-20230307.195509-4-javadoc.jar""", StringUtils.join(result, "\n"));
|
||||
https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7.jar
|
||||
https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7-sources.jar
|
||||
https://repo.rife2.com/snapshots/:https://repo.rife2.com/snapshots/com/uwyn/rife2/rife2/1.5.18-SNAPSHOT/rife2-1.5.18-20230408.014123-7-javadoc.jar""", StringUtils.join(result, "\n"));
|
||||
|
||||
assertTrue(FileUtils.getFileList(tmp1).isEmpty());
|
||||
|
||||
var files = FileUtils.getFileList(tmp2);
|
||||
assertEquals(3, files.size());
|
||||
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4.jar"));
|
||||
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4-javadoc.jar"));
|
||||
assertTrue(files.contains("rife2-1.4.1-20230307.195509-4-sources.jar"));
|
||||
assertTrue(files.contains("rife2-1.5.18-20230408.014123-7.jar"));
|
||||
assertTrue(files.contains("rife2-1.5.18-20230408.014123-7-javadoc.jar"));
|
||||
assertTrue(files.contains("rife2-1.5.18-20230408.014123-7-sources.jar"));
|
||||
} finally {
|
||||
FileUtils.deleteDirectory(tmp1);
|
||||
FileUtils.deleteDirectory(tmp2);
|
||||
|
|
@ -1006,7 +1008,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencyJetty()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1040,7 +1042,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencyJettyModule()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1074,7 +1076,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencySwagger()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("io.swagger.core.v3", "swagger-core", new VersionNumber(2,2,27)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("io.swagger.core.v3", "swagger-core", new VersionNumber(2,2,27)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1124,7 +1126,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencyGoogleApi()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.google.apis", "google-api-services-youtube", new VersionGeneric("v3-rev20240514-2.0.0")));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.google.apis", "google-api-services-youtube", new VersionGeneric("v3-rev20240514-2.0.0")));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1194,7 +1196,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencyGoogleApiModule()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("com.google.apis", "google-api-services-youtube", new VersionGeneric("v3-rev20240514-2.0.0")));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("com.google.apis", "google-api-services-youtube", new VersionGeneric("v3-rev20240514-2.0.0")));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1268,7 +1270,7 @@ public class TestDependencyResolver {
|
|||
.put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.11")
|
||||
.put(PROPERTY_OVERRIDE_PREFIX + "1", "org.eclipse.jetty:jetty-io:11.0.13")
|
||||
.put(PROPERTY_OVERRIDE_PREFIX + "2", "org.eclipse.jetty:jetty-server:11.0.15"));
|
||||
var resolver = new DependencyResolver(resolution, ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var resolver = new DependencyResolver(resolution, ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1306,7 +1308,7 @@ public class TestDependencyResolver {
|
|||
.put(PROPERTY_OVERRIDE_PREFIX, "org.slf4j:slf4j-api:2.0.11")
|
||||
.put(PROPERTY_OVERRIDE_PREFIX + "1", "org.eclipse.jetty:jetty-io:11.0.13")
|
||||
.put(PROPERTY_OVERRIDE_PREFIX + "2", "org.eclipse.jetty:jetty-server:11.0.15"));
|
||||
var resolver = new DependencyResolver(resolution, ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var resolver = new DependencyResolver(resolution, ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1340,7 +1342,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencyJettySources()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1386,7 +1388,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencyJettySourcesModule()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1432,7 +1434,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencyJettySourcesJavadoc()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1490,7 +1492,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencyJettySourcesJavadocModule()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1548,7 +1550,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependenciesJunit()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.junit.jupiter", "junit-jupiter", new VersionNumber(5, 9, 2)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.junit.jupiter", "junit-jupiter", new VersionNumber(5, 9, 2)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1586,7 +1588,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencySpringBoot()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.springframework.boot", "spring-boot-starter", new VersionNumber(3, 0, 4)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.springframework.boot", "spring-boot-starter", new VersionNumber(3, 0, 4)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1644,7 +1646,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencyMaven()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.apache.maven", "maven-core", new VersionNumber(3, 9, 0)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.apache.maven", "maven-core", new VersionNumber(3, 9, 0)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1730,7 +1732,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencyPlay()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1850,7 +1852,7 @@ public class TestDependencyResolver {
|
|||
throws Exception {
|
||||
var resolution = new VersionResolution(new HierarchicalProperties()
|
||||
.put(PROPERTY_OVERRIDE_PREFIX, "org.scala-lang:scala-library:2.13.12,org.slf4j:slf4j-api:2.0.11,com.google.guava:guava:31.1-jre"));
|
||||
var resolver = new DependencyResolver(resolution, ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19)));
|
||||
var resolver = new DependencyResolver(resolution, ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.typesafe.play", "play_2.13", new VersionNumber(2, 8, 19)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -1968,7 +1970,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferDependencyVaadin()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("com.vaadin", "vaadin", new VersionNumber(23, 3, 7)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("com.vaadin", "vaadin", new VersionNumber(23, 3, 7)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -2166,7 +2168,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferCheckExisting()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
@ -2224,7 +2226,7 @@ public class TestDependencyResolver {
|
|||
@Test
|
||||
void testTransferCheckExistingModule()
|
||||
throws Exception {
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var resolver = new DependencyResolver(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS, RIFE2_SNAPSHOTS), new Module("org.eclipse.jetty", "jetty-server", new VersionNumber(11, 0, 14)));
|
||||
var tmp1 = Files.createTempDirectory("transfers").toFile();
|
||||
var tmp2 = Files.createTempDirectory("modules").toFile();
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -359,19 +359,19 @@ public class TestDependencySet {
|
|||
@Test
|
||||
void testGenerateDependencyTreeCompileRuntime() {
|
||||
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("""
|
||||
└─ net.thauvin.erik:bitly-shorten:0.9.4-SNAPSHOT
|
||||
├─ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22
|
||||
│ ├─ org.jetbrains.kotlin:kotlin-stdlib:1.8.22
|
||||
│ │ ├─ org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22
|
||||
│ │ └─ org.jetbrains:annotations:13.0
|
||||
│ └─ org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22
|
||||
├─ com.squareup.okhttp3:okhttp:4.11.0
|
||||
│ └─ com.squareup.okio:okio:3.2.0
|
||||
│ └─ com.squareup.okio:okio-jvm:3.2.0
|
||||
├─ com.squareup.okhttp3:logging-interceptor:4.11.0
|
||||
└─ org.json:json:20230618
|
||||
"""), dependencies.generateTransitiveDependencyTree(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY), compile, runtime));
|
||||
└─ net.thauvin.erik:bitly-shorten:2.0.0
|
||||
├─ org.jetbrains.kotlin:kotlin-stdlib:2.1.10
|
||||
│ └─ org.jetbrains:annotations:13.0
|
||||
├─ org.jetbrains.kotlin:kotlin-stdlib-common:2.1.10
|
||||
├─ org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10
|
||||
│ └─ org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.10
|
||||
├─ com.squareup.okhttp3:okhttp:4.12.0
|
||||
│ └─ com.squareup.okio:okio:3.6.0
|
||||
│ └─ com.squareup.okio:okio-jvm:3.6.0
|
||||
├─ com.squareup.okhttp3:logging-interceptor:4.12.0
|
||||
└─ org.json:json:20250107
|
||||
"""), dependencies.generateTransitiveDependencyTree(VersionResolution.dummy(), ArtifactRetriever.instance(), List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS), compile, runtime));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2798
src/test/java/rife/bld/operations/TestJavacOptions.java
Normal file
2798
src/test/java/rife/bld/operations/TestJavacOptions.java
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue