Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
Fix compatibility with Gradle < 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
erdi committed Apr 4, 2023
1 parent c165119 commit 5ede65a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class GradleCompatibility {
private static final Object[] NO_ARGUMENTS = {};

static <T> T createExtensionWithObjectFactory(Project project, String extensionName, Class<T> extensionType) {
if (GradleFeatures.extensionInjection.isSupported()) {
if (GradleFeatures.projectIntoExtensionInjection.isSupported()) {
return project.getExtensions().create(extensionName, extensionType);
} else {
return project.getExtensions().create(extensionName, extensionType, project, project.getObjects());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
import org.gradle.util.GradleVersion;

enum GradleFeatures {
extensionInjection() {
@Override
projectIntoExtensionInjection() {
boolean isSupportedBy(GradleVersion version) {
return version.compareTo(GradleVersions.v5_2) >= 0;
return version.compareTo(GradleVersions.v7_1) >= 0;
}
},
objectFactoryFileCollection() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import org.gradle.util.GradleVersion;

class GradleVersions {
static final GradleVersion v5_2 = GradleVersion.version("5.2");
static final GradleVersion v5_3 = GradleVersion.version("5.3");
static final GradleVersion v6_0 = GradleVersion.version("6.0");
static final GradleVersion v6_6 = GradleVersion.version("6.6");
static final GradleVersion v7_1 = GradleVersion.version("7.1");
static final GradleVersion v7_4 = GradleVersion.version("7.4");
}

0 comments on commit 5ede65a

Please sign in to comment.