/** * Register an API Gateway API that should have its DefinitionBody property updated in the * Cloudformation template * * @param ref the Cloudformation Ref of the API to update * @param swagger the file containing the swagger definition of the API */ public void api(String ref, FileCollection swagger) { getInputs().files(swagger); apis.put(ref, swagger.getSingleFile()); }
private Set<File> getMainJavaResourceDirs() { return sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME).getResources().getSrcDirs(); }
/** * @return Returns the output directory for .class file. */ public File classes() { SourceSet sourceSet = sourceSet(project); return sourceSet.getRuntimeClasspath().getFiles().stream() .filter(f -> f.exists() && f.isDirectory() && f.toString().contains("classes")) .findFirst() .get(); }
if (!alwaysUsePathingJar && !classpath.filter(f -> f.getAbsolutePath().contains("restli-tools-scala")).isEmpty()) { LOG.info("Compiling Scala resource classes. Disabling pathing jar for " + taskName + " to avoid breaking Scala compilation"); return classpath; FileCollection filteredClasspath = classpath.filter(f -> !f.isDirectory()); File destinationDir = new File(project.getBuildDir(), taskName); destinationDir.mkdirs(); String cp = ClasspathManifest.relativeClasspathManifest(destinationDir, filteredClasspath.getFiles()); jarOutputStream.close(); return classpath.filter(File::isDirectory).plus(project.files(pathingJarPath));
public Set<File> classpath() { SourceSet sourceSet = sourceSet(project); // conf & public Set<File> cp = new LinkedHashSet<>(sourceSet.getResources().getSrcDirs()); // classes/main, resources/main + jars cp.addAll(sourceSet.getRuntimeClasspath().getFiles()); // provided? Configuration provided = project.getConfigurations().findByName("provided"); if (provided != null) { cp.addAll(provided.getFiles()); } return cp; }
@Override public void exec() { if (Utils.isNullOrEmpty(url) || Utils.isNullOrEmpty(output)) { throw new IllegalArgumentException("Schema URL and output path can't be empty"); } setScript(new File(getProject().getTasks().getByPath(ApolloCodegenInstallTask.NAME).getOutputs().getFiles() .getAsPath(), ApolloLocalCodegenGenerationTask.APOLLO_CODEGEN_EXEC_FILE)); List<String> args = Lists.newArrayList("introspect-schema", url, "--output", getProject().file(output) .getAbsolutePath()); if (!headers.isEmpty()) { for(String h : headers) { args.add("--header"); args.add(h); } } if (insecure) { args.add("--insecure"); args.add("true"); } setArgs(args); super.exec(); }
private FormatterStep createStep() { Project project = getProject(); return DBeaverSQLFormatterStep.create(project.files(configFiles).getFiles()); } }
public void classpath(Object... args) { classpath.setFrom(args); }
try { return FileUtil.getRelativePath( project.getProjectDir(), found.getSingleFile()); } catch (IllegalStateException ignored) { return null;
private Set<File> getTestSrcDirs() { return sourceSets.getByName(SourceSet.TEST_SOURCE_SET_NAME).getAllJava().getSrcDirs(); }
/** * Register a lambda function that should have its CodeUri property updated in the Cloudformation * template * * @param ref the CloudFormation Ref of the function to update * @param zip the files containing the function's deployment package */ public void lambdaFunction(String ref, FileCollection zip) { getInputs().files(zip); lambdaFunctions.put(ref, zip.getSingleFile()); }
public void configFile(Object... configFiles) { requireElementsNonNull(configFiles); Project project = getProject(); builder.setPreferences(project.files(configFiles).getFiles()); replaceStep(builder.build()); }
public Set<File> sources() { SourceSet sourceSet = sourceSet(project); // conf & public Set<File> src = new LinkedHashSet<>(sourceSet.getResources().getSrcDirs()); // source java: always add parent file: should be src/main sourceSet.getJava().getSrcDirs().forEach(f -> src.add(f.getParentFile())); return src; }
new UnionFileCollection(javaCompiler.getSource(), project.fileTree(destinationFolder)); javaCompiler.setSource(uft); logger.debug("Analyzing configuration: " + variantCompileClasspath.getFiles()); Set<String> targetActivities = new HashSet<>(); Streams.stream(variantCompileClasspath)
public void configFile(Object... configFiles) { requireElementsNonNull(configFiles); Project project = extension.getProject(); builder.setPreferences(project.files(configFiles).getFiles()); extension.replaceStep(builder.build()); } }
private Set<File> getMainSrcDirs() { return sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME).getAllJava().getSrcDirs(); }
public File javaSrc() { SourceSet sourceSet = sourceSet(project); // source java return sourceSet.getJava().getSrcDirs().iterator().next(); }
private Set<File> getTestJavaResourceDirs() { return sourceSets.getByName(SourceSet.TEST_SOURCE_SET_NAME).getResources().getSrcDirs(); }