mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
gradle: handle transitive dependency for project dependencies with non default configuration (IDEA-150058)
This commit is contained in:
+40
@@ -125,6 +125,46 @@ public class GradleDependenciesImportingTest extends GradleImportingTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@TargetVersions("2.0+")
|
||||
public void testProvidedDependencyScopeMerge() throws Exception {
|
||||
createSettingsFile("include 'web'\n" +
|
||||
"include 'user'");
|
||||
|
||||
importProject(
|
||||
"subprojects {\n" +
|
||||
" apply plugin: 'java'\n" +
|
||||
" configurations {\n" +
|
||||
" provided\n" +
|
||||
" }\n" +
|
||||
"}\n" +
|
||||
"\n" +
|
||||
"project(':web') {\n" +
|
||||
" dependencies {\n" +
|
||||
" provided 'junit:junit:4.11'\n" +
|
||||
" }\n" +
|
||||
"}\n" +
|
||||
"project(':user') {\n" +
|
||||
" apply plugin: 'war'\n" +
|
||||
" dependencies {\n" +
|
||||
" compile project(':web')\n" +
|
||||
" providedCompile project(path: ':web', configuration: 'provided')\n" +
|
||||
" }\n" +
|
||||
"}"
|
||||
);
|
||||
|
||||
assertModules("project", "web", "web_main", "web_test", "user", "user_main", "user_test");
|
||||
|
||||
assertModuleLibDeps("web");
|
||||
assertModuleLibDeps("web_main");
|
||||
assertModuleLibDeps("web_test");
|
||||
|
||||
assertModuleModuleDeps("user_main", "web_main");
|
||||
assertModuleModuleDepScope("user_main", "web_main", DependencyScope.COMPILE);
|
||||
assertModuleLibDepScope("user_main", "Gradle: org.hamcrest:hamcrest-core:1.3", DependencyScope.PROVIDED);
|
||||
assertModuleLibDepScope("user_main", "Gradle: junit:junit:4.11", DependencyScope.PROVIDED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCustomSourceSetsDependencies() throws Exception {
|
||||
createSettingsFile("include 'api', 'impl' ");
|
||||
|
||||
+5
-5
@@ -773,11 +773,11 @@ class DependencyResolverImpl implements DependencyResolver {
|
||||
dependency.projectDependencyArtifacts = artifactMap.get(componentResult.moduleVersion).collect { it.file }
|
||||
dependency.projectDependencyArtifacts.each { resolvedDepsFiles.add(it) }
|
||||
|
||||
// if (componentResult != dependencyResult.from) {
|
||||
// dependency.dependencies.addAll(
|
||||
// transform(componentResult.dependencies)
|
||||
// )
|
||||
// }
|
||||
if (componentResult != dependencyResult.from) {
|
||||
dependency.dependencies.addAll(
|
||||
transform(componentResult.dependencies)
|
||||
)
|
||||
}
|
||||
dependencies.add(dependency)
|
||||
|
||||
def files = []
|
||||
|
||||
Reference in New Issue
Block a user