mirror of
https://gitee.com/dcren/initializr.git
synced 2025-12-17 17:41:31 +08:00
Promote version infrastructure to dedicated package
This commit moves `Version` and related support classes to a dedicated package Closes gh-811
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2019 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.spring.initializr.util;
|
||||
package io.spring.initializr.generator.version;
|
||||
|
||||
/**
|
||||
* Thrown if a input represents an invalid version.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.spring.initializr.util;
|
||||
package io.spring.initializr.generator.version;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* Copyright 2012-2019 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.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.spring.initializr.util;
|
||||
package io.spring.initializr.generator.version;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -22,7 +22,7 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import io.spring.initializr.util.Version.Qualifier;
|
||||
import io.spring.initializr.generator.version.Version.Qualifier;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -14,11 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.spring.initializr.util;
|
||||
package io.spring.initializr.generator.version;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -119,15 +120,13 @@ public final class VersionProperty implements Serializable, Comparable<VersionPr
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
VersionProperty that = (VersionProperty) o;
|
||||
|
||||
return this.property.equals(that.property);
|
||||
return this.internal == that.internal && this.property.equals(that.property);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.property.hashCode();
|
||||
return Objects.hash(this.property, this.internal);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.spring.initializr.util;
|
||||
package io.spring.initializr.generator.version;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2012-2019 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Version support classes.
|
||||
*/
|
||||
package io.spring.initializr.generator.version;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* Copyright 2012-2019 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.
|
||||
@@ -22,11 +22,11 @@ import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.spring.initializr.util.InvalidVersionException;
|
||||
import io.spring.initializr.util.Version;
|
||||
import io.spring.initializr.util.VersionParser;
|
||||
import io.spring.initializr.util.VersionProperty;
|
||||
import io.spring.initializr.util.VersionRange;
|
||||
import io.spring.initializr.generator.version.InvalidVersionException;
|
||||
import io.spring.initializr.generator.version.Version;
|
||||
import io.spring.initializr.generator.version.VersionParser;
|
||||
import io.spring.initializr.generator.version.VersionProperty;
|
||||
import io.spring.initializr.generator.version.VersionRange;
|
||||
|
||||
/**
|
||||
* Define a Bill Of Materials to be represented in the generated project if a dependency
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* Copyright 2012-2019 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.
|
||||
@@ -25,7 +25,7 @@ import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.spring.initializr.util.VersionParser;
|
||||
import io.spring.initializr.generator.version.VersionParser;
|
||||
|
||||
/**
|
||||
* A {@link ServiceCapability} listing the available dependencies defined as a
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* Copyright 2012-2019 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.
|
||||
@@ -24,10 +24,10 @@ import java.util.StringTokenizer;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.spring.initializr.util.InvalidVersionException;
|
||||
import io.spring.initializr.util.Version;
|
||||
import io.spring.initializr.util.VersionParser;
|
||||
import io.spring.initializr.util.VersionRange;
|
||||
import io.spring.initializr.generator.version.InvalidVersionException;
|
||||
import io.spring.initializr.generator.version.Version;
|
||||
import io.spring.initializr.generator.version.VersionParser;
|
||||
import io.spring.initializr.generator.version.VersionRange;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* Copyright 2012-2019 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.
|
||||
@@ -18,7 +18,7 @@ package io.spring.initializr.metadata;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.spring.initializr.util.Version;
|
||||
import io.spring.initializr.generator.version.Version;
|
||||
|
||||
/**
|
||||
* Dependency metadata for a given spring boot {@link Version}.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* Copyright 2012-2019 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.
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package io.spring.initializr.metadata;
|
||||
|
||||
import io.spring.initializr.util.Version;
|
||||
import io.spring.initializr.generator.version.Version;
|
||||
|
||||
/**
|
||||
* Provide the {@link DependencyMetadata} for a given spring boot version.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* Copyright 2012-2019 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.
|
||||
@@ -26,10 +26,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.spring.initializr.util.InvalidVersionException;
|
||||
import io.spring.initializr.util.Version;
|
||||
import io.spring.initializr.util.VersionParser;
|
||||
import io.spring.initializr.util.VersionRange;
|
||||
import io.spring.initializr.generator.version.InvalidVersionException;
|
||||
import io.spring.initializr.generator.version.Version;
|
||||
import io.spring.initializr.generator.version.VersionParser;
|
||||
import io.spring.initializr.generator.version.VersionRange;
|
||||
|
||||
import org.springframework.boot.context.properties.NestedConfigurationProperty;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* Copyright 2012-2019 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.
|
||||
@@ -21,9 +21,9 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import io.spring.initializr.util.Version;
|
||||
import io.spring.initializr.util.VersionParser;
|
||||
import io.spring.initializr.util.VersionProperty;
|
||||
import io.spring.initializr.generator.version.Version;
|
||||
import io.spring.initializr.generator.version.VersionParser;
|
||||
import io.spring.initializr.generator.version.VersionProperty;
|
||||
|
||||
/**
|
||||
* Meta-data used to generate a project.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.spring.initializr.util;
|
||||
package io.spring.initializr.generator.version;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.spring.initializr.util;
|
||||
package io.spring.initializr.generator.version;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.spring.initializr.util;
|
||||
package io.spring.initializr.generator.version;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.spring.initializr.util;
|
||||
package io.spring.initializr.generator.version;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -18,9 +18,9 @@ package io.spring.initializr.metadata;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import io.spring.initializr.generator.version.Version;
|
||||
import io.spring.initializr.generator.version.VersionParser;
|
||||
import io.spring.initializr.metadata.BillOfMaterials.Mapping;
|
||||
import io.spring.initializr.util.Version;
|
||||
import io.spring.initializr.util.VersionParser;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -18,8 +18,8 @@ package io.spring.initializr.metadata;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import io.spring.initializr.util.Version;
|
||||
import io.spring.initializr.util.VersionParser;
|
||||
import io.spring.initializr.generator.version.Version;
|
||||
import io.spring.initializr.generator.version.VersionParser;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package io.spring.initializr.metadata;
|
||||
|
||||
import io.spring.initializr.generator.version.Version;
|
||||
import io.spring.initializr.metadata.InitializrConfiguration.Env.Kotlin;
|
||||
import io.spring.initializr.util.Version;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -21,10 +21,10 @@ import java.net.URL;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import io.spring.initializr.generator.version.Version;
|
||||
import io.spring.initializr.metadata.BillOfMaterials.Mapping;
|
||||
import io.spring.initializr.metadata.InitializrConfiguration.Env.Kotlin;
|
||||
import io.spring.initializr.metadata.InitializrConfiguration.Env.Maven.ParentPom;
|
||||
import io.spring.initializr.util.Version;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
Reference in New Issue
Block a user