-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insert all module transitive module dependencies #SCL-21158 #59
Insert all module transitive module dependencies #SCL-21158 #59
Conversation
2500b00
to
32257dd
Compare
d3849bf
to
dffb000
Compare
extractor/src/main/scala/org/jetbrains/sbt/extractors/AndroidSdkPluginExtractor.scala
Outdated
Show resolved
Hide resolved
shared/src/main/scala/org/jetbrains/sbt/structure/dataSerializers.scala
Outdated
Show resolved
Hide resolved
extractor/src/main/scala/org/jetbrains/sbt/extractors/DependenciesExtractor.scala
Outdated
Show resolved
Hide resolved
extractor/src/main/scala/org/jetbrains/sbt/extractors/DependenciesExtractor.scala
Outdated
Show resolved
Hide resolved
extractor/src/main/scala/org/jetbrains/sbt/extractors/DependenciesExtractor.scala
Outdated
Show resolved
Hide resolved
extractor/src/main/scala/org/jetbrains/sbt/extractors/DependenciesExtractor.scala
Outdated
Show resolved
Hide resolved
extractor/src/main/scala/org/jetbrains/sbt/extractors/DependenciesExtractor.scala
Outdated
Show resolved
Hide resolved
extractor/src/main/scala/org/jetbrains/sbt/extractors/DependenciesExtractor.scala
Outdated
Show resolved
Hide resolved
extractor/src/main/scala/org/jetbrains/sbt/extractors/DependenciesExtractor.scala
Outdated
Show resolved
Hide resolved
extractor/src/main/scala/org/jetbrains/sbt/extractors/DependenciesExtractor.scala
Outdated
Show resolved
Hide resolved
extractor/src/main/scala/org/jetbrains/sbt/extractors/DependenciesExtractor.scala
Outdated
Show resolved
Hide resolved
val sourceConfigurationsNames = sourceConfigurations.map(_.name) | ||
val transformedConfigurations = mapConfigurations(configurations).map { configuration => | ||
// additional mapping is required in case of situation where project1 dependsOn project2 in two custom configurations -> the test one | ||
// and the one containing sources. Without this mapping custom test configuration will be transformed to TEST in #mapConfigurations and in the scala plugin, scope |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ensure that this special case mentioned in the comment is covered with tests.
ATM it might be easier to use sbt import integration tests in Scala Plugin
* It needs to be done because `Classpaths#interSort` generate transitive dependencies by analyzing configurations strings (e.g. "compile->provided") | ||
* So for such project: <br> | ||
* {{{ val root = (project in file(".")).dependsOn(proj1 % "compile->provided") }}} | ||
* `Classpaths#interSort` will return: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ensure that this special case mentioned in the comment is covered with tests.
ATM it might be easier to use sbt import integration tests in Scala Plugin
55aad34
to
b4286e1
Compare
I didn't resolve conversations that relate to the changes that I made in CR commits and may be discussable, or I am not sure that this is what was meant. |
val allSourceConfigurationsTask = StructureKeys.allSourceConfigurations.in(projectRef).get(state) | ||
val allTestConfigurationsTask = StructureKeys.allTestConfigurations.in(projectRef).get(state) | ||
|
||
val classpathConfigurationTask = sbt.Keys.classpathConfiguration.in(projectRef) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to use only allConfigurationsWithSource
setting key for all projects, it is more cleaner
} yield { | ||
|
||
val projectToTransitiveDependencies = getTransitiveDependenciesForProject( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of allSourceConfigurationsTask
and allTestConfigurationsTask
now I only use one setting key.
For now I left that sourceConfigurations
and classpathConfigurationTask
are always executed, not only when options.insertProjectTransitiveDependencies
is true for simplicity. It shouldn't waste a lot of resources.
If I notice an increase in import time during tests on my branch in comparison to idea233.x
, I will come back here.
* would be calculated to `TEST` (in [[org.jetbrains.sbt.project.SbtProjectResolver.scopeFor]]) which would not be truth, | ||
* because now the scope for `dummy` dependency should be `COMPILE`. | ||
* | ||
* Check behaviour of this logic when SCL-18284 will be fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested in testCustomConfigurationsWithNestedProjectDependencies
in the scala plugin
* [[sbt.Classpaths.interSort]] for `compile` scope in project `root` will return: {{{ | ||
* compile -> (proj1, "provided"), (proj2, "compile") | ||
* }}} | ||
* which in practice means that we only have to add `proj2` as a dependency to `root` and `proj1` dependency shouldn't be taken into account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested in testNonSourceConfigurationsWithNestedProjectDependencies
in scala plugin
ce411a3
to
7d0c3fe
Compare
[project transitive dependencies] fix deserializers
7d0c3fe
to
feaf978
Compare
feaf978
to
258c788
Compare
No description provided.