mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-26 00:37:10 -07:00
Improvement to offline operation, now pushed to the actual operations instead of the commands
This commit is contained in:
parent
d904fd22b7
commit
a02e78820e
13 changed files with 146 additions and 33 deletions
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
bld.downloadExtensionJavadoc=false
|
bld.downloadExtensionJavadoc=false
|
||||||
bld.downloadExtensionSources=true
|
bld.downloadExtensionSources=true
|
||||||
bld.downloadLocation=
|
bld.downloadLocation=file:/Users/gbevin/.m2/repository/com/uwyn/rife2/bld/2.0.0-SNAPSHOT/
|
||||||
bld.extension-antlr=com.uwyn.rife2:bld-antlr4:1.2.8
|
bld.extension-antlr=com.uwyn.rife2:bld-antlr4:1.2.8
|
||||||
bld.extension-archive=com.uwyn.rife2:bld-archive:0.4.8
|
bld.extension-archive=com.uwyn.rife2:bld-archive:0.4.8
|
||||||
bld.extension-tests=com.uwyn.rife2:bld-tests-badge:1.4.8
|
bld.extension-tests=com.uwyn.rife2:bld-tests-badge:1.4.8
|
||||||
|
|
|
@ -485,12 +485,7 @@ public class BaseProject extends BuildExecutor {
|
||||||
@BuildCommand(value = "dependency-tree", help = DependencyTreeHelp.class)
|
@BuildCommand(value = "dependency-tree", help = DependencyTreeHelp.class)
|
||||||
public void dependencyTree()
|
public void dependencyTree()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
if (isOffline()) {
|
dependencyTreeOperation().executeOnce(() -> dependencyTreeOperation().fromProject(this));
|
||||||
System.out.println("Offline mode: dependency-tree is disabled");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dependencyTreeOperation().executeOnce(() -> dependencyTreeOperation().fromProject(this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -501,12 +496,7 @@ public class BaseProject extends BuildExecutor {
|
||||||
@BuildCommand(help = DownloadHelp.class)
|
@BuildCommand(help = DownloadHelp.class)
|
||||||
public void download()
|
public void download()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
if (isOffline()) {
|
downloadOperation().executeOnce(() -> downloadOperation().fromProject(this));
|
||||||
System.out.println("Offline mode: download is disabled");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
downloadOperation().executeOnce(() -> downloadOperation().fromProject(this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -517,12 +507,7 @@ public class BaseProject extends BuildExecutor {
|
||||||
@BuildCommand(help = PurgeHelp.class)
|
@BuildCommand(help = PurgeHelp.class)
|
||||||
public void purge()
|
public void purge()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
if (isOffline()) {
|
purgeOperation().executeOnce(() -> purgeOperation().fromProject(this));
|
||||||
System.out.println("Offline mode: purge is disabled");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
purgeOperation().executeOnce(() -> purgeOperation().fromProject(this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1689,7 +1674,7 @@ public class BaseProject extends BuildExecutor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int execute(String[] arguments) {
|
public int execute(String[] arguments) {
|
||||||
if (!isOffline() &&
|
if (!offline() &&
|
||||||
autoDownloadPurge()) {
|
autoDownloadPurge()) {
|
||||||
performAutoDownloadPurge();
|
performAutoDownloadPurge();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,12 +9,9 @@ import rife.bld.help.HelpHelp;
|
||||||
import rife.bld.operations.HelpOperation;
|
import rife.bld.operations.HelpOperation;
|
||||||
import rife.bld.operations.exceptions.ExitStatusException;
|
import rife.bld.operations.exceptions.ExitStatusException;
|
||||||
import rife.ioc.HierarchicalProperties;
|
import rife.ioc.HierarchicalProperties;
|
||||||
import rife.template.Template;
|
|
||||||
import rife.template.TemplateFactory;
|
|
||||||
import rife.tools.ExceptionUtils;
|
import rife.tools.ExceptionUtils;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
@ -134,7 +131,7 @@ public class BuildExecutor {
|
||||||
* or {@code false} otherwise
|
* or {@code false} otherwise
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
public boolean isOffline() {
|
public boolean offline() {
|
||||||
return offline_;
|
return offline_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,12 +191,7 @@ public class Project extends BaseProject {
|
||||||
jar();
|
jar();
|
||||||
jarSources();
|
jarSources();
|
||||||
jarJavadoc();
|
jarJavadoc();
|
||||||
if (isOffline()) {
|
publishOperation().executeOnce(() -> publishOperation().fromProject(this));
|
||||||
System.out.println("Offline mode: publish is disabled");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
publishOperation().executeOnce(() -> publishOperation().fromProject(this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,6 +24,7 @@ import static rife.bld.dependencies.Scope.*;
|
||||||
* @since 1.5.21
|
* @since 1.5.21
|
||||||
*/
|
*/
|
||||||
public class DependencyTreeOperation extends AbstractOperation<DependencyTreeOperation> {
|
public class DependencyTreeOperation extends AbstractOperation<DependencyTreeOperation> {
|
||||||
|
private boolean offline_ = false;
|
||||||
private HierarchicalProperties properties_ = null;
|
private HierarchicalProperties properties_ = null;
|
||||||
private HierarchicalProperties extensionProperties_ = null;
|
private HierarchicalProperties extensionProperties_ = null;
|
||||||
private ArtifactRetriever retriever_ = null;
|
private ArtifactRetriever retriever_ = null;
|
||||||
|
@ -40,6 +41,11 @@ public class DependencyTreeOperation extends AbstractOperation<DependencyTreeOpe
|
||||||
* @since 1.5.21
|
* @since 1.5.21
|
||||||
*/
|
*/
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
if (offline_) {
|
||||||
|
System.out.println("Offline mode: dependency-tree is disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var extensions_tree = executeGenerateExtensionsDependencies();
|
var extensions_tree = executeGenerateExtensionsDependencies();
|
||||||
var compile_tree = executeGenerateCompileDependencies();
|
var compile_tree = executeGenerateCompileDependencies();
|
||||||
var provided_tree = executeGenerateProvidedDependencies();
|
var provided_tree = executeGenerateProvidedDependencies();
|
||||||
|
@ -157,12 +163,37 @@ public class DependencyTreeOperation extends AbstractOperation<DependencyTreeOpe
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the repositories and the dependencies from the project
|
// add the repositories and the dependencies from the project
|
||||||
return properties(project.properties())
|
return offline(project.offline())
|
||||||
|
.properties(project.properties())
|
||||||
.artifactRetriever(project.artifactRetriever())
|
.artifactRetriever(project.artifactRetriever())
|
||||||
.repositories(project.repositories())
|
.repositories(project.repositories())
|
||||||
.dependencies(project.dependencies());
|
.dependencies(project.dependencies());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether the operation has to run offline.
|
||||||
|
*
|
||||||
|
* @param flag {@code true} if the operation runs offline; or
|
||||||
|
* {@code false} otherwise
|
||||||
|
* @return this operation instance
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public DependencyTreeOperation offline(boolean flag) {
|
||||||
|
offline_ = flag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the operation has to run offline.
|
||||||
|
*
|
||||||
|
* @return {@code true} if the operation runs offline; or
|
||||||
|
* {@code false} otherwise
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public boolean offline() {
|
||||||
|
return offline_;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides repositories to resolve the dependencies against.
|
* Provides repositories to resolve the dependencies against.
|
||||||
*
|
*
|
||||||
|
|
|
@ -25,6 +25,7 @@ import static rife.bld.dependencies.Dependency.CLASSIFIER_SOURCES;
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
||||||
|
private boolean offline_ = false;
|
||||||
private HierarchicalProperties properties_ = null;
|
private HierarchicalProperties properties_ = null;
|
||||||
private ArtifactRetriever retriever_ = null;
|
private ArtifactRetriever retriever_ = null;
|
||||||
private final List<Repository> repositories_ = new ArrayList<>();
|
private final List<Repository> repositories_ = new ArrayList<>();
|
||||||
|
@ -43,6 +44,11 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
if (offline_) {
|
||||||
|
System.out.println("Offline mode: download is disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
executeDownloadCompileDependencies();
|
executeDownloadCompileDependencies();
|
||||||
executeDownloadProvidedDependencies();
|
executeDownloadProvidedDependencies();
|
||||||
executeDownloadRuntimeDependencies();
|
executeDownloadRuntimeDependencies();
|
||||||
|
@ -133,7 +139,8 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public DownloadOperation fromProject(BaseProject project) {
|
public DownloadOperation fromProject(BaseProject project) {
|
||||||
return properties(project.properties())
|
return offline(project.offline())
|
||||||
|
.properties(project.properties())
|
||||||
.artifactRetriever(project.artifactRetriever())
|
.artifactRetriever(project.artifactRetriever())
|
||||||
.repositories(project.repositories())
|
.repositories(project.repositories())
|
||||||
.dependencies(project.dependencies())
|
.dependencies(project.dependencies())
|
||||||
|
@ -146,6 +153,30 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
||||||
.downloadJavadoc(project.downloadJavadoc());
|
.downloadJavadoc(project.downloadJavadoc());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether the operation has to run offline.
|
||||||
|
*
|
||||||
|
* @param flag {@code true} if the operation runs offline; or
|
||||||
|
* {@code false} otherwise
|
||||||
|
* @return this operation instance
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public DownloadOperation offline(boolean flag) {
|
||||||
|
offline_ = flag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the operation has to run offline.
|
||||||
|
*
|
||||||
|
* @return {@code true} if the operation runs offline; or
|
||||||
|
* {@code false} otherwise
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public boolean offline() {
|
||||||
|
return offline_;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides repositories to resolve the dependencies against.
|
* Provides repositories to resolve the dependencies against.
|
||||||
*
|
*
|
||||||
|
|
|
@ -39,6 +39,7 @@ import static rife.tools.StringUtils.encodeHexLower;
|
||||||
* @since 1.5.7
|
* @since 1.5.7
|
||||||
*/
|
*/
|
||||||
public class PublishOperation extends AbstractOperation<PublishOperation> {
|
public class PublishOperation extends AbstractOperation<PublishOperation> {
|
||||||
|
private boolean offline_ = false;
|
||||||
private HierarchicalProperties properties_ = null;
|
private HierarchicalProperties properties_ = null;
|
||||||
private ArtifactRetriever retriever_ = null;
|
private ArtifactRetriever retriever_ = null;
|
||||||
private final HttpClient client_ = HttpClient.newHttpClient();
|
private final HttpClient client_ = HttpClient.newHttpClient();
|
||||||
|
@ -56,6 +57,11 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
||||||
* @since 1.5.7
|
* @since 1.5.7
|
||||||
*/
|
*/
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
if (offline_) {
|
||||||
|
System.out.println("Offline mode: publish is disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (repositories().isEmpty()) {
|
if (repositories().isEmpty()) {
|
||||||
throw new OperationOptionException("ERROR: the publication repositories should be specified");
|
throw new OperationOptionException("ERROR: the publication repositories should be specified");
|
||||||
}
|
}
|
||||||
|
@ -506,6 +512,7 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
||||||
.mavenCompilerSource(project.javaRelease())
|
.mavenCompilerSource(project.javaRelease())
|
||||||
.mavenCompilerTarget(project.javaRelease());
|
.mavenCompilerTarget(project.javaRelease());
|
||||||
}
|
}
|
||||||
|
offline(project.offline());
|
||||||
properties(project.properties());
|
properties(project.properties());
|
||||||
artifactRetriever(project.artifactRetriever());
|
artifactRetriever(project.artifactRetriever());
|
||||||
dependencies().include(project.dependencies());
|
dependencies().include(project.dependencies());
|
||||||
|
@ -528,6 +535,30 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether the operation has to run offline.
|
||||||
|
*
|
||||||
|
* @param flag {@code true} if the operation runs offline; or
|
||||||
|
* {@code false} otherwise
|
||||||
|
* @return this operation instance
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public PublishOperation offline(boolean flag) {
|
||||||
|
offline_ = flag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the operation has to run offline.
|
||||||
|
*
|
||||||
|
* @return {@code true} if the operation runs offline; or
|
||||||
|
* {@code false} otherwise
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public boolean offline() {
|
||||||
|
return offline_;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the moment of publication.
|
* Provides the moment of publication.
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -25,6 +25,7 @@ import static rife.bld.dependencies.Dependency.CLASSIFIER_SOURCES;
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
||||||
|
private boolean offline_ = false;
|
||||||
private HierarchicalProperties properties_ = null;
|
private HierarchicalProperties properties_ = null;
|
||||||
private ArtifactRetriever retriever_ = null;
|
private ArtifactRetriever retriever_ = null;
|
||||||
private final List<Repository> repositories_ = new ArrayList<>();
|
private final List<Repository> repositories_ = new ArrayList<>();
|
||||||
|
@ -43,6 +44,11 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
if (offline_) {
|
||||||
|
System.out.println("Offline mode: purge is disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
executePurgeCompileDependencies();
|
executePurgeCompileDependencies();
|
||||||
executePurgeProvidedDependencies();
|
executePurgeProvidedDependencies();
|
||||||
executePurgeRuntimeDependencies();
|
executePurgeRuntimeDependencies();
|
||||||
|
@ -147,7 +153,8 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public PurgeOperation fromProject(BaseProject project) {
|
public PurgeOperation fromProject(BaseProject project) {
|
||||||
return properties(project.properties())
|
return offline(project.offline())
|
||||||
|
.properties(project.properties())
|
||||||
.artifactRetriever(project.artifactRetriever())
|
.artifactRetriever(project.artifactRetriever())
|
||||||
.repositories(project.repositories())
|
.repositories(project.repositories())
|
||||||
.dependencies(project.dependencies())
|
.dependencies(project.dependencies())
|
||||||
|
@ -160,6 +167,30 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
||||||
.preserveJavadoc(project.downloadJavadoc());
|
.preserveJavadoc(project.downloadJavadoc());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether the operation has to run offline.
|
||||||
|
*
|
||||||
|
* @param flag {@code true} if the operation runs offline; or
|
||||||
|
* {@code false} otherwise
|
||||||
|
* @return this operation instance
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public PurgeOperation offline(boolean flag) {
|
||||||
|
offline_ = flag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the operation has to run offline.
|
||||||
|
*
|
||||||
|
* @return {@code true} if the operation runs offline; or
|
||||||
|
* {@code false} otherwise
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
public boolean offline() {
|
||||||
|
return offline_;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates whether the sources classifier files should be preserved.
|
* Indicates whether the sources classifier files should be preserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -22,6 +22,7 @@ public class TestDependencyTreeOperation {
|
||||||
@Test
|
@Test
|
||||||
void testInstantiation() {
|
void testInstantiation() {
|
||||||
var operation = new DependencyTreeOperation();
|
var operation = new DependencyTreeOperation();
|
||||||
|
assertFalse(operation.offline());
|
||||||
assertEquals(operation.properties().size(), 0);
|
assertEquals(operation.properties().size(), 0);
|
||||||
assertTrue(operation.dependencies().isEmpty());
|
assertTrue(operation.dependencies().isEmpty());
|
||||||
assertTrue(operation.repositories().isEmpty());
|
assertTrue(operation.repositories().isEmpty());
|
||||||
|
@ -55,7 +56,9 @@ public class TestDependencyTreeOperation {
|
||||||
assertTrue(operation2.dependencies().scope(Scope.compile).contains(dependency2));
|
assertTrue(operation2.dependencies().scope(Scope.compile).contains(dependency2));
|
||||||
|
|
||||||
var operation3 = new DependencyTreeOperation()
|
var operation3 = new DependencyTreeOperation()
|
||||||
|
.offline(true)
|
||||||
.repositories(repository1, repository2);
|
.repositories(repository1, repository2);
|
||||||
|
assertTrue(operation3.offline());
|
||||||
assertTrue(operation3.repositories().contains(repository1));
|
assertTrue(operation3.repositories().contains(repository1));
|
||||||
assertTrue(operation3.repositories().contains(repository2));
|
assertTrue(operation3.repositories().contains(repository2));
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ public class TestDownloadOperation {
|
||||||
@Test
|
@Test
|
||||||
void testInstantiation() {
|
void testInstantiation() {
|
||||||
var operation = new DownloadOperation();
|
var operation = new DownloadOperation();
|
||||||
|
assertFalse(operation.offline());
|
||||||
assertTrue(operation.dependencies().isEmpty());
|
assertTrue(operation.dependencies().isEmpty());
|
||||||
assertTrue(operation.repositories().isEmpty());
|
assertTrue(operation.repositories().isEmpty());
|
||||||
assertNull(operation.libCompileDirectory());
|
assertNull(operation.libCompileDirectory());
|
||||||
|
@ -81,7 +82,9 @@ public class TestDownloadOperation {
|
||||||
assertEquals(dir5, operation2.libTestDirectory());
|
assertEquals(dir5, operation2.libTestDirectory());
|
||||||
|
|
||||||
var operation3 = new DownloadOperation()
|
var operation3 = new DownloadOperation()
|
||||||
|
.offline(true)
|
||||||
.repositories(repository1, repository2);
|
.repositories(repository1, repository2);
|
||||||
|
assertTrue(operation3.offline());
|
||||||
assertTrue(operation3.repositories().contains(repository1));
|
assertTrue(operation3.repositories().contains(repository1));
|
||||||
assertTrue(operation3.repositories().contains(repository2));
|
assertTrue(operation3.repositories().contains(repository2));
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,7 @@ public class TestPublishOperation {
|
||||||
@Test
|
@Test
|
||||||
void testInstantiation() {
|
void testInstantiation() {
|
||||||
var operation = new PublishOperation();
|
var operation = new PublishOperation();
|
||||||
|
assertFalse(operation.offline());
|
||||||
assertTrue(operation.repositories().isEmpty());
|
assertTrue(operation.repositories().isEmpty());
|
||||||
assertNull(operation.moment());
|
assertNull(operation.moment());
|
||||||
assertTrue(operation.dependencies().isEmpty());
|
assertTrue(operation.dependencies().isEmpty());
|
||||||
|
@ -109,10 +110,12 @@ public class TestPublishOperation {
|
||||||
assertTrue(operation2.artifacts().contains(artifact2));
|
assertTrue(operation2.artifacts().contains(artifact2));
|
||||||
|
|
||||||
var operation3 = new PublishOperation()
|
var operation3 = new PublishOperation()
|
||||||
|
.offline(true)
|
||||||
.repository(repository1)
|
.repository(repository1)
|
||||||
.repository(repository2)
|
.repository(repository2)
|
||||||
.moment(moment)
|
.moment(moment)
|
||||||
.artifacts(List.of(artifact1, artifact2));
|
.artifacts(List.of(artifact1, artifact2));
|
||||||
|
assertTrue(operation3.offline());
|
||||||
operation3.publishProperties().mavenCompilerSource(17).mavenCompilerTarget(19);
|
operation3.publishProperties().mavenCompilerSource(17).mavenCompilerTarget(19);
|
||||||
assertTrue(operation3.repositories().contains(repository1));
|
assertTrue(operation3.repositories().contains(repository1));
|
||||||
assertTrue(operation3.repositories().contains(repository2));
|
assertTrue(operation3.repositories().contains(repository2));
|
||||||
|
|
|
@ -19,6 +19,7 @@ public class TestPurgeOperation {
|
||||||
@Test
|
@Test
|
||||||
void testInstantiation() {
|
void testInstantiation() {
|
||||||
var operation = new PurgeOperation();
|
var operation = new PurgeOperation();
|
||||||
|
assertFalse(operation.offline());
|
||||||
assertTrue(operation.dependencies().isEmpty());
|
assertTrue(operation.dependencies().isEmpty());
|
||||||
assertTrue(operation.repositories().isEmpty());
|
assertTrue(operation.repositories().isEmpty());
|
||||||
assertNull(operation.libCompileDirectory());
|
assertNull(operation.libCompileDirectory());
|
||||||
|
@ -81,7 +82,9 @@ public class TestPurgeOperation {
|
||||||
assertEquals(dir5, operation2.libTestDirectory());
|
assertEquals(dir5, operation2.libTestDirectory());
|
||||||
|
|
||||||
var operation3 = new PurgeOperation()
|
var operation3 = new PurgeOperation()
|
||||||
|
.offline(true)
|
||||||
.repositories(repository1, repository2);
|
.repositories(repository1, repository2);
|
||||||
|
assertTrue(operation3.offline());
|
||||||
assertTrue(operation3.repositories().contains(repository1));
|
assertTrue(operation3.repositories().contains(repository1));
|
||||||
assertTrue(operation3.repositories().contains(repository2));
|
assertTrue(operation3.repositories().contains(repository2));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue