mirror of
https://gitee.com/dcren/initializr.git
synced 2025-12-21 19:10:00 +08:00
Add platform compatibility range support
This commit adds a new `platformCompatibilityRange` in the metadata that can be used to restrict the valid platform versions. If a project is requested or metadata needs to be resolved against a version that does not match the range, an exception is thrown. Closes gh-1048
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -186,6 +186,12 @@ public class InitializrMetadataTestBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public InitializrMetadataTestBuilder setPlatformCompatibilityRange(String platformCompatibilityRange) {
|
||||
this.builder.withCustomizer(
|
||||
(it) -> it.getConfiguration().getEnv().setPlatformCompatibilityRange(platformCompatibilityRange));
|
||||
return this;
|
||||
}
|
||||
|
||||
public InitializrMetadataTestBuilder setGradleEnv(String dependencyManagementPluginVersion) {
|
||||
this.builder.withCustomizer((it) -> it.getConfiguration().getEnv().getGradle()
|
||||
.setDependencyManagementPluginVersion(dependencyManagementPluginVersion));
|
||||
|
||||
Reference in New Issue
Block a user