Search in sources :

Example 1 with VersionMatcher

use of org.jetbrains.plugins.gradle.tooling.util.VersionMatcher in project intellij-community by JetBrains.

the class VersionMatcherRule method starting.

@Override
protected void starting(Description d) {
    final TargetVersions targetVersions = d.getAnnotation(TargetVersions.class);
    if (targetVersions == null)
        return;
    myMatcher = new CustomMatcher<String>("Gradle version '" + targetVersions.value() + "'") {

        @Override
        public boolean matches(Object item) {
            return item instanceof String && new VersionMatcher(GradleVersion.version(item.toString())).isVersionMatch(targetVersions);
        }
    };
}
Also used : TargetVersions(org.jetbrains.plugins.gradle.tooling.annotation.TargetVersions) VersionMatcher(org.jetbrains.plugins.gradle.tooling.util.VersionMatcher)

Example 2 with VersionMatcher

use of org.jetbrains.plugins.gradle.tooling.util.VersionMatcher in project kotlin by JetBrains.

the class VersionMatcherRule method starting.

@Override
protected void starting(Description d) {
    final TargetVersions targetVersions = d.getAnnotation(TargetVersions.class);
    if (targetVersions == null)
        return;
    myMatcher = new CustomMatcher<String>("Gradle version '" + targetVersions.value() + "'") {

        @Override
        public boolean matches(Object item) {
            return item instanceof String && new VersionMatcher(GradleVersion.version(item.toString())).isVersionMatch(targetVersions);
        }
    };
}
Also used : TargetVersions(org.jetbrains.plugins.gradle.tooling.annotation.TargetVersions) VersionMatcher(org.jetbrains.plugins.gradle.tooling.util.VersionMatcher)

Aggregations

TargetVersions (org.jetbrains.plugins.gradle.tooling.annotation.TargetVersions)2 VersionMatcher (org.jetbrains.plugins.gradle.tooling.util.VersionMatcher)2