use of org.gradle.api.file.ConfigurableFileCollection in project gradle by gradle.
the class JacocoMerge method executionData.
/**
* Adds execution data generated by a task to the list of those to merge. Only tasks with a {@link JacocoTaskExtension} will be included; all others will be ignored.
*
* @param tasks one or more tasks to merge
*/
public void executionData(Task... tasks) {
for (Task task : tasks) {
JacocoTaskExtension extension = task.getExtensions().findByType(JacocoTaskExtension.class);
if (extension != null) {
ConfigurableFileCollection files = getProject().files(extension.getDestinationFile());
files.builtBy(task);
executionData(files);
}
}
}
use of org.gradle.api.file.ConfigurableFileCollection in project gradle by gradle.
the class JavaExecHandleBuilder method getEffectiveArguments.
@Override
protected List<String> getEffectiveArguments() {
List<String> arguments = getAllArguments();
// Try to shorten command-line if necessary
if (hasCommandLineExceedMaxLength(getExecutable(), arguments)) {
try {
File pathingJarFile = writePathingJarFile(classpath);
ConfigurableFileCollection shortenedClasspath = fileCollectionFactory.configurableFiles();
shortenedClasspath.from(pathingJarFile);
List<String> shortenedArguments = getAllArguments(shortenedClasspath);
LOGGER.info("Shortening Java classpath {} with {}", this.classpath.getFiles(), pathingJarFile);
return shortenedArguments;
} catch (IOException e) {
LOGGER.info("Pathing JAR could not be created, Gradle cannot shorten the command line.", e);
}
}
return arguments;
}
use of org.gradle.api.file.ConfigurableFileCollection in project gradle by gradle.
the class JavaExecHandleBuilder method setClasspath.
@Override
public JavaExecHandleBuilder setClasspath(FileCollection classpath) {
// we need to create a new file collection container to avoid cycles. See: https://github.com/gradle/gradle/issues/8755
ConfigurableFileCollection newClasspath = fileCollectionFactory.configurableFiles("classpath");
newClasspath.setFrom(classpath);
this.classpath = newClasspath;
return this;
}
Aggregations