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

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

本文整理了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

  1. @Override
  2. public void write(int b)
  3. throws IOException
  4. {
  5. wholeTextBuilder.append((char) b);
  6. if (b == '\n')
  7. {
  8. LOG.lifecycle("[checker] {}", lineTextBuilder.toString());
  9. processLine(lineTextBuilder.toString());
  10. lineTextBuilder = new StringBuilder();
  11. }
  12. else
  13. {
  14. lineTextBuilder.append((char) b);
  15. }
  16. }

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

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

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

  1. @Override
  2. public void execute(Task task) {
  3. LOG.lifecycle(supplier.get());
  4. }
  5. });

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

  1. void updateReleaseNotes(boolean previewMode, File releaseNotesFile, String newContent) {
  2. if (previewMode) {
  3. LOG.lifecycle(" Preview of release notes update:\n" +
  4. " ----------------\n" + newContent + "----------------");
  5. } else {
  6. FileUtil.appendToTop(newContent, releaseNotesFile);
  7. LOG.lifecycle(" Successfully updated release notes!");
  8. }
  9. }

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

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

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

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

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

  1. @TaskAction
  2. public void createSetupPy() throws IOException {
  3. File file = getProject().file("setup.py");
  4. if (file.exists()) {
  5. logger.lifecycle("Contents of setup.py are going to be overwritten!!");
  6. file.delete();
  7. }
  8. file.createNewFile();
  9. String setupPy = IOUtils.toString(GenerateSetupPyTask.class.getResourceAsStream("/templates/setup.py.template"));
  10. FileUtils.write(file, setupPy);
  11. }
  12. }

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

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

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

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

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

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

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

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

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

  1. @TaskAction
  2. public void fetchContributors() {
  3. LOG.lifecycle(" Fetching all contributors for project");
  4. GitHubContributorsProvider contributorsProvider = Contributors.getGitHubContributorsProvider(apiUrl, repository, readOnlyAuthToken);
  5. ProjectContributorsSet contributors = contributorsProvider.getAllContributorsForProject();
  6. AllContributorsSerializer serializer = new AllContributorsSerializer();
  7. final String json = serializer.serialize(contributors);
  8. IOUtil.writeFile(outputFile, json);
  9. LOG.lifecycle(" Serialized all contributors into: {}", getProject().relativePath(outputFile));
  10. }
  11. }

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

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

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

  1. @TaskAction
  2. public void check() {
  3. checkProjectFiles();
  4. checkBinDirectory();
  5. checkBdsVersion();
  6. getLogger().lifecycle("Configuration verified successfully");
  7. }

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

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

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

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

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

  1. public String getAccountId() {
  2. try {
  3. AWSSecurityTokenService sts = createClient(AWSSecurityTokenServiceClient.class, profileName);
  4. sts.setRegion(getActiveRegion(region));
  5. return sts.getCallerIdentity(new GetCallerIdentityRequest()).getAccount();
  6. } catch (SdkClientException e) {
  7. project.getLogger().lifecycle("AWS credentials not configured!");
  8. return null;
  9. }
  10. }

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

  1. public Mono<Void> scaleInstances(CloudFoundryOperations cfOperations,
  2. CfProperties cfProperties, int instanceCount) {
  3. Mono<Void> resp = cfOperations.applications().scale(
  4. ScaleApplicationRequest.builder()
  5. .instances(instanceCount)
  6. .build()
  7. ).doOnSubscribe((s) -> {
  8. LOGGER.lifecycle("Scaling app {} to instance count {}", cfProperties.name(), instanceCount);
  9. });
  10. return resp;
  11. }

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

  1. public void waitForStatus(WaitCondition condition) {
  2. new Poller(waitingDuration -> {
  3. final String status = condition.getStatus();
  4. logger.lifecycle("Got status {} after {}", status, waitingDuration);
  5. if (condition.isFailure(status)) {
  6. throw new DeploymentException("Got failure status " + status + ": " + condition.getFailureMessage());
  7. }
  8. return condition.isSuccess(status);
  9. }).waitUntilFinished();
  10. }

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

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

相关文章