本文整理汇总了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;
}
});
}
示例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;
}
示例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();
}
示例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;
}
示例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()+")");
}
}
示例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;
}
示例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());
}
}
}
示例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());
}
示例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());
}
示例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);
}
}
示例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;
}
}
示例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()));
}
示例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);
}
示例14: getGradleVersion
import org.gradle.util.GradleVersion; //导入方法依赖的package包/类
public GradleVersion getGradleVersion() {
return GradleVersion.version(getSpec().getGradleVersion());
}
示例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());
}