-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try to fix some issues with resolving source roots
- Loading branch information
Showing
8 changed files
with
321 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
...sion-api/src/main/java/org/jetbrains/plugins/gradle/tooling/model/ExtIdeaContentRoot.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
...ension-api/src/main/java/org/jetbrains/plugins/gradle/tooling/util/GradleVersionUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. | ||
package org.jetbrains.plugins.gradle.tooling.util; | ||
|
||
import org.gradle.util.GradleVersion; | ||
|
||
public final class GradleVersionUtil { | ||
|
||
private static final GradleVersion currentGradleVersion = GradleVersion.current().getBaseVersion(); | ||
|
||
public static boolean isCurrentGradleAtLeast(String version) { | ||
return currentGradleVersion.compareTo(GradleVersion.version(version)) >= 0; | ||
} | ||
|
||
public static boolean isGradleAtLeast(GradleVersion actualVersion, String version) { | ||
return actualVersion.getBaseVersion().compareTo(GradleVersion.version(version)) >= 0; | ||
} | ||
|
||
public static boolean isGradleAtLeast(String actualVersion, String version) { | ||
return isGradleAtLeast(GradleVersion.version(actualVersion), version); | ||
} | ||
|
||
public static boolean isCurrentGradleOlderThan(String version) { | ||
return !isCurrentGradleAtLeast(version); | ||
} | ||
|
||
public static boolean isGradleOlderThan(GradleVersion actualVersion, String version) { | ||
return !isGradleAtLeast(actualVersion, version); | ||
} | ||
|
||
public static boolean isGradleOlderThan(String actualVersion, String version) { | ||
return !isGradleAtLeast(actualVersion, version); | ||
} | ||
|
||
/** | ||
* @see GradleVersionUtil#isGradleAtLeast | ||
* @see GradleVersionUtil#isCurrentGradleAtLeast | ||
* @deprecated Gradle version comparisons '>' and '<=' aren't logical. | ||
* Changes can be made only in the specific version and present in the future. | ||
* We always can identify the version where new changes were made. | ||
*/ | ||
@Deprecated | ||
@SuppressWarnings("DeprecatedIsStillUsed") | ||
public static boolean isCurrentGradleNewerThan(String version) { | ||
return currentGradleVersion.compareTo(GradleVersion.version(version)) > 0; | ||
} | ||
|
||
/** | ||
* @deprecated See {@link GradleVersionUtil#isCurrentGradleNewerThan} for details | ||
*/ | ||
@Deprecated | ||
@SuppressWarnings("DeprecatedIsStillUsed") | ||
public static boolean isGradleNewerThan(GradleVersion actualVersion, String version) { | ||
return actualVersion.getBaseVersion().compareTo(GradleVersion.version(version)) > 0; | ||
} | ||
|
||
/** | ||
* @deprecated See {@link GradleVersionUtil#isCurrentGradleNewerThan} for details | ||
*/ | ||
@Deprecated | ||
@SuppressWarnings("DeprecatedIsStillUsed") | ||
public static boolean isGradleNewerThan(String actualVersion, String version) { | ||
return isGradleNewerThan(GradleVersion.version(actualVersion), version); | ||
} | ||
|
||
/** | ||
* @deprecated See {@link GradleVersionUtil#isCurrentGradleNewerThan} for details | ||
*/ | ||
@Deprecated | ||
@SuppressWarnings("DeprecatedIsStillUsed") | ||
public static boolean isCurrentGradleOlderOrSameAs(String version) { | ||
return !isCurrentGradleNewerThan(version); | ||
} | ||
|
||
/** | ||
* @deprecated See {@link GradleVersionUtil#isCurrentGradleNewerThan} for details | ||
*/ | ||
@Deprecated | ||
@SuppressWarnings("DeprecatedIsStillUsed") | ||
public static boolean isGradleOlderOrSameAs(GradleVersion actualVersion, String version) { | ||
return !isGradleNewerThan(actualVersion, version); | ||
} | ||
|
||
/** | ||
* @deprecated See {@link GradleVersionUtil#isCurrentGradleNewerThan} for details | ||
*/ | ||
@Deprecated | ||
@SuppressWarnings("DeprecatedIsStillUsed") | ||
public static boolean isGradleOlderOrSameAs(String actualVersion, String version) { | ||
return !isGradleNewerThan(actualVersion, version); | ||
} | ||
} |
Oops, something went wrong.