Skip to content

Commit

Permalink
extracting jars for module dependencies with -internal scope tests #S…
Browse files Browse the repository at this point in the history
…CL-22721
  • Loading branch information
azdrojowa123 committed Jul 18, 2024
1 parent dd35dfa commit 2b73245
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
11 changes: 11 additions & 0 deletions extractor/src/test/data/1.9/internal_config/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sbt.librarymanagement.Configurations.{CompileInternal, RuntimeInternal, TestInternal}

ThisBuild / version := "0.1.0-SNAPSHOT"

ThisBuild / scalaVersion := "3.3.3"

libraryDependencies ++= Seq(
"junit" % "junit" % "4.13.2" % TestInternal,
"org.scalacheck" %% "scalacheck" % "1.17.1" % CompileInternal ,
"com.typesafe" % "config" % "1.4.3" % RuntimeInternal,
)
2 changes: 2 additions & 0 deletions extractor/src/test/scala/org/jetbrains/sbt/ImportSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ class ImportSpec extends AnyFreeSpecLike {
"dependency_resolve_sbt_classifiers" in { testProject("dependency_resolve_sbt_classifiers", SbtVersion_1_9, options = ResolveSbtClassifiers) }
"dependency_resolve_sources_and_javadocs_and_sbt_classifiers" in { testProject("dependency_resolve_sources_and_javadocs_and_sbt_classifiers", SbtVersion_1_9, options = ResolveSourcesAndJavaDocsAndSbtClassifiers) }

"internal_config" in { testProject("internal_config", SbtVersion_1_9, options = ResolveSources) }

"dependency_resolve_sbt_classifiers_prod_test_sources_separated" in { testProject("dependency_resolve_sbt_classifiers_prod_test_sources_separated", SbtVersion_1_9, options = ResolveSbtClassifiersAndSeparateProdTestSources) }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class RepositoryExtractorSpec extends AnyFreeSpecLike {

private val projects: Seq[ProjectRef] = Seq("project-1", "project-2").map(ProjectRef(file("/tmp/test-project"), _))

private val projectToConfigurationsName = projects.map(_ -> Seq(sbt.Compile.name)).toMap

"RepositoryExtractor" - {
"extract modules for all accepted projects when supplied" in {
val moduleId = (name: String) => ModuleID("com.example", name, "SNAPSHOT")
Expand All @@ -33,7 +35,7 @@ class RepositoryExtractorSpec extends AnyFreeSpecLike {
).apply,
updateClassifiersReports = None,
classpathTypes = const(Set(Artifact.DefaultType)),
dependencyConfigurations = const(Seq(sbt.Compile))
projectToConfigurationsName = projectToConfigurationsName
).extract

val expected = Seq(
Expand Down Expand Up @@ -78,7 +80,7 @@ class RepositoryExtractorSpec extends AnyFreeSpecLike {
))
).apply),
classpathTypes = const(Set(Artifact.DefaultType)),
dependencyConfigurations = const(Seq(sbt.Compile))
projectToConfigurationsName = projectToConfigurationsName
).extract

val expected = Seq(
Expand All @@ -105,7 +107,7 @@ class RepositoryExtractorSpec extends AnyFreeSpecLike {
).apply,
updateClassifiersReports = None,
classpathTypes = const(Set(Artifact.DefaultType)),
dependencyConfigurations = const(Seq(sbt.Compile))
projectToConfigurationsName = projectToConfigurationsName
).extract

val expected = Seq(
Expand Down

0 comments on commit 2b73245

Please sign in to comment.