当前位置: 首页>>代码示例>>Java>>正文


Java GradleVersion.version方法代码示例

本文整理汇总了Java中org.gradle.util.GradleVersion.version方法的典型用法代码示例。如果您正苦于以下问题:Java GradleVersion.version方法的具体用法?Java GradleVersion.version怎么用?Java GradleVersion.version使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gradle.util.GradleVersion的用法示例。


在下文中一共展示了GradleVersion.version方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSupported

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
public List<GradleDistribution> getSupported() {
    final GradleVersion firstSupported = GradleVersion.version("1.0");
    return CollectionUtils.filter(getAll(), new Spec<GradleDistribution>() {
        @Override
        public boolean isSatisfiedBy(GradleDistribution element) {
            return element.getVersion().compareTo(firstSupported) >= 0;
        }
    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:ReleasedVersionDistributions.java

示例2: configure

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
/**
 * This is used by consumers 1.2-rc-1 and later.
 */
public void configure(ConnectionParameters parameters) {
    UnsupportedJavaRuntimeException.assertUsingVersion("Gradle", JavaVersion.VERSION_1_7);
    ProviderConnectionParameters providerConnectionParameters = new ProtocolToModelAdapter().adapt(ProviderConnectionParameters.class, parameters);
    File gradleUserHomeDir = providerConnectionParameters.getGradleUserHomeDir(null);
    if (gradleUserHomeDir == null) {
        gradleUserHomeDir = new BuildLayoutParameters().getGradleUserHomeDir();
    }
    initializeServices(gradleUserHomeDir);
    connection.configure(providerConnectionParameters);
    consumerVersion = GradleVersion.version(providerConnectionParameters.getConsumerVersion());
    supportedConsumerVersion = consumerVersion.compareTo(MIN_CLIENT_VERSION) >= 0;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:16,代码来源:DefaultConnection.java

示例3: setGradleVersion

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
public void setGradleVersion(String gradleVersion) {
    if (gradleVersion == null) {
        throw new IllegalArgumentException("gradleVersion cannot be null");
    }
    GradleVersion version = GradleVersion.version(gradleVersion);
    this.gradleVersion = version.getVersion();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultGradleBuildInvocationSpec.java

示例4: resolveGradleVersion

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
protected GradleVersion resolveGradleVersion(String version) {
    GradleVersion gradleVersion = gradleVersionCache.get(version);
    if (gradleVersion == null) {
        gradleVersion = GradleVersion.version(version);
        gradleVersionCache.put(version, gradleVersion);
    }
    return gradleVersion;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:CrossVersionResultsStore.java

示例5: checkMinimumGradleVersion

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
static void checkMinimumGradleVersion() throws IOException {
    GradleVersion gradleVersionMinimum = GradleVersion.version("2.14.1");
    GradleVersion gradleVersionCurrent = GradleVersion.current();
    if (gradleVersionCurrent.compareTo(gradleVersionMinimum) > 0) {
        throw new IOException("Execution on older Gradle version ("+gradleVersionCurrent.getVersion()+
                ") than is defined as the minimum ("+gradleVersionMinimum.getVersion()+")");
    }
}
 
开发者ID:ctco,项目名称:gradle-mobile-plugin,代码行数:9,代码来源:MobilePluginUtil.java

示例6: getGradleVersion

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
@Nullable
public static GradleVersion getGradleVersion(@NotNull ProjectConnection connection) {
  final BuildEnvironment buildEnvironment = getBuildEnvironment(connection);

  GradleVersion gradleVersion = null;
  if (buildEnvironment != null) {
    gradleVersion = GradleVersion.version(buildEnvironment.getGradle().getGradleVersion());
  }
  return gradleVersion;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:GradleExecutionHelper.java

示例7: attachGradleSdkSources

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
private void attachGradleSdkSources(@NotNull IdeaModule gradleModule,
                                    @NotNull final String libName,
                                    @Nullable final File libFile,
                                    LibraryData library) {
  if (libFile == null || !libName.startsWith("gradle-")) return;

  final BuildScriptClasspathModel buildScriptClasspathModel =
    resolverCtx.getExtraProject(gradleModule, BuildScriptClasspathModel.class);
  if (buildScriptClasspathModel == null) return;
  final File gradleHomeDir = buildScriptClasspathModel.getGradleHomeDir();
  if (gradleHomeDir == null) return;

  if (!FileUtil.isAncestor(gradleHomeDir, libFile, true)) return;

  File libOrPluginsFile = libFile.getParentFile();
  if (libOrPluginsFile != null && ("plugins".equals(libOrPluginsFile.getName()))) {
    libOrPluginsFile = libOrPluginsFile.getParentFile();
  }

  if (libOrPluginsFile != null && "lib".equals(libOrPluginsFile.getName()) && libOrPluginsFile.getParentFile() != null) {
    File srcDir = new File(libOrPluginsFile.getParentFile(), "src");

    GradleVersion current = GradleVersion.version(buildScriptClasspathModel.getGradleVersion());
    if (current.compareTo(GradleVersion.version("1.9")) >= 0) {
      int endIndex = libName.indexOf(current.getVersion());
      if (endIndex != -1) {
        String srcDirChild = libName.substring("gradle-".length(), endIndex - 1);
        srcDir = new File(srcDir, srcDirChild);
      }
    }

    if (srcDir.isDirectory()) {
      library.addPath(LibraryPathType.SOURCE, srcDir.getAbsolutePath());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:BaseGradleProjectResolverExtension.java

示例8: getVersionDetails

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
protected static VersionDetails getVersionDetails(String versionString) {
    GradleVersion version = GradleVersion.version(versionString);
    if (version.compareTo(GradleVersion.version("1.11")) > 0) {
        return new R112VersionDetails(version.getVersion());
    }
    return new R18VersionDetails(version.getVersion());
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:ActionAwareConsumerConnection.java

示例9: getVersionDetails

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
public static VersionDetails getVersionDetails(String versionString) {
    GradleVersion version = GradleVersion.version(versionString);
    if (version.compareTo(GradleVersion.version("1.11")) > 0) {
        return new R112VersionDetails(version.getVersion());
    }
    if (version.compareTo(GradleVersion.version("1.8-rc-1")) >= 0) {
        return new R18VersionDetails(version.getVersion());
    }
    return new R16VersionDetails(version.getVersion());
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:11,代码来源:ModelBuilderBackedConsumerConnection.java

示例10: getMetaData

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
private static VersionDetails getMetaData(final ConnectionVersion4 delegate) {
    GradleVersion version = GradleVersion.version(delegate.getMetaData().getVersion());
    if (version.compareTo(GradleVersion.version("1.0-milestone-5")) < 0) {
        return new R10M3VersionDetails(delegate);
    } else {
        return new R10M5VersionDetails(delegate);
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:9,代码来源:ConnectionVersion4BackedConsumerConnection.java

示例11: require

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
private static boolean require(GradleEnvironment environment, GradleVersion version) {
    try {
        GradleVersion current = GradleVersion.version(environment.getGradleVersion());
        return current.isValid() && current.compareTo(version) >= 0;
    } catch (RuntimeException e) {
        LogUtil.log(IStatus.WARNING, MessageFormat.format(
                Messages.GradleUtil_warnInvalidGradleVersion,
                environment.getGradleVersion()), e);
        return false;
    }
}
 
开发者ID:asakusafw,项目名称:asakusafw-shafu,代码行数:12,代码来源:GradleUtil.java

示例12: isVersion

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
protected boolean isVersion(String otherVersionString) {
    GradleVersion otherVersion = GradleVersion.version(otherVersionString);
    return version.compareTo(otherVersion) == 0 || (version.isSnapshot() && version.getBaseVersion().equals(otherVersion.getBaseVersion()));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultGradleDistribution.java

示例13: setGradleVersion

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
/**
 * The version of the gradle distribution required by the wrapper. This is usually the same version of Gradle you
 * use for building your project.
 */
@Option(option = "gradle-version", description = "The version of the Gradle distribution required by the wrapper.")
public void setGradleVersion(String gradleVersion) {
    this.gradleVersion = GradleVersion.version(gradleVersion);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:Wrapper.java

示例14: getGradleVersion

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
public GradleVersion getGradleVersion() {
    return GradleVersion.version(getSpec().getGradleVersion());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:ComparableGradleBuildExecuter.java

示例15: determineTargetGradleVersion

import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
private GradleVersion determineTargetGradleVersion(ProjectConnection connection) {
    BuildEnvironment buildEnvironment = connection.getModel(BuildEnvironment.class);
    return GradleVersion.version(buildEnvironment.getGradle().getGradleVersion());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:ToolingApiGradleExecutor.java


注:本文中的org.gradle.util.GradleVersion.version方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。