public class JkComputedDependency extends java.lang.Object implements JkFileDependency
Computed dependencies are instantiated by providing expected files and a Runnable
that
generates these files in case one of them misses.
This is yet simple but quite powerful mechanism, cause the runnable can be anything as Maven or ANT build of another project, a Jerkar build of another project, ...
This is the way for creating multi-projet (and multi-techno if desired) builds.
Modifier | Constructor and Description |
---|---|
protected |
JkComputedDependency(java.lang.Runnable runnable,
java.nio.file.Path ideProjectBaseDir,
java.lang.Iterable<java.nio.file.Path> files,
java.util.function.Supplier<java.lang.Iterable<java.nio.file.Path>> extraFileSupplier)
Constructs a computed dependency to the specified files and the specified
Runnable to run for
generating them. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.util.List<java.nio.file.Path> |
getFiles() |
java.nio.file.Path |
getIdeProjectBaseDir()
If this dependency can be represented as a project dependency in a IDE,
this field mentions the baseTree dir of the project.
|
java.util.Set<java.nio.file.Path> |
getMissingFilesOrEmptyDirs()
Returns the missing files or empty directory for this dependency.
|
int |
hashCode() |
boolean |
hasMissingFilesOrEmptyDirs()
Returns
true if at least one of these files is missing or one of these directory is empty. |
static JkComputedDependency |
of(java.lang.Iterable<java.nio.file.Path> files,
JkJavaProcess process,
java.lang.String className,
java.lang.String... args)
Same as
of(Path, JkJavaProcess, String, String...) but you must specify a set of files
instead of a single one. |
static JkComputedDependency |
of(JkProcess process,
java.nio.file.Path... files)
Creates a computed dependency to the specified files and
JkProcess to run for
generating them. |
static JkComputedDependency |
of(java.nio.file.Path file,
JkJavaProcess process,
java.lang.String className,
java.lang.String... args)
Creates a computed dependency to the specified file and the specified java program to run for
generating them.
|
static JkComputedDependency |
of(java.lang.Runnable runnable,
java.nio.file.Path... files)
Creates a computed dependency to the specified files and the specified
Runnable to run for
generating them. |
java.lang.String |
toString() |
protected JkComputedDependency(java.lang.Runnable runnable, java.nio.file.Path ideProjectBaseDir, java.lang.Iterable<java.nio.file.Path> files, java.util.function.Supplier<java.lang.Iterable<java.nio.file.Path>> extraFileSupplier)
Runnable
to run for
generating them.public static final JkComputedDependency of(JkProcess process, java.nio.file.Path... files)
JkProcess
to run for
generating them.public static final JkComputedDependency of(java.lang.Runnable runnable, java.nio.file.Path... files)
Runnable
to run for
generating them.public static final JkComputedDependency of(java.lang.Iterable<java.nio.file.Path> files, JkJavaProcess process, java.lang.String className, java.lang.String... args)
of(Path, JkJavaProcess, String, String...)
but you must specify a set of files
instead of a single one.public static final JkComputedDependency of(java.nio.file.Path file, JkJavaProcess process, java.lang.String className, java.lang.String... args)
public final boolean hasMissingFilesOrEmptyDirs()
true
if at least one of these files is missing or one of these directory is empty.public final java.util.Set<java.nio.file.Path> getMissingFilesOrEmptyDirs()
public java.util.List<java.nio.file.Path> getFiles()
getFiles
in interface JkFileDependency
public java.nio.file.Path getIdeProjectBaseDir()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object