Java 类org.gradle.api.tasks.TaskAction 实例源码

项目:gradle-circle-style    文件:CircleStyleFinalizer.java   
@TaskAction
public void createCircleReport() throws IOException, TransformerException {
    if (!styleTask.getDidWork()) {
        setDidWork(false);
        return;
    }

    File rootDir = getProject().getRootProject().getProjectDir();
    String projectName = getProject().getName();
    File sourceReport = reporting.getReports().findByName("xml").getDestination();

    List<Failure> failures = reportParser.loadFailures(new FileInputStream(sourceReport));
    long taskTimeNanos = styleTaskTimer.getTaskTimeNanos(styleTask);
    Document report = reportToXml(failuresReport(
            rootDir, projectName, styleTask.getName(), taskTimeNanos, failures));
    targetFile.getParentFile().mkdirs();
    try (FileWriter writer = new FileWriter(targetFile)) {
        XmlUtils.write(writer, report);
    }
}
项目:Reer    文件:FindBugs.java   
@TaskAction
public void run() throws IOException, InterruptedException {
    new FindBugsClasspathValidator(JavaVersion.current()).validateClasspath(
        Iterables.transform(getFindbugsClasspath().getFiles(), new Function<File, String>() {
            @Override
            public String apply(File input) {
                return input.getName();
            }
        }));
    FindBugsSpec spec = generateSpec();
    FindBugsWorkerManager manager = new FindBugsWorkerManager();

    getLogging().captureStandardOutput(LogLevel.DEBUG);
    getLogging().captureStandardError(LogLevel.DEBUG);

    FindBugsResult result = manager.runWorker(getProject().getProjectDir(), getWorkerProcessBuilderFactory(), getFindbugsClasspath(), spec);
    evaluateResult(result);
}
项目:jpa2ddl    文件:GenerateTask.java   
@TaskAction
public void generateModel() throws Exception {
    getLogger().info("Running schema generation...");
    GeneratorSettings settings = getSettings();
    URL[] urls = outputClassesDirs.stream()
            .map(path -> {
                try {
                    return path.toURI().toURL();
                } catch (MalformedURLException e) {
                    throw new IllegalStateException("Cannot build URL from sourceSets", e);
                }
            })
            .toArray(URL[]::new);
    ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
    URLClassLoader urlClassLoader = new URLClassLoader(urls, originalClassLoader);
    Thread.currentThread().setContextClassLoader(urlClassLoader);
    new SchemaGenerator().generate(settings);
    Thread.currentThread().setContextClassLoader(originalClassLoader);
    getLogger().info("Schema saved to " + extension.getOutputPath());
}
项目:Reer    文件:Wrapper.java   
@TaskAction
void generate() {
    File jarFileDestination = getJarFile();
    File unixScript = getScriptFile();
    FileResolver resolver = getFileLookup().getFileResolver(unixScript.getParentFile());
    String jarFileRelativePath = resolver.resolveAsRelativePath(jarFileDestination);

    writeProperties(getPropertiesFile());
    writeWrapperTo(jarFileDestination);

    StartScriptGenerator generator = new StartScriptGenerator();
    generator.setApplicationName("Gradle");
    generator.setMainClassName(GradleWrapperMain.class.getName());
    generator.setClasspath(WrapUtil.toList(jarFileRelativePath));
    generator.setOptsEnvironmentVar("GRADLE_OPTS");
    generator.setExitEnvironmentVar("GRADLE_EXIT_CONSOLE");
    generator.setAppNameSystemProperty("org.gradle.appname");
    generator.setScriptRelPath(unixScript.getName());
    generator.generateUnixScript(unixScript);
    generator.generateWindowsScript(getBatchScript());
}
项目:Reer    文件:InitBuild.java   
@TaskAction
public void setupProjectLayout() {
    final String type = getType();
    BuildInitTestFramework testFramework = BuildInitTestFramework.fromName(getTestFramework());
    final ProjectLayoutSetupRegistry projectLayoutRegistry = getProjectLayoutRegistry();
    if (!projectLayoutRegistry.supports(type)) {
        String supportedTypes = Joiner.on(", ").join(Iterables.transform(projectLayoutRegistry.getSupportedTypes(), new Function<String, String>() {
            @Override
            public String apply(String input) {
                return "'" + input + "'";
            }
        }));
        throw new GradleException("The requested build setup type '" + type + "' is not supported. Supported types: " + supportedTypes + ".");
    }

    ProjectInitDescriptor initDescriptor = projectLayoutRegistry.get(type);
    if (!testFramework.equals(BuildInitTestFramework.NONE) && !initDescriptor.supports(testFramework)) {
        throw new GradleException("The requested test framework '" + testFramework.getId() + "' is not supported in '" + type + "' setup type");
    }

    initDescriptor.generate(testFramework);
}
项目:neo-java-web-gradle-plugin    文件:InstallLocal.java   
@TaskAction
public void installLocal() {
    getLogger().info("Entering installLocal task class");


    getLogger().info("Preparing command " + CommandsAndParams.COMMAND_INSTALL_LOCAL);
    List<String> command = new ArrayList<>();

    command.add(CommandsAndParams.COMMAND_INSTALL_LOCAL);
    command.add(CommandsAndParams.PARAM_LOCATION);
    try {
        command.add(getExtension().getServerLocation());
        getLogger().info("Intstalling Server to: " + getExtension().getServerLocation() );
    } catch (Throwable e) {
        throw new TaskExecutionException(this, e);
    }


    getLogger().info("Running command " + CommandsAndParams.COMMAND_INSTALL_LOCAL + " with params. " + command.toString());
    cliRunner(command);
}
项目:Reer    文件:JacocoReport.java   
@TaskAction
public void generate() {
    Spec<File> fileExistsSpec = new Spec<File>() {
        @Override
        public boolean isSatisfiedBy(File file) {
            return file.exists();
        }
    };
    new AntJacocoReport(getAntBuilder()).execute(
        getJacocoClasspath(),
        getProject().getName(),
        getAllClassDirs().filter(fileExistsSpec),
        getAllSourceDirs().filter(fileExistsSpec),
        getExecutionData(),
        getReports()
    );
}
项目:Reer    文件:AbstractLinkTask.java   
@TaskAction
public void link() {
    SimpleStaleClassCleaner cleaner = new SimpleStaleClassCleaner(getOutputs());
    cleaner.setDestinationDir(getDestinationDir());
    cleaner.execute();

    if (getSource().isEmpty()) {
        setDidWork(false);
        return;

    }


    LinkerSpec spec = createLinkerSpec();
    spec.setTargetPlatform(getTargetPlatform());
    spec.setTempDir(getTemporaryDir());
    spec.setOutputFile(getOutputFile());

    spec.objectFiles(getSource());
    spec.libraries(getLibs());
    spec.args(getLinkerArgs());

    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    spec.setOperationLogger(operationLogger);

    Compiler<LinkerSpec> compiler = Cast.uncheckedCast(toolChain.select(targetPlatform).newCompiler(spec.getClass()));
    compiler = BuildOperationLoggingCompilerDecorator.wrap(compiler);
    WorkResult result = compiler.execute(spec);
    setDidWork(result.getDidWork());
}
项目:Reer    文件:CreateStaticLibrary.java   
@TaskAction
public void link() {

    StaticLibraryArchiverSpec spec = new DefaultStaticLibraryArchiverSpec();
    spec.setTempDir(getTemporaryDir());
    spec.setOutputFile(getOutputFile());
    spec.objectFiles(getSource());
    spec.args(getStaticLibArgs());

    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    spec.setOperationLogger(operationLogger);

    Compiler<StaticLibraryArchiverSpec> compiler = Cast.uncheckedCast(toolChain.select(targetPlatform).newCompiler(spec.getClass()));
    WorkResult result = BuildOperationLoggingCompilerDecorator.wrap(compiler).execute(spec);
    setDidWork(result.getDidWork());
}
项目:Reer    文件:ModelReport.java   
@TaskAction
public void report() {
    Project project = getProject();
    StyledTextOutput textOutput = getTextOutputFactory().create(ModelReport.class);
    ModelNodeRenderer renderer = new ModelNodeRenderer(isShowHidden(), getFormat());

    TextModelReportRenderer textModelReportRenderer = new TextModelReportRenderer(renderer);

    textModelReportRenderer.setOutput(textOutput);
    textModelReportRenderer.startProject(project);

    ModelRegistry modelRegistry = getModelRegistry();
    ModelNode rootNode = modelRegistry.realizeNode(ModelPath.ROOT);
    // Ensure binding validation has been done. This should happen elsewhere
    modelRegistry.bindAllReferences();
    textModelReportRenderer.render(rootNode);

    textModelReportRenderer.completeProject(project);
    textModelReportRenderer.complete();
}
项目:Reer    文件:DependentComponentsReport.java   
@TaskAction
public void report() {
     // Output reports per execution, not mixed.
     // Cross-project ModelRegistry operations do not happen concurrently.
    synchronized (DependentComponentsReport.class) {
        Project project = getProject();
        ModelRegistry modelRegistry = getModelRegistry();
        DependentBinariesResolver dependentBinariesResolver = modelRegistry.find("dependentBinariesResolver", DependentBinariesResolver.class);

        StyledTextOutput textOutput = getTextOutputFactory().create(DependentComponentsReport.class);
        TextDependentComponentsReportRenderer reportRenderer = new TextDependentComponentsReportRenderer(dependentBinariesResolver, showNonBuildable, showTestSuites);

        reportRenderer.setOutput(textOutput);
        reportRenderer.startProject(project);

        Set<ComponentSpec> allComponents = getAllComponents(modelRegistry);
        if (showTestSuites) {
            allComponents.addAll(getAllTestSuites(modelRegistry));
        }
        reportRenderer.renderComponents(getReportedComponents(allComponents));
        reportRenderer.renderLegend();

        reportRenderer.completeProject(project);
        reportRenderer.complete();
    }
}
项目:Reer    文件:BuildEnvironmentReportTask.java   
@TaskAction
public void generate() {
    ProjectReportGenerator projectReportGenerator = new ProjectReportGenerator() {
        @Override
        public void generateReport(Project project) throws IOException {
            Configuration configuration = getProject().getBuildscript().getConfigurations().getByName(ScriptHandler.CLASSPATH_CONFIGURATION);
            renderer.startConfiguration(configuration);
            renderer.render(configuration);
            renderer.completeConfiguration(configuration);
        }
    };

    ReportGenerator reportGenerator = new ReportGenerator(renderer, getClientMetaData(), null,
        getTextOutputFactory(), projectReportGenerator);
    reportGenerator.generateReport(Collections.singleton(getProject()));
}
项目:gretl    文件:ShpValidator.java   
@TaskAction
public void validate() {
    log = LogEnvironment.getLogger(ShpValidator.class);

    if (dataFiles==null || dataFiles.size()==0) {
        return;
    }
    List<String> files=new ArrayList<String>();
    for(Object fileObj:dataFiles) {
        String fileName=this.getProject().file(fileObj).getPath();
        files.add(fileName);
    }

    Settings settings=new Settings();
    initSettings(settings);
    if(encoding!=null) {
        settings.setValue(ShapeReader.ENCODING, encoding);
    }

    validationOk=new ShpValidatorImpl().validate(files.toArray(new String[files.size()]), settings);
    if(!validationOk && failOnError) {
        throw new TaskExecutionException(this,new Exception("validation failed"));
    }
}
项目:Reer    文件:GenerateIvyDescriptor.java   
@TaskAction
public void doGenerate() {
    IvyModuleDescriptorSpecInternal descriptorInternal = toIvyModuleDescriptorInternal(getDescriptor());

    IvyDescriptorFileGenerator ivyGenerator = new IvyDescriptorFileGenerator(descriptorInternal.getProjectIdentity());
    ivyGenerator.setStatus(descriptorInternal.getStatus());
    ivyGenerator.setBranch(descriptorInternal.getBranch());
    ivyGenerator.setExtraInfo(descriptorInternal.getExtraInfo().asMap());

    for (IvyConfiguration ivyConfiguration : descriptorInternal.getConfigurations()) {
        ivyGenerator.addConfiguration(ivyConfiguration);
    }

    for (IvyArtifact ivyArtifact : descriptorInternal.getArtifacts()) {
        ivyGenerator.addArtifact(ivyArtifact);
    }

    for (IvyDependencyInternal ivyDependency : descriptorInternal.getDependencies()) {
        ivyGenerator.addDependency(ivyDependency);
    }

    ivyGenerator.withXml(descriptorInternal.getXmlAction()).writeTo(getDestination());
}
项目:Reer    文件:GeneratorTask.java   
@SuppressWarnings("UnusedDeclaration")
@TaskAction
void generate() {
    File inputFile = getInputFileIfExists();
    if (inputFile != null) {
        try {
            domainObject = generator.read(inputFile);
        } catch (RuntimeException e) {
            throw new GradleException(String.format("Cannot parse file '%s'.\n"
                    + "       Perhaps this file was tinkered with? In that case try delete this file and then retry.",
                    inputFile), e);
        }
    } else {
        domainObject = generator.defaultInstance();
    }
    beforeConfigured.execute(domainObject);
    generator.configure(domainObject);
    afterConfigured.execute(domainObject);

    generator.write(domainObject, getOutputFile());
}
项目:Reer    文件:AbstractNativeCompileTask.java   
@TaskAction
public void compile(IncrementalTaskInputs inputs) {
    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    NativeCompileSpec spec = createCompileSpec();
    spec.setTargetPlatform(targetPlatform);
    spec.setTempDir(getTemporaryDir());
    spec.setObjectFileDir(getObjectFileDir());
    spec.include(includes);
    spec.source(getSource());
    spec.setMacros(getMacros());
    spec.args(getCompilerArgs());
    spec.setPositionIndependentCode(isPositionIndependentCode());
    spec.setIncrementalCompile(inputs.isIncremental());
    spec.setDiscoveredInputRecorder((DiscoveredInputRecorder) inputs);
    spec.setOperationLogger(operationLogger);

    configureSpec(spec);

    PlatformToolProvider platformToolProvider = toolChain.select(targetPlatform);
    setDidWork(doCompile(spec, platformToolProvider).getDidWork());
}
项目:Reer    文件:WindowsResourceCompile.java   
@TaskAction
public void compile(IncrementalTaskInputs inputs) {
    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());

    NativeCompileSpec spec = new DefaultWindowsResourceCompileSpec();
    spec.setTempDir(getTemporaryDir());
    spec.setObjectFileDir(getOutputDir());
    spec.include(getIncludes());
    spec.source(getSource());
    spec.setMacros(getMacros());
    spec.args(getCompilerArgs());
    spec.setIncrementalCompile(inputs.isIncremental());
    spec.setDiscoveredInputRecorder((DiscoveredInputRecorder) inputs);
    spec.setOperationLogger(operationLogger);

    PlatformToolProvider platformToolProvider = toolChain.select(targetPlatform);
    WorkResult result = doCompile(spec, platformToolProvider);
    setDidWork(result.getDidWork());
}
项目:Reer    文件:Assemble.java   
@TaskAction
public void assemble() {
    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    SimpleStaleClassCleaner cleaner = new SimpleStaleClassCleaner(getOutputs());
    cleaner.setDestinationDir(getObjectFileDir());
    cleaner.execute();

    DefaultAssembleSpec spec = new DefaultAssembleSpec();
    spec.setTempDir(getTemporaryDir());

    spec.setObjectFileDir(getObjectFileDir());
    spec.source(getSource());
    spec.args(getAssemblerArgs());
    spec.setOperationLogger(operationLogger);

    Compiler<AssembleSpec> compiler = toolChain.select(targetPlatform).newCompiler(AssembleSpec.class);
    WorkResult result = BuildOperationLoggingCompilerDecorator.wrap(compiler).execute(spec);
    setDidWork(result.getDidWork());
}
项目:r8    文件:DexMerger.java   
@TaskAction
void exec() {
  getProject().exec(new Action<ExecSpec>() {
    @Override
    public void execute(ExecSpec execSpec) {
      try {
        if (dexMergerExecutable == null) {
          dexMergerExecutable = Utils.dexMergerExecutable();
        }
        execSpec.setExecutable(dexMergerExecutable);
        execSpec.args(destination.getCanonicalPath());
        execSpec.args(source.getFiles());
      } catch (IOException e) {
        throw new UncheckedIOException(e);
      }
    }
  });
}
项目:neo-java-web-gradle-plugin    文件:Restart.java   
/**
 * Restarts the application in the Sap Cloud Platform account
 */

