Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openrewrite.gradle.plugins;
import lombok.EqualsAndHashCode;
import lombok.Value;
import org.jspecify.annotations.Nullable;
import org.openrewrite.*;
import org.openrewrite.gradle.DependencyVersionSelector;
import org.openrewrite.gradle.GradleParser;
import org.openrewrite.gradle.IsBuildGradle;
import org.openrewrite.gradle.IsSettingsGradle;
import org.openrewrite.gradle.marker.GradleProject;
import org.openrewrite.gradle.marker.GradleSettings;
import org.openrewrite.groovy.GroovyIsoVisitor;
import org.openrewrite.groovy.tree.G;
import org.openrewrite.internal.ListUtils;
import org.openrewrite.java.style.IntelliJ;
import org.openrewrite.java.style.TabsAndIndentsStyle;
import org.openrewrite.java.tree.J;
import org.openrewrite.java.tree.JavaSourceFile;
import org.openrewrite.marker.BuildTool;
import org.openrewrite.maven.MavenDownloadingException;
import org.openrewrite.maven.table.MavenMetadataFailures;
import org.openrewrite.maven.tree.GroupArtifact;
import org.openrewrite.semver.Semver;
import org.openrewrite.semver.VersionComparator;
import java.nio.file.Paths;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicBoolean;
import static java.util.Collections.singletonList;
@Value
@EqualsAndHashCode(callSuper = false)
public class AddDevelocityGradlePlugin extends Recipe {
transient MavenMetadataFailures metadataFailures = new MavenMetadataFailures(this);
@Option(displayName = "Plugin version",
description = "An exact version number or node-style semver selector used to select the version number. " +
"You can also use `latest.release` for the latest available version and `latest.patch` if " +
"the current version is a valid semantic version. For more details, you can look at the documentation " +
"page of [version selectors](https://docs.openrewrite.org/reference/dependency-version-selectors). " +
"Defaults to `latest.release`.",
example = "3.x",
required = false)
@Nullable
String version;
@Option(displayName = "Server URL",
description = "The URL of the Develocity server. If omitted the recipe will set no URL and Gradle will direct scans to https://scans.gradle.com/",
required = false,
example = "https://scans.gradle.com/")
@Nullable
String server;
@Option(displayName = "Allow untrusted server",
description = "When set to `true` the plugin will be configured to allow unencrypted http connections with the server. " +
"If set to `false` or omitted, the plugin will refuse to communicate without transport layer security enabled.",
required = false,
example = "true")
@Nullable
Boolean allowUntrustedServer;
@Option(displayName = "Capture task input files",
description = "When set to `true` the plugin will capture additional information about the inputs to Gradle tasks. " +
"This increases the size of build scans, but is useful for diagnosing issues with task caching. ",
required = false,
example = "true")
@Nullable
Boolean captureTaskInputFiles;
@Option(displayName = "Upload in background",
description = "When set to `true` the plugin will capture additional information about the outputs of Gradle tasks. " +
"This increases the size of build scans, but is useful for diagnosing issues with task caching. ",
required = false,
example = "true")
@Nullable
Boolean uploadInBackground;
@Option(displayName = "Publish Criteria",
description = "When set to `Always` the plugin will publish build scans of every single build. " +
"When set to `Failure` the plugin will only publish build scans when the build fails. " +
"When omitted scans will be published only when the `--scan` option is passed to the build.",
required = false,
valid = {"Always", "Failure"},
example = "Always")
@Nullable
PublishCriteria publishCriteria;
public enum PublishCriteria {
Always,
Failure
}
@Override
public String getDisplayName() {
return "Add the Develocity Gradle plugin";
}
@Override
public String getDescription() {
return "Add the Develocity Gradle plugin to settings.gradle files.";
}
@Override
public Validated