@Override public void applyTo(final Project project) { // XXX: This needs to be adjusted to work with a build matrix one day. Until // that is ready, we always assume pure Python 2.7 on Linux. String version = project.getVersion().toString().replace("-", "_"); String name = project.getName().replace("-", "_"); final File wheelArtifact = new File(project.getProjectDir(), "/dist/" + name + "-" + version + "-py2-none-any.whl"); /* * Create a Python wheel distribution. */ project.getTasks().create(TASK_PACKAGE_WHEEL, task -> { task.dependsOn(project.getTasks().getByName(StandardTextValues.TASK_INSTALL_PROJECT.getValue())); task.getOutputs().file(wheelArtifact); task.doLast(it -> project.exec(execSpec -> { execSpec.environment(settings.pythonEnvironmentDistgradle); execSpec.commandLine(settings.getDetails().getVirtualEnvInterpreter(), "setup.py", "bdist_wheel"); })); }); LinkedHashMap<String, Object> wheelArtifactInfo = new LinkedHashMap<>(5); wheelArtifactInfo.put("name", name); wheelArtifactInfo.put("classifier", "py2-none-any"); wheelArtifactInfo.put("type", "whl"); wheelArtifactInfo.put("file", wheelArtifact); wheelArtifactInfo.put("builtBy", project.getTasks().getByName(TASK_PACKAGE_WHEEL)); if (!version.contains("SNAPSHOT")) { project.getArtifacts().add(StandardTextValues.CONFIGURATION_WHEEL.getValue(), wheelArtifactInfo); } }
@Override public void applyTo(final Project project) { // XXX: This needs to be adjusted to work with a build matrix one day. Until // that is ready, we always assume pure Python 2.7 on Linux. String version = project.getVersion().toString().replace("-", "_"); String name = project.getName().replace("-", "_"); final File wheelArtifact = new File(project.getProjectDir(), "/dist/" + name + "-" + version + "-py2-none-any.whl"); /* * Create a Python wheel distribution. */ project.getTasks().create(TASK_PACKAGE_WHEEL, task -> { task.dependsOn(project.getTasks().getByName(StandardTextValues.TASK_INSTALL_PROJECT.getValue())); task.getOutputs().file(wheelArtifact); task.doLast(it -> project.exec(execSpec -> { execSpec.environment(settings.pythonEnvironmentDistgradle); execSpec.commandLine(settings.getDetails().getVirtualEnvInterpreter(), "setup.py", "bdist_wheel"); })); }); LinkedHashMap<String, Object> wheelArtifactInfo = new LinkedHashMap<>(5); wheelArtifactInfo.put("name", name); wheelArtifactInfo.put("classifier", "py2-none-any"); wheelArtifactInfo.put("type", "whl"); wheelArtifactInfo.put("file", wheelArtifact); wheelArtifactInfo.put("builtBy", project.getTasks().getByName(TASK_PACKAGE_WHEEL)); if (!version.contains("SNAPSHOT")) { project.getArtifacts().add(StandardTextValues.CONFIGURATION_WHEEL.getValue(), wheelArtifactInfo); } }
final File jarshFile = new File(outputDir + File.separator + project.getName() + ".sh"); task.getOutputs().file(jarshFile);
private void _addTaskBuildWSDLTasks( BuildWSDLTask buildWSDLTask, File inputFile, Configuration wsdlBuilderConfiguration) { Project project = buildWSDLTask.getProject(); if (buildWSDLTask.isBuildLibs()) { String tmpDirName = "build-wsdl/" + FileUtil.stripExtension(inputFile.getName()); File tmpDir = new File(project.getBuildDir(), tmpDirName); File tmpSrcDir = new File(tmpDir, "src"); Task generateTask = _addTaskBuildWSDLGenerate( buildWSDLTask, wsdlBuilderConfiguration, inputFile, tmpSrcDir, true); Task compileTask = _addTaskBuildWSDLCompile( buildWSDLTask, wsdlBuilderConfiguration, inputFile, tmpDir, generateTask); Jar jar = _addTaskBuildWSDLJar( buildWSDLTask, inputFile, compileTask, generateTask); buildWSDLTask.dependsOn(jar); TaskOutputs taskOutputs = buildWSDLTask.getOutputs(); taskOutputs.file(jar.getArchivePath()); } else { Task generateTask = _addTaskBuildWSDLGenerate( buildWSDLTask, wsdlBuilderConfiguration, inputFile, buildWSDLTask.getDestinationDir(), false); buildWSDLTask.dependsOn(generateTask); } }
private Task createClassycleTask(final Project project, final ClassycleExtension extension, final SourceSet sourceSet) { final String taskName = sourceSet.getTaskName("classycle", null); final FileCollection classesDirs = sourceSet.getOutput().getClassesDirs(); final File reportFile = getReportingExtension(project).file("classycle_" + sourceSet.getName() + ".txt"); final Task task = project.task(taskName); task.getInputs().files(classesDirs, extension.getDefinitionFile()); task.getOutputs().file(reportFile); task.doLast(new ClassyclePlugin.ClassycleAction(classesDirs, reportFile, extension)); // the classycle task depends on the corresponding classes task final String classesTask = sourceSet.getClassesTaskName(); task.dependsOn(classesTask); if (project.getLogger().isDebugEnabled()) { final StringBuilder sb = new StringBuilder(); for (final File file : classesDirs) { sb.append(file.getAbsolutePath()).append(" "); } project.getLogger() .debug("Created classycle task: " + taskName + ", report file: " + reportFile + ", depends on: " + classesTask + " - sourceSetDirs: " + sb.toString()); } return task; }
task.getOutputs().file(settings.getDetails().getActivateLink());
task.getOutputs().file(settings.getDetails().getActivateLink());
final Task task = project.task(taskName); task.getInputs().files(classDir, definitionFile); task.getOutputs().file(reportFile); log.debug("Created classycle task: " + taskName + ", report file: " + reportFile); task.doLast(new Action<Task>() {