org.gradle.api.logging.Logger.lifecycle()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(320)

本文整理了Java中org.gradle.api.logging.Logger.lifecycle()方法的一些代码示例,展示了Logger.lifecycle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.lifecycle()方法的具体详情如下:
包路径:org.gradle.api.logging.Logger
类名称:Logger
方法名:lifecycle

Logger.lifecycle介绍

[英]Logs the given message at lifecycle log level.
[中]在生命周期日志级别记录给定消息。

代码示例

代码示例来源:origin: linkedin/rest.li

@Override
public void write(int b)
  throws IOException
{
 wholeTextBuilder.append((char) b);
 if (b == '\n')
 {
  LOG.lifecycle("[checker] {}", lineTextBuilder.toString());
  processLine(lineTextBuilder.toString());
  lineTextBuilder = new StringBuilder();
 }
 else
 {
  lineTextBuilder.append((char) b);
 }
}

代码示例来源:origin: linkedin/rest.li

@TaskAction
public void checkFilesForChanges(IncrementalTaskInputs inputs)
 getLogger().lifecycle("Checking idl and snapshot files for changes...");
 getLogger().info("idlFiles: " + idlFiles.getAsPath());
 getLogger().info("snapshotFiles: " + snapshotFiles.getAsPath());
   getLogger().lifecycle(
     "The following files have been removed, be sure to remove them from source control: {}", files);
   getLogger().lifecycle("The following files have been added, be sure to add them to source control: {}", files);
   getLogger().lifecycle(
     "The following files have been changed, be sure to commit the changes to source control: {}", files);

代码示例来源:origin: org.shipkit/shipkit

@Override
  public void execute(Task task) {
    LOG.lifecycle(supplier.get());
  }
});

代码示例来源:origin: org.shipkit/shipkit

void updateReleaseNotes(boolean previewMode, File releaseNotesFile, String newContent) {
  if (previewMode) {
    LOG.lifecycle("  Preview of release notes update:\n" +
      "  ----------------\n" + newContent + "----------------");
  } else {
    FileUtil.appendToTop(newContent, releaseNotesFile);
    LOG.lifecycle("  Successfully updated release notes!");
  }
}

代码示例来源:origin: gradle.plugin.org.shipkit/shipkit

@TaskAction public void initShipkitConfigFile(){
  if(configFile.exists()){
    LOG.lifecycle("  Shipkit configuration already exists, nothing to do. Configuration file: {}", configFile.getPath());
  } else{
    createShipKitConfigFile();
    LOG.lifecycle("  Shipkit configuration created at {}!\n" +
        "  You can modify it manually. Remember to check it into VCS!", configFile.getPath());
  }
}

代码示例来源:origin: gradle.plugin.org.shipkit/shipkit

private void downloadRemoteFile(String remoteUrl, File localFile) {
  LOG.lifecycle("Downloading remote artifact\n" +
      "  - from {}\n" +
      "  - and saving it to {}", remoteUrl, localFile);
  IOUtil.downloadToFile(remoteUrl, localFile);
}

代码示例来源:origin: gradle.plugin.com.linkedin.pygradle/pygradle-plugin

@TaskAction
  public void createSetupPy() throws IOException {
    File file = getProject().file("setup.py");
    if (file.exists()) {
      logger.lifecycle("Contents of setup.py are going to be overwritten!!");
      file.delete();
    }
    file.createNewFile();

    String setupPy = IOUtils.toString(GenerateSetupPyTask.class.getResourceAsStream("/templates/setup.py.template"));
    FileUtils.write(file, setupPy);
  }
}

代码示例来源:origin: gradle.plugin.org.shipkit/shipkit

private String determineVersion(Project project){
  if("unspecified".equals(project.getVersion()) ){
    LOG.lifecycle("  BEWARE! 'project.version' is unspecified. Version will be set to '{}'. You can change it in '{}'.",
        FALLBACK_INITIAL_VERSION, versionFile.getName());
    return FALLBACK_INITIAL_VERSION;
  } else{
    LOG.lifecycle("  Initial project version in '{}' set to '{}' (taken from 'project.version' property).",
        versionFile.getName(), project.getVersion());
    return project.getVersion().toString();
  }
}

代码示例来源:origin: gradle.plugin.org.shipkit/shipkit

static void setPushUrl(GitPushTask pushTask, String writeTokenEnvValue, String ghUser, String ghRepo, String writeToken) {
  if (writeToken != null) {
    String url = MessageFormat.format("https://{0}:{1}@github.com/{2}.git", ghUser, writeTokenEnvValue, ghRepo);
    pushTask.setUrl(url);
    pushTask.setSecretValue(writeToken);
  } else {
    LOG.lifecycle("  'git push' does not use GitHub write token because it was not specified.");
    String url = MessageFormat.format("https://github.com/{0}.git", ghRepo);
    pushTask.setUrl(url);
  }
}

代码示例来源:origin: org.shipkit/shipkit

@TaskAction
public void cloneRepository() {
  if (!isTargetEmpty()) {
    LOG.lifecycle("{} - target directory already exists and is not empty. Skipping execution of the task. Exists: {}", getPath(), targetDir);
    return;
  }
  LOG.lifecycle("  Cloning repository {}\n    into {}", repositoryUrl, targetDir);
  getProject().getBuildDir().mkdirs();    // build dir can be not created yet
  ProcessRunner processRunner = Exec.getProcessRunner(getProject().getBuildDir());
  processRunner.run(getCloneCommand());
}