//TODO implement --synchronous and restart single process id
@TaskAction
public void start() {
    getLogger().info("Entering Restart task..");

    List<String> command;
    try {
        command = super.baseCommandlineArguments(CommandsAndParams.COMMAND_RESTART);
    } catch (Throwable e) {
        throw new TaskExecutionException(this, e);
    }


    getLogger().info("Running command " + CommandsAndParams.COMMAND_RESTART + " with params. " + command.toString());
    cliRunner(command);

}
项目:crnk-framework    文件:GenerateTypescriptTask.java   
@TaskAction
public void generate() throws IOException {
    Thread thread = Thread.currentThread();
    ClassLoader contextClassLoader = thread.getContextClassLoader();

    RuntimeClassLoaderFactory classLoaderFactory = new RuntimeClassLoaderFactory(getProject());

    TSGeneratorConfig config = getConfig();
    setupDefaultConfig(config);

    URLClassLoader classloader = classLoaderFactory.createClassLoader(contextClassLoader);
    try {
        thread.setContextClassLoader(classloader);
        runGeneration(classloader);
    }
    finally {
        // make sure to restore the classloader when leaving this task
        thread.setContextClassLoader(contextClassLoader);

        // dispose classloader
        classloader.close();
    }
}
项目:atlas    文件:PrepareAwoBundleTask.java   
@TaskAction
public void doFullTaskAction() throws IOException {

    AwbBundle awbBundle = libVariantContext.getAwbBundle();

    List<SoLibrary> soLibraries = awbBundle.getSoLibraries();
    for (final SoLibrary soLibrary : soLibraries) {
        prepare(soLibrary.getSoLibFile(), soLibrary.getFolder(), false);
    }

    List<? extends AndroidLibrary> aarBundles = awbBundle.getAndroidLibraries();
    for (final AndroidLibrary libraryDependency : aarBundles) {
        prepareLibrary(libraryDependency);
    }

    prepare(awbBundle.getAndroidLibrary().getBundle(), awbBundle.getAndroidLibrary().getFolder(), true);
}
项目:atlas    文件:AwoFullApkBuildTask.java   
@TaskAction
public void doTask() throws IOException, SigningException {

    baseApkFile = getBaseApkFile();
    destPath = getDestPath();
    awoFile = getAwoFile();
    zipAlign = getZipAlign();
    outApkFile = getOutApkFile();

    ZipUtils.addFileToZipFile(baseApkFile, outApkFile, awoFile, destPath, true);

    File signFile = new File(outApkFile.getParent(), outApkFile.getName().replace(".apk", "-signed.apk"));
    AtlasBuildContext.sBuilderAdapter.androidSigner.signFile(outApkFile, signFile, getSigningConfig());
    if (null != zipAlign && zipAlign) {
        File signAndZipAlignedFile = ZipAlignUtils.doZipAlign(androidBuilder, getProject(), signFile);
        FileUtils.deleteQuietly(outApkFile);
        FileUtils.moveFile(signAndZipAlignedFile, outApkFile);
    }

}
项目:curiostack    文件:GcloudTask.java   
@TaskAction
public void exec() {
  ImmutableGcloudExtension config =
      getProject().getRootProject().getExtensions().getByType(GcloudExtension.class);

  String command =
      config.download()
          ? new File(config.platformConfig().gcloudBinDir(), COMMAND).getAbsolutePath()
          : COMMAND;
  List<Object> fullArgs =
      ImmutableList.builder().add("--project=" + config.clusterProject()).addAll(args).build();
  getProject()
      .exec(
          exec -> {
            exec.executable(command);
            exec.args(fullArgs);
            if (config.download()) {
              exec.environment(
                  "PATH",
                  config.platformConfig().gcloudBinDir()
                      + File.pathSeparator
                      + exec.getEnvironment().get("PATH"));
            }
            exec.setStandardInput(System.in);
          });
}
项目:gretl    文件:Ili2pgReplace.java   
@TaskAction
public void replaceData()
{
    Config settings=createConfig();
    int function=Config.FC_REPLACE;
    if (dataFile==null) {
        return;
    }

    String xtfFilename=this.getProject().file(dataFile).getPath();
    if(Ili2db.isItfFilename(xtfFilename)){
        settings.setItfTransferfile(true);
    }
    settings.setXtffile(xtfFilename);

    settings.setBasketHandling(settings.BASKET_HANDLING_READWRITE);
    run(function, settings);
}
项目:atlas    文件:DiffBundleInfoTask.java   
/**
 * Generate this file
 */
