diff --git a/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/PegasusPlugin.java b/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/PegasusPlugin.java index 5a15147c2b..826e64ba23 100644 --- a/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/PegasusPlugin.java +++ b/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/PegasusPlugin.java @@ -76,7 +76,6 @@ import org.gradle.plugins.ide.eclipse.model.EclipseModel; import org.gradle.plugins.ide.idea.IdeaPlugin; import org.gradle.plugins.ide.idea.model.IdeaModule; -import org.gradle.util.GradleVersion; /** @@ -634,11 +633,6 @@ public void setJavadocJarTask(Task javadocJarTask) @Override public void apply(Project project) { - if (!isAtLeastGradle54()) - { - throw new GradleException("The pegasus plugin requires Gradle 5.4 or higher; please upgrade."); - } - project.getPlugins().apply(JavaPlugin.class); project.getPlugins().apply(IdeaPlugin.class); project.getPlugins().apply(EclipsePlugin.class); @@ -2231,8 +2225,4 @@ private Task publishPegasusSchemaSnapshot(Project project, SourceSet sourceSet, task.onlyIf(t -> !SharedFileUtils.getSuffixedFiles(project, inputDir, PDL_FILE_SUFFIX).isEmpty()); }); } - protected static boolean isAtLeastGradle54() { - return GradleVersion.current().getBaseVersion().compareTo(GradleVersion.version("5.4")) >= 0; - } - } diff --git a/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/ChangedFileReportTask.java b/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/ChangedFileReportTask.java index d3c0a55109..9683ff51d4 100644 --- a/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/ChangedFileReportTask.java +++ b/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/ChangedFileReportTask.java @@ -9,14 +9,13 @@ import com.linkedin.pegasus.gradle.IOUtil; import org.gradle.api.DefaultTask; import org.gradle.api.file.FileCollection; -import org.gradle.api.file.FileType; import org.gradle.api.file.RegularFileProperty; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.OutputFile; import org.gradle.api.tasks.SkipWhenEmpty; import org.gradle.api.tasks.TaskAction; -import org.gradle.work.InputChanges; +import org.gradle.api.tasks.incremental.IncrementalTaskInputs; public class ChangedFileReportTask extends DefaultTask @@ -28,7 +27,7 @@ public class ChangedFileReportTask extends DefaultTask private RegularFileProperty _outputFile = getProject().getObjects().fileProperty(); @TaskAction - public void checkFilesForChanges(InputChanges inputs) + public void checkFilesForChanges(IncrementalTaskInputs inputs) { getLogger().lifecycle("Checking idl and snapshot files for changes..."); getLogger().info("idlFiles: " + _idlFiles.getAsPath()); @@ -40,25 +39,25 @@ public void checkFilesForChanges(InputChanges inputs) if (inputs.isIncremental()) { - inputs.getFileChanges(getSnapshotFiles()).forEach(change -> { - if (change.getFileType() != FileType.DIRECTORY) + inputs.outOfDate(inputFileDetails -> { + if (inputFileDetails.isAdded()) { - String path = change.getFile().getAbsolutePath(); - switch (change.getChangeType()) - { - case ADDED: - filesAdded.add(path); - break; - case REMOVED: - filesRemoved.add(path); - break; - case MODIFIED: - filesChanged.add(path); - break; - } + filesAdded.add(inputFileDetails.getFile().getAbsolutePath()); + } + + if (inputFileDetails.isRemoved()) + { + filesRemoved.add(inputFileDetails.getFile().getAbsolutePath()); + } + + if (inputFileDetails.isModified()) + { + filesChanged.add(inputFileDetails.getFile().getAbsolutePath()); } }); + inputs.removed(inputFileDetails -> filesRemoved.add(inputFileDetails.getFile().getAbsolutePath())); + StringBuilder sb = new StringBuilder(); if (!filesRemoved.isEmpty()) diff --git a/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/CheckIdlTask.java b/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/CheckIdlTask.java index 8baa28065e..4f7ca496d2 100644 --- a/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/CheckIdlTask.java +++ b/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/CheckIdlTask.java @@ -17,7 +17,6 @@ import org.gradle.api.DefaultTask; import org.gradle.api.GradleException; import org.gradle.api.file.FileCollection; -import org.gradle.api.model.ReplacedBy; import org.gradle.api.tasks.CacheableTask; import org.gradle.api.tasks.Classpath; import org.gradle.api.tasks.Input; @@ -167,108 +166,18 @@ public void setSummaryTarget(File summaryTarget) _summaryTarget = summaryTarget; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isModelCompatible()} instead - */ - @Deprecated - @ReplacedBy("modelCompatible") - public boolean getIsModelCompatible() - { - return isModelCompatible(); - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isModelCompatible()} instead - */ - @Deprecated - @ReplacedBy("modelCompatible") - public boolean isIsModelCompatible() - { - return isModelCompatible(); - } - @Internal public boolean isModelCompatible() { return _modelCompatible; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestSpecCompatible()} instead - */ - @Deprecated - @ReplacedBy("restSpecCompatible") - public boolean getIsRestSpecCompatible() - { - return isRestSpecCompatible(); - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestSpecCompatible()} instead - */ - @Deprecated - @ReplacedBy("restSpecCompatible") - public boolean isIsRestSpecCompatible() - { - return isRestSpecCompatible(); - } - @Internal public boolean isRestSpecCompatible() { return _restSpecCompatible; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isEquivalent()} instead - */ - @Deprecated - @ReplacedBy("equivalent") - public boolean getIsEquivalent() - { - return _equivalent; - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isEquivalent()} instead - */ - @Deprecated - @ReplacedBy("equivalent") - public boolean isIsEquivalent() - { - return _equivalent; - } - @Internal public boolean isEquivalent() { diff --git a/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/CheckRestModelTask.java b/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/CheckRestModelTask.java index 8e800f9e22..db2ed57b70 100644 --- a/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/CheckRestModelTask.java +++ b/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/CheckRestModelTask.java @@ -29,7 +29,6 @@ import org.gradle.api.DefaultTask; import org.gradle.api.GradleException; import org.gradle.api.file.FileCollection; -import org.gradle.api.model.ReplacedBy; import org.gradle.api.tasks.CacheableTask; import org.gradle.api.tasks.Classpath; import org.gradle.api.tasks.Input; @@ -202,144 +201,24 @@ public void setSummaryTarget(File summaryTarget) _summaryTarget = summaryTarget; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isModelCompatible()} instead - */ - @Deprecated - @ReplacedBy("modelCompatible") - public boolean getIsModelCompatible() - { - return isModelCompatible(); - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isModelCompatible()} instead - */ - @Deprecated - @ReplacedBy("modelCompatible") - public boolean isIsModelCompatible() - { - return isModelCompatible(); - } - @Internal public boolean isModelCompatible() { return _modelCompatible; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestSpecCompatible()} instead - */ - @Deprecated - @ReplacedBy("restSpecCompatible") - public boolean getIsRestSpecCompatible() - { - return isRestSpecCompatible(); - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestSpecCompatible()} instead - */ - @Deprecated - @ReplacedBy("restSpecCompatible") - public boolean isIsRestSpecCompatible() - { - return isRestSpecCompatible(); - } - @Internal public boolean isRestSpecCompatible() { return _restSpecCompatible; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isEquivalent()} instead - */ - @Deprecated - @ReplacedBy("equivalent") - public boolean getIsEquivalent() - { - return isEquivalent(); - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isEquivalent()} instead - */ - @Deprecated - @ReplacedBy("equivalent") - public boolean isIsEquivalent() - { - return isEquivalent(); - } - @Internal public boolean isEquivalent() { return _equivalent; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestSpecEquivalent()} instead - */ - @Deprecated - @ReplacedBy("restSpecEquivalent") - public boolean getIsRestSpecEquivalent() - { - return isRestSpecEquivalent(); - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestSpecEquivalent()} instead - */ - @Deprecated - @ReplacedBy("restSpecEquivalent") - public boolean isIsRestSpecEquivalent() - { - return isRestSpecEquivalent(); - } - @Internal public boolean isRestSpecEquivalent() { diff --git a/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/CheckSnapshotTask.java b/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/CheckSnapshotTask.java index c61ea77172..52c333f678 100644 --- a/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/CheckSnapshotTask.java +++ b/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/CheckSnapshotTask.java @@ -13,7 +13,6 @@ import org.gradle.api.GradleException; import org.gradle.api.Project; import org.gradle.api.file.FileCollection; -import org.gradle.api.model.ReplacedBy; import org.gradle.api.tasks.CacheableTask; import org.gradle.api.tasks.Classpath; import org.gradle.api.tasks.Input; @@ -150,144 +149,24 @@ public void setSummaryTarget(File summaryTarget) _summaryTarget = summaryTarget; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isModelCompatible()} instead - */ - @Deprecated - @ReplacedBy("modelCompatible") - public boolean getIsModelCompatible() - { - return isModelCompatible(); - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isModelCompatible()} instead - */ - @Deprecated - @ReplacedBy("modelCompatible") - public boolean isIsModelCompatible() - { - return isModelCompatible(); - } - @Internal public boolean isModelCompatible() { return _modelCompatible; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestSpecCompatible()} instead - */ - @Deprecated - @ReplacedBy("restSpecCompatible") - public boolean getIsRestSpecCompatible() - { - return isRestSpecCompatible(); - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestSpecCompatible()} instead - */ - @Deprecated - @ReplacedBy("restSpecCompatible") - public boolean isIsRestSpecCompatible() - { - return isRestSpecCompatible(); - } - @Internal public boolean isRestSpecCompatible() { return _restSpecCompatible; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isEquivalent()} instead - */ - @Deprecated - @ReplacedBy("equivalent") - public boolean getIsEquivalent() - { - return isEquivalent(); - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isEquivalent()} instead - */ - @Deprecated - @ReplacedBy("equivalent") - public boolean isIsEquivalent() - { - return isEquivalent(); - } - @Internal public boolean isEquivalent() { return _equivalent; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestSpecEquivalent()} instead - */ - @Deprecated - @ReplacedBy("restSpecEquivalent") - public boolean getIsRestSpecEquivalent() - { - return isRestSpecEquivalent(); - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestSpecEquivalent()} instead - */ - @Deprecated - @ReplacedBy("restSpecEquivalent") - public boolean isIsRestSpecEquivalent() - { - return isRestSpecEquivalent(); - } - @Internal public boolean isRestSpecEquivalent() { diff --git a/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/GenerateRestClientTask.java b/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/GenerateRestClientTask.java index 94046eab59..bf79dd60f5 100644 --- a/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/GenerateRestClientTask.java +++ b/gradle-plugins/src/main/java/com/linkedin/pegasus/gradle/tasks/GenerateRestClientTask.java @@ -15,7 +15,6 @@ import org.gradle.api.DefaultTask; import org.gradle.api.GradleException; import org.gradle.api.file.FileCollection; -import org.gradle.api.model.ReplacedBy; import org.gradle.api.tasks.CacheableTask; import org.gradle.api.tasks.Classpath; import org.gradle.api.tasks.Input; @@ -327,36 +326,6 @@ public void setDestinationDir(File destinationDir) _destinationDir = destinationDir; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestli2FormatSuppressed()} instead - */ - @Deprecated - @ReplacedBy("restli2FormatSuppressed") - public boolean getIsRestli2FormatSuppressed() - { - return isRestli2FormatSuppressed(); - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestli2FormatSuppressed()} instead - */ - @Deprecated - @ReplacedBy("restli2FormatSuppressed") - public boolean isIsRestli2FormatSuppressed() - { - return isRestli2FormatSuppressed(); - } - @Internal public boolean isRestli2FormatSuppressed() { @@ -404,36 +373,6 @@ public void setGenerateFluentApi(boolean generateFluentApi) _generateFluentApi = generateFluentApi; } - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestli1BuildersDeprecated()} instead - */ - @Deprecated - @ReplacedBy("restli1BuildersDeprecated") - public boolean get_isRestli1BuildersDeprecated() - { - return isRestli1BuildersDeprecated(); - } - - /** - * This method is kept for backwards compatibility. - *
- * A Groovy property with this name was exposed, which leads to this lengthy - * getter name. In Java, boolean fields are named without the "is" prefix. - * - * @deprecated use {@link #isRestli1BuildersDeprecated()} instead - */ - @Deprecated - @ReplacedBy("restli1BuildersDeprecated") - public boolean is_isRestli1BuildersDeprecated() - { - return isRestli1BuildersDeprecated(); - } - @Internal public boolean isRestli1BuildersDeprecated() {