Skip to content

Commit

Permalink
Remove deprecated methods; avoids Gradle version bump [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
DPUkyle committed Apr 2, 2021
1 parent b99cd12 commit c41fd44
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 422 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;


/**
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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());
Expand All @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -167,108 +166,18 @@ public void setSummaryTarget(File summaryTarget)
_summaryTarget = summaryTarget;
}

/**
* This method is kept for backwards compatibility.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -202,144 +201,24 @@ public void setSummaryTarget(File summaryTarget)
_summaryTarget = summaryTarget;
}

/**
* This method is kept for backwards compatibility.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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()
{
Expand Down
Loading

0 comments on commit c41fd44

Please sign in to comment.