@TaskAction
public void generate() throws IOException {

    dependencyDiff = getDependencyDiff();

    //If it's patch, get the diff operation
    if (null == dependencyDiff) {
        return;
    }

    try {
        appVariantOutputContext.artifactBundleInfos = getArtifactBundleInfo(getDependencyDiff(),
                                                                            getManifestFile(),
                                                                            getApDir());
        FileUtils.writeStringToFile(new File(getOutJsonFile(), "dependencyDiff.json"),
                                    JSON.toJSONString(dependencyDiff, true));
    } catch (Exception e) {
        throw new GradleException(e.getMessage());
    }
}
项目:gretl    文件:Ili2pgImportSchema.java   
@TaskAction
public void importSchema()
{
    Config settings=createConfig();
    int function=Config.FC_SCHEMAIMPORT;
    String iliFilename=null;
    if(iliFile==null) {
    }else {
        if(iliFile instanceof String && ch.ehi.basics.view.GenericFileFilter.getFileExtension((String) iliFile)==null) {
            iliFilename=(String)iliFile;
        }else {
            iliFilename=this.getProject().file(iliFile).getPath();
        }
    }
    settings.setXtffile(iliFilename);
    init(settings);
    run(function, settings);
}
项目:gretl    文件:SqlExecutor.java   
@TaskAction
public void executeSQLExecutor() {

    String taskName = this.getName();

    if (sqlFiles==null) {
        throw new GradleException("sqlFiles is null");
    }


    List<File> files = convertToFileList(sqlFiles);

    try {
        SqlExecutorStep step = new SqlExecutorStep(taskName);
        step.execute(database, files,sqlParameters);
        log.info("Task start");
    } catch (Exception e) {
        log.error("Exception in creating / invoking SqlExecutorStep.", e);

        GradleException ge = TaskUtil.toGradleException(e);
        throw ge;
    }
}
项目:gretl    文件:IliValidator.java   
@TaskAction
public void validate() {
    log = LogEnvironment.getLogger(IliValidator.class);

    if (dataFiles==null || dataFiles.size()==0) {
        return;
    }
    List<String> files=new ArrayList<String>();
    for(Object fileObj:dataFiles) {
        String fileName=this.getProject().file(fileObj).getPath();
        files.add(fileName);
    }

    Settings settings=new Settings();
    initSettings(settings);
    validationOk=new Validator().validate(files.toArray(new String[files.size()]), settings);
    if(!validationOk && failOnError) {
        throw new TaskExecutionException(this,new Exception("validation failed"));
    }
}
项目:gretl    文件:Db2Db.java   
@TaskAction
public void executeTask() throws Exception {
    String taskName = ((Task)this).getName();
    convertToAbsolutePaths(transferSets);

    log.info(String.format("Start Db2DbTask(Name: %s SourceDb: %s TargetDb: %s Transfers: %s)", taskName, sourceDb, targetDb, transferSets));

    Settings settings=new Settings();
    if(batchSize!=null) {
        settings.setValue(Db2DbStep.SETTING_BATCH_SIZE, batchSize.toString());
    }
    try {
        Db2DbStep step = new Db2DbStep(taskName);
        step.processAllTransferSets(sourceDb, targetDb, transferSets,settings,sqlParameters);
    } catch (Exception e) {
        log.error("Exception in creating / invoking Db2DbStep in Db2DbTask", e);

        GradleException gradleEx = TaskUtil.toGradleException(e);
        throw gradleEx;
    }
}
项目:Reer    文件:GenerateBuildDashboard.java   
@TaskAction
void run() {
    if (getReports().getHtml().isEnabled()) {
        BuildDashboardGenerator generator = new BuildDashboardGenerator();
        generator.render(getEnabledInputReports(), reports.getHtml().getEntryPoint());
    } else {
        setDidWork(false);
    }
}
项目:Reer    文件:PublishToMavenRepository.java   
@TaskAction
public void publish() {
    MavenPublicationInternal publicationInternal = getPublicationInternal();
    if (publicationInternal == null) {
        throw new InvalidUserDataException("The 'publication' property is required");
    }

    MavenArtifactRepository repository = getRepository();
    if (repository == null) {
        throw new InvalidUserDataException("The 'repository' property is required");
    }

    doPublish(publicationInternal, repository);
}
项目:Reer    文件:GenerateMavenPom.java   
@TaskAction
public void doGenerate() {
    MavenPomInternal pomInternal = (MavenPomInternal) getPom();

    MavenPomFileGenerator pomGenerator = new MavenPomFileGenerator(pomInternal.getProjectIdentity(), getVersionRangeMapper());
    pomGenerator.setPackaging(pomInternal.getPackaging());

    for (MavenDependencyInternal runtimeDependency : pomInternal.getRuntimeDependencies()) {
        pomGenerator.addRuntimeDependency(runtimeDependency);
    }

    pomGenerator.withXml(pomInternal.getXmlAction());

    pomGenerator.writeTo(getDestination());
}
项目:Reer    文件:CoffeeScriptCompile.java   
@TaskAction
public void doCompile() {
    RhinoWorkerHandleFactory handleFactory = new DefaultRhinoWorkerHandleFactory(getWorkerProcessBuilderFactory());

    CoffeeScriptCompileSpec spec = new DefaultCoffeeScriptCompileSpec();
    spec.setCoffeeScriptJs(getCoffeeScriptJs().getSingleFile());
    spec.setDestinationDir(getDestinationDir());
    spec.setSource(getSource());
    spec.setOptions(getOptions());

    LogLevel logLevel = getProject().getGradle().getStartParameter().getLogLevel();
    CoffeeScriptCompiler compiler = new RhinoCoffeeScriptCompiler(handleFactory, getRhinoClasspath(), logLevel, getProject().getProjectDir());

    setDidWork(compiler.compile(spec).getDidWork());
}
项目:Reer    文件:ScalaDoc.java   
@TaskAction
protected void generate() {
    ScalaDocOptions options = getScalaDocOptions();
    if (!GUtil.isTrue(options.getDocTitle())) {
        options.setDocTitle(getTitle());
    }
    AntScalaDoc antScalaDoc = new AntScalaDoc(getAntBuilder());
    antScalaDoc.execute(getSource(), getDestinationDir(), getClasspath(), getScalaClasspath(), options);
}
项目:Reer    文件:GroovyCompile.java   
@Override
@TaskAction
protected void compile() {
    checkGroovyClasspathIsNonEmpty();
    DefaultGroovyJavaJointCompileSpec spec = createSpec();
    WorkResult result = getCompiler(spec).execute(spec);
    setDidWork(result.getDidWork());
}
项目:curiostack    文件:SetupGitHooks.java   
@TaskAction
public void exec() {
  try {
    Files.write(
            Paths.get(".git", "hooks", "pre-push"), HOOK_FILE.getBytes(StandardCharsets.UTF_8))
        .toFile()
        .setExecutable(true);
  } catch (IOException e) {
    throw new UncheckedIOException("Could not write pre-push hook.", e);
  }
}
项目:Reer    文件:CompositeBuildTaskDelegate.java   
@TaskAction
public void executeTasksInOtherBuild() {
    IncludedBuilds includedBuilds = getServices().get(IncludedBuilds.class);
    IncludedBuildExecuter builder = getServices().get(IncludedBuildExecuter.class);
    IncludedBuild includedBuild = includedBuilds.getBuild(build);
    BuildIdentifier buildId = new DefaultBuildIdentifier(includedBuild.getName());
    // sourceBuild is currently always root build in a composite
    builder.execute(new DefaultBuildIdentifier(":", true), buildId, tasks);
}
项目:Reer    文件:InstallExecutable.java   
@TaskAction
public void install() {
    if (platform.getOperatingSystem().isWindows()) {
        installWindows();
    } else {
        installUnix();
    }

}
项目:Reer    文件:HtmlDependencyReportTask.java   
@TaskAction
public void generate() {
    if (!reports.getHtml().isEnabled()) {
        setDidWork(false);
        return;
    }

    HtmlDependencyReporter reporter = new HtmlDependencyReporter(getVersionSelectorScheme(), getVersionComparator());
    reporter.render(getProjects(), reports.getHtml().getDestination());

    getProject().getLogger().lifecycle("See the report at: {}", new ConsoleRenderer().asClickableFileUrl(reports.getHtml().getEntryPoint()));
}