Skip to content

Commit 6c3a895

Browse files
feat(testkit-support): new factory method on VersionCatalogs to simplify creation.
1 parent a2a0cfe commit 6c3a895

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • testkit/gradle-testkit-support/src/main/kotlin/com/autonomousapps/kit/gradle

testkit/gradle-testkit-support/src/main/kotlin/com/autonomousapps/kit/gradle/VersionCatalogs.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,18 @@ public class VersionCatalogs(
3131
public fun of(vararg versionCatalogs: VersionCatalog): VersionCatalogs {
3232
return VersionCatalogs(versionCatalogs.toList())
3333
}
34+
35+
/**
36+
* ```
37+
* VersionCatalogs.of(
38+
* "myLibs" to "gradle/my-libs.versions.toml",
39+
* "myOtherLibs" to "gradle/my-other-libs.versions.toml"
40+
* )
41+
* ```
42+
*/
43+
@JvmStatic
44+
public fun of(vararg versionCatalogs: Pair<String, String>): VersionCatalogs {
45+
return VersionCatalogs(versionCatalogs.map { VersionCatalog(it.first, it.second) })
46+
}
3447
}
3548
}

0 commit comments

Comments
 (0)