[IC] Handle custom source set located outside project directory
To support build cache relocatability, we need to convert absolute paths into relative paths before storing them in IC caches. Before this commit, we computed relative paths based on the (root) project directory and FAIL if some source files are located outside the project directory. With this commit, we will NOT FAIL in that case. This means relative paths may start with "../". It's not "clean", but it can work. Test: New test in BuildCacheRelocationIT ^KT-61852 Fixed
This commit is contained in:
+2
-2
@@ -84,7 +84,7 @@ class SourceToOutputFilesMapTest {
|
||||
|
||||
@Test
|
||||
fun testSetRelativeFails() {
|
||||
assertFailsWith<IllegalStateException> {
|
||||
assertFailsWith<IllegalArgumentException> {
|
||||
stofMap[fooDotKt] = listOf(File("relativePath"))
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ class SourceToOutputFilesMapTest {
|
||||
fun testGetRelativeFails() {
|
||||
stofMap[fooDotKt] = listOf(fooDotClass)
|
||||
|
||||
assertFailsWith<IllegalStateException> {
|
||||
assertFailsWith<IllegalArgumentException> {
|
||||
stofMap[fooDotKt.relativeTo(srcDir)]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user