mirror of
https://github.com/rife2/bld
synced 2026-08-04 15:07:46 +02:00
Compare commits
4 commits
a42248ca72
...
295dfb1973
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
295dfb1973 | ||
|
|
734ac585ab | ||
|
|
385b0cb2a8 | ||
|
|
fb88954933 |
|
|
@ -11,6 +11,8 @@ import rife.bld.operations.*;
|
||||||
import rife.tools.FileUtils;
|
import rife.tools.FileUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
|
@ -902,12 +904,37 @@ public class BaseProject extends BuildExecutor {
|
||||||
* <p>
|
* <p>
|
||||||
* If the local dependency points to a directory, it will be scanned for jar files.
|
* If the local dependency points to a directory, it will be scanned for jar files.
|
||||||
*
|
*
|
||||||
* @param path the file system path of the local dependency
|
* @param path the file system path (absolute or relative to the {@link #workDirectory})
|
||||||
|
* of the local dependency
|
||||||
* @since 1.5.2
|
* @since 1.5.2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public LocalDependency local(String path) {
|
public LocalDependency local(String path) {
|
||||||
return new LocalDependency(path);
|
return new LocalDependency(path);
|
||||||
|
} /**
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a local dependency instance.
|
||||||
|
* <p>
|
||||||
|
* If the local dependency points to a directory, it will be scanned for jar files.
|
||||||
|
*
|
||||||
|
* @param path the file system path (absolute or relative to the {@link #workDirectory})
|
||||||
|
* of the local dependency
|
||||||
|
* @since 2.3.1
|
||||||
|
*/
|
||||||
|
public LocalDependency local(Path path) {
|
||||||
|
return new LocalDependency(path.toString());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Creates a local dependency instance.
|
||||||
|
* <p>
|
||||||
|
* If the local dependency points to a directory, it will be scanned for jar files.
|
||||||
|
*
|
||||||
|
* @param path the file system path of the local dependency
|
||||||
|
* @since 2.3.1
|
||||||
|
*/
|
||||||
|
public LocalDependency local(File path) {
|
||||||
|
return new LocalDependency(path.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -997,14 +1024,39 @@ public class BaseProject extends BuildExecutor {
|
||||||
* <p>
|
* <p>
|
||||||
* If the local module points to a directory, it will be scanned for jar files.
|
* If the local module points to a directory, it will be scanned for jar files.
|
||||||
*
|
*
|
||||||
* @param path the file system path of the local module
|
* @param path the file system path (absolute or relative to the {@link #workDirectory})
|
||||||
|
* of the local module
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public LocalModule localModule(String path) {
|
public LocalModule localModule(String path) {
|
||||||
return new LocalModule(path);
|
return new LocalModule(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a local module instance.
|
||||||
|
* <p>
|
||||||
|
* If the local module points to a directory, it will be scanned for jar files.
|
||||||
|
*
|
||||||
|
* @param path the file system path (absolute or relative to the {@link #workDirectory})
|
||||||
|
* of the local module
|
||||||
|
* @since 2.3.1
|
||||||
|
*/
|
||||||
|
public LocalModule localModule(Path path) {
|
||||||
|
return new LocalModule(path.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a local module instance.
|
||||||
|
* <p>
|
||||||
|
* If the local module points to a directory, it will be scanned for jar files.
|
||||||
|
*
|
||||||
|
* @param path the file system path of the local module
|
||||||
|
* @since 2.3.1
|
||||||
|
*/
|
||||||
|
public LocalModule localModule(File path) {
|
||||||
|
return new LocalModule(path.getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Project directories
|
* Project directories
|
||||||
*/
|
*/
|
||||||
|
|
@ -1863,17 +1915,29 @@ public class BaseProject extends BuildExecutor {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addLocalJars(List<File> jars, String path) {
|
private void addLocalJars(List<File> jars, String path) {
|
||||||
var local_file = new File(workDirectory(), path);
|
var local_path = Path.of(path);
|
||||||
if (local_file.exists()) {
|
if (!local_path.isAbsolute()) {
|
||||||
if (local_file.isDirectory()) {
|
local_path = workDirectory().toPath().resolve(path);
|
||||||
var local_jar_files = FileUtils.getFileList(local_file.getAbsoluteFile(), INCLUDED_JARS, EXCLUDED_JARS);
|
}
|
||||||
jars.addAll(new ArrayList<>(local_jar_files.stream().map(file -> new File(local_file, file)).toList()));
|
|
||||||
} else {
|
if (!Files.exists(local_path)) {
|
||||||
jars.add(local_file);
|
if (verbose()) {
|
||||||
|
System.err.println("Invalid local dependency path, skipped: " + path);
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Files.isDirectory(local_path)) {
|
||||||
|
var local_jar_files = FileUtils.getFileList(local_path.toFile(), INCLUDED_JARS, EXCLUDED_JARS);
|
||||||
|
for (var jar : local_jar_files) {
|
||||||
|
jars.add(local_path.resolve(jar).toFile());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
jars.add(local_path.toFile());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all the classpath entries for compiling the main sources.
|
* Returns all the classpath entries for compiling the main sources.
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,9 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!silent()) {
|
||||||
|
System.out.println("Analyzing dependencies...");
|
||||||
|
}
|
||||||
executeDownloadCompileDependencies();
|
executeDownloadCompileDependencies();
|
||||||
executeDownloadProvidedDependencies();
|
executeDownloadProvidedDependencies();
|
||||||
executeDownloadRuntimeDependencies();
|
executeDownloadRuntimeDependencies();
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,9 @@ public class WrapperExtensionResolver {
|
||||||
roots.add(d);
|
roots.add(d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!roots.isEmpty()) {
|
||||||
|
System.out.println("Analyzing bld extension dependencies...");
|
||||||
|
}
|
||||||
var dependencies = new ParallelDependencyResolver(resolution_, retriever_, repositories_).resolveAllDependencies(roots, Scope.compile, Scope.runtime);
|
var dependencies = new ParallelDependencyResolver(resolution_, retriever_, repositories_).resolveAllDependencies(roots, Scope.compile, Scope.runtime);
|
||||||
if (!dependencies.isEmpty()) {
|
if (!dependencies.isEmpty()) {
|
||||||
ensurePrintedHeader();
|
ensurePrintedHeader();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue