-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polish "Add dependency classifier support"
See gh-1049
- Loading branch information
Showing
14 changed files
with
108 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ator/src/main/java/io/spring/initializr/generator/buildsystem/maven/MavenBuildWriter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
@@ -305,16 +305,6 @@ void gradleBuildWithCompileDependency() { | |
" implementation 'org.springframework.boot:spring-boot-starter'", "}"); | ||
} | ||
|
||
@Test | ||
void gradleBuildWithClassifierDependency() { | ||
GradleBuild build = new GradleBuild(); | ||
build.dependencies().add("root", | ||
Dependency.withCoordinates("org.springframework.boot", "spring-boot-starter").classifier("classifier")); | ||
List<String> lines = generateBuild(build); | ||
assertThat(lines).containsSequence("dependencies {", | ||
" implementation 'org.springframework.boot:spring-boot-starter:classifier'", "}"); | ||
} | ||
|
||
@Test | ||
void gradleBuildWithNoScopeDependencyDefaultsToCompile() { | ||
GradleBuild build = new GradleBuild(); | ||
|
@@ -373,6 +363,14 @@ void gradleBuildWithTestRuntimeDependency() { | |
" testRuntimeOnly 'de.flapdoodle.embed:de.flapdoodle.embed.mongo'", "}"); | ||
} | ||
|
||
@Test | ||
void gradleBuildWithClassifierDependency() { | ||
GradleBuild build = new GradleBuild(); | ||
build.dependencies().add("root", Dependency.withCoordinates("com.example", "acme").classifier("test-jar")); | ||
List<String> lines = generateBuild(build); | ||
assertThat(lines).containsSequence("dependencies {", " implementation 'com.example:acme:test-jar'", "}"); | ||
} | ||
|
||
@Test | ||
void gradleBuildWithExclusions() { | ||
GradleBuild build = new GradleBuild(); | ||
|
@@ -410,11 +408,11 @@ void gradleBuildWithNonNullArtifactTypeDependency() { | |
@Test | ||
void gradleBuildWithNonNullArtifactTypeAndClassifierDependency() { | ||
GradleBuild build = new GradleBuild(); | ||
build.dependencies().add("root", Dependency.withCoordinates("org.springframework.boot", "spring-boot-starter") | ||
.scope(DependencyScope.COMPILE).type("tar.gz").classifier("classifier")); | ||
build.dependencies().add("root", Dependency.withCoordinates("com.example", "acme") | ||
.scope(DependencyScope.COMPILE).type("tar.gz").classifier("test-jar")); | ||
List<String> lines = generateBuild(build); | ||
assertThat(lines).containsSequence("dependencies {", | ||
" implementation 'org.springframework.boot:spring-boot-starter:[email protected]'", "}"); | ||
assertThat(lines).containsSequence("dependencies {", " implementation 'com.example:acme:[email protected]'", | ||
"}"); | ||
} | ||
|
||
@Test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
@@ -313,16 +313,6 @@ void gradleBuildWithCompileDependency() { | |
" implementation(\"org.springframework.boot:spring-boot-starter\")", "}"); | ||
} | ||
|
||
@Test | ||
void gradleBuildWithClassifierDependency() { | ||
GradleBuild build = new GradleBuild(); | ||
build.dependencies().add("root", Dependency.withCoordinates("org.springframework.boot", "spring-boot-starter") | ||
.scope(DependencyScope.COMPILE).classifier("classifier")); | ||
List<String> lines = generateBuild(build); | ||
assertThat(lines).containsSequence("dependencies {", | ||
" implementation(\"org.springframework.boot:spring-boot-starter:classifier\")", "}"); | ||
} | ||
|
||
@Test | ||
void gradleBuildWithNoScopeDependencyDefaultsToCompile() { | ||
GradleBuild build = new GradleBuild(); | ||
|
@@ -381,6 +371,15 @@ void gradleBuildWithTestRuntimeDependency() { | |
" testRuntimeOnly(\"de.flapdoodle.embed:de.flapdoodle.embed.mongo\")", "}"); | ||
} | ||
|
||
@Test | ||
void gradleBuildWithClassifierDependency() { | ||
GradleBuild build = new GradleBuild(); | ||
build.dependencies().add("root", Dependency.withCoordinates("com.example", "acme") | ||
.scope(DependencyScope.COMPILE).classifier("test-jar")); | ||
List<String> lines = generateBuild(build); | ||
assertThat(lines).containsSequence("dependencies {", " implementation(\"com.example:acme:test-jar\")", "}"); | ||
} | ||
|
||
@Test | ||
void gradleBuildWithExclusions() { | ||
GradleBuild build = new GradleBuild(); | ||
|
@@ -418,11 +417,11 @@ void gradleBuildWithNonNullArtifactTypeDependency() { | |
@Test | ||
void gradleBuildWithNonNullArtifactTypeAndClassifierDependency() { | ||
GradleBuild build = new GradleBuild(); | ||
build.dependencies().add("root", Dependency.withCoordinates("org.springframework.boot", "spring-boot-starter") | ||
.scope(DependencyScope.COMPILE).type("tar.gz").classifier("classifier")); | ||
build.dependencies().add("root", Dependency.withCoordinates("com.example", "acme") | ||
.scope(DependencyScope.COMPILE).type("tar.gz").classifier("test-jar")); | ||
List<String> lines = generateBuild(build); | ||
assertThat(lines).containsSequence("dependencies {", | ||
" implementation(\"org.springframework.boot:spring-boot-starter:[email protected]\")", "}"); | ||
assertThat(lines).containsSequence("dependencies {", " implementation(\"com.example:acme:[email protected]\")", | ||
"}"); | ||
} | ||
|
||
@Test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.