代码示例来源:origin: org.shipkit/shipkit

private String determineVersion(Project project, File versionFile) {
    if ("unspecified".equals(project.getVersion())) {
      LOG.info("'project.version' is unspecified. Version will be set to '{}'. You can change it in '{}'.",
        FALLBACK_INITIAL_VERSION, versionFile.getName());
      return FALLBACK_INITIAL_VERSION;
    } else {
      LOG.lifecycle("  Configured '{}' version in '{}' file. Please remove 'version={}' setting from *.gradle file.",
        project.getVersion(), versionFile.getName(), project.getVersion());
      return project.getVersion().toString();
    }
  }
}

代码示例来源:origin: gradle.plugin.org.shipkit/shipkit

@TaskAction
  public void fetchContributors() {
    LOG.lifecycle("  Fetching all contributors for project");

    GitHubContributorsProvider contributorsProvider = Contributors.getGitHubContributorsProvider(apiUrl, repository, readOnlyAuthToken);
    ProjectContributorsSet contributors = contributorsProvider.getAllContributorsForProject();

    AllContributorsSerializer serializer = new AllContributorsSerializer();
    final String json = serializer.serialize(contributors);
    IOUtil.writeFile(outputFile, json);

    LOG.lifecycle("  Serialized all contributors into: {}", getProject().relativePath(outputFile));
  }
}

代码示例来源:origin: gradle.plugin.de.heinrichmarkus.gradle/dbp

@TaskAction
public void compile() {
  if (!msbuildConfiguration.getItems().isEmpty()) {
    getLogger().lifecycle("Compiling with BDS " + bds.get());
    for (MsbuildItem p : msbuildConfiguration.getItems()) {
      getLogger().lifecycle(String.format("\t- %s", p.toString()));
      compileProject(p);
    }
  } else {
    getLogger().warn("Nothing to compile! Add project files to project.dproj property.");
  }
}

代码示例来源:origin: gradle.plugin.de.heinrichmarkus.gradle/dbp

@TaskAction
public void check() {
  checkProjectFiles();
  checkBinDirectory();
  checkBdsVersion();
  getLogger().lifecycle("Configuration verified successfully");
}

代码示例来源:origin: linkedin/pygradle

public void execute(PackageInfo packageInfo, List<String> extraArgs) {
  if (packageExcludeFilter != null && packageExcludeFilter.isSatisfiedBy(packageInfo)) {
    if (PythonHelpers.isPlainOrVerbose(project)) {
      getLogger().lifecycle("Skipping {} - Excluded", packageInfo.toShortHand());
    }
    return;
  }
  doPipOperation(packageInfo, extraArgs);
}

代码示例来源:origin: gradle.plugin.com.linkedin.pygradle/pygradle-plugin

public void execute(PackageInfo packageInfo, List<String> extraArgs) {
  if (packageExcludeFilter != null && packageExcludeFilter.isSatisfiedBy(packageInfo)) {
    if (PythonHelpers.isPlainOrVerbose(project)) {
      getLogger().lifecycle("Skipping {} - Excluded", packageInfo.toShortHand());
    }
    return;
  }
  doPipOperation(packageInfo, extraArgs);
}

代码示例来源:origin: classmethod/gradle-aws-plugin

public String getAccountId() {
  try {
    AWSSecurityTokenService sts = createClient(AWSSecurityTokenServiceClient.class, profileName);
    sts.setRegion(getActiveRegion(region));
    return sts.getCallerIdentity(new GetCallerIdentityRequest()).getAccount();
  } catch (SdkClientException e) {
    project.getLogger().lifecycle("AWS credentials not configured!");
    return null;
  }
  
}

代码示例来源:origin: gradle.plugin.com.github.pivotalservices/ya-cf-app-gradle-plugin

public Mono<Void> scaleInstances(CloudFoundryOperations cfOperations,
                 CfProperties cfProperties, int instanceCount) {
  Mono<Void> resp = cfOperations.applications().scale(
    ScaleApplicationRequest.builder()
      .instances(instanceCount)
      .build()
  ).doOnSubscribe((s) -> {
    LOGGER.lifecycle("Scaling app {} to instance count {}", cfProperties.name(), instanceCount);
  });
  return resp;
}

代码示例来源:origin: gradle.plugin.com.github.kaklakariada.aws/aws-sam-gradle

public void waitForStatus(WaitCondition condition) {
  new Poller(waitingDuration -> {
    final String status = condition.getStatus();
    logger.lifecycle("Got status {} after {}", status, waitingDuration);
    if (condition.isFailure(status)) {
      throw new DeploymentException("Got failure status " + status + ": " + condition.getFailureMessage());
    }
    return condition.isSuccess(status);
  }).waitUntilFinished();
}

代码示例来源:origin: com.github.rodm/gradle-teamcity-dsl-plugin

@Override
public void execute(JavaExecSpec spec) {
  getLogger().lifecycle(CONFIG_MESSAGE, getFormat(), formatPath(getBaseDir()), formatPath(getDestDir()));
  getLogger().info("Using main class {}", getMainClass());
  Configuration configuration = getProject().getConfigurations().getAt(CONFIGURATION_NAME);
  String toolPath = configuration.getAsPath();
  spec.setIgnoreExitValue(true);
  spec.setClasspath(createToolClasspath(configuration));
  spec.setMain(getMainClass());
  spec.args(getFormat(), getBaseDir().getAbsolutePath(), getDestDir().getAbsolutePath(), toolPath);
}

相关文章