Skip to content

Commit

Permalink
Fix illegal Windows filesystem character
Browse files Browse the repository at this point in the history
Windows does not allow the : character to be used in paths.
  • Loading branch information
mezpahlan committed Oct 16, 2022
1 parent 107fce3 commit b2acbc4
Showing 1 changed file with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ class AffectedModuleDetectorImplTest {
@JvmField
val attachLogsRule = AttachLogsTestRule()
private val logger = attachLogsRule.logger

@Rule
@JvmField
val tmpFolder = TemporaryFolder()

@Rule
@JvmField
val tmpFolder2 = TemporaryFolder()
Expand All @@ -43,10 +45,10 @@ class AffectedModuleDetectorImplTest {
private lateinit var p12: Project
private lateinit var p13: Project
private val pathsAffectingAllModules = setOf(
"tools/android/buildSrc",
"android/gradlew",
"android/gradle",
"dbx/core/api/"
convertToFilePath("tools", "android", "buildSrc"),
convertToFilePath("android", "gradlew"),
convertToFilePath("android", "gradle"),
convertToFilePath("dbx", "core", "api")
)
private lateinit var affectedModuleConfiguration: AffectedModuleConfiguration

Expand Down Expand Up @@ -81,18 +83,21 @@ class AffectedModuleDetectorImplTest {
*/

// Root projects
root = ProjectBuilder.builder()
.withProjectDir(tmpDir)
.withName("root")
.build()
// Project Graph expects supportRootFolder.
(root.properties.get("ext") as ExtraPropertiesExtension).set("supportRootFolder", tmpDir)
(root.properties["ext"] as ExtraPropertiesExtension).set("supportRootFolder", tmpDir)
root2 = ProjectBuilder.builder()
.withProjectDir(tmpDir2)
.withName("root2/ui")
.build()
// Project Graph expects supportRootFolder.
(root2.properties.get("ext") as ExtraPropertiesExtension).set("supportRootFolder", tmpDir2)
(root2.properties["ext"] as ExtraPropertiesExtension).set("supportRootFolder", tmpDir2)

// Library modules
p1 = ProjectBuilder.builder()
.withProjectDir(tmpDir.resolve("p1"))
.withName("p1")
Expand All @@ -104,29 +109,29 @@ class AffectedModuleDetectorImplTest {
.withParent(root)
.build()
p3 = ProjectBuilder.builder()
.withProjectDir(tmpDir.resolve("p1:p3"))
.withProjectDir(tmpDir.resolve("p1/p3"))
.withName("p3")
.withParent(p1)
.build()
val p3config = p3.configurations.create("p3config")
p3config.dependencies.add(p3.dependencies.project(mutableMapOf("path" to ":p1")))
p4 = ProjectBuilder.builder()
.withProjectDir(tmpDir.resolve("p1:p3:p4"))
.withProjectDir(tmpDir.resolve("p1/p3/p4"))
.withName("p4")
.withParent(p3)
.build()
val p4config = p4.configurations.create("p4config")
p4config.dependencies.add(p4.dependencies.project(mutableMapOf("path" to ":p1:p3")))
p5 = ProjectBuilder.builder()
.withProjectDir(tmpDir.resolve("p2:p5"))
.withProjectDir(tmpDir.resolve("p2/p5"))
.withName("p5")
.withParent(p2)
.build()
val p5config = p5.configurations.create("p5config")
p5config.dependencies.add(p5.dependencies.project(mutableMapOf("path" to ":p2")))
p5config.dependencies.add(p5.dependencies.project(mutableMapOf("path" to ":p1:p3")))
p6 = ProjectBuilder.builder()
.withProjectDir(tmpDir.resolve("p1:p3:p6"))
.withProjectDir(tmpDir.resolve("p1/p3/p6"))
.withName("p6")
.withParent(p3)
.build()
Expand All @@ -152,6 +157,8 @@ class AffectedModuleDetectorImplTest {
.withName("benchmark")
.withParent(root)
.build()

// UI modules
p12 = ProjectBuilder.builder()
.withProjectDir(tmpDir2.resolve("compose"))
.withName("compose")
Expand Down Expand Up @@ -630,6 +637,7 @@ class AffectedModuleDetectorImplTest {
)
)
}

@Test
fun changeInNormalOnlyDependent_normalBuild() {
val detector = AffectedModuleDetectorImpl(
Expand Down

0 comments on commit b2acbc4

Please sign in to comment.