@@ -11,8 +11,10 @@ import org.tomlj.Toml
1111
1212val versionCatalog by lazy {
1313 // A hack to read version catalog from settings
14- Toml .parse(file(" $rootDir /gradle/libs.versions.toml" ).readText()).getTable(" versions" )
15- ? : error(" Unable to parse the version catalog!" )
14+ runCatching {
15+ Toml .parse(file(" $rootDir /gradle/libs.versions.toml" ).readText()).getTable(" versions" )
16+ }
17+ .getOrNull()
1618}
1719
1820pluginManagement {
@@ -123,7 +125,7 @@ fun RepositoryHandler.googleAndroid() {
123125fun RepositoryHandler.nodeJS () {
124126 exclusiveContent {
125127 forRepository {
126- ivy(versionCatalog.getString(" repo-nodejs" ).orEmpty()) {
128+ ivy(versionCatalog? .getString(" repo-nodejs" ).orEmpty()) {
127129 name = " Node Distributions at $url "
128130 patternLayout { artifact(" v[revision]/[artifact](-v[revision]-[classifier]).[ext]" ) }
129131 metadataSources { artifact() }
@@ -135,7 +137,7 @@ fun RepositoryHandler.nodeJS() {
135137}
136138
137139fun RepositoryHandler.kobWeb () {
138- maven(url = versionCatalog.getString(" repo-kobweb" ).orEmpty()) {
140+ maven(url = versionCatalog? .getString(" repo-kobweb" ).orEmpty()) {
139141 name = " KobWeb Repo"
140142 content { includeGroupAndSubgroups(" com.varabyte" ) }
141143 }
@@ -145,7 +147,7 @@ fun RepositoryHandler.mavenSnapshot() {
145147 val mvnSnapshot = providers.gradleProperty(" enableMavenSnapshot" ).orNull.toBoolean()
146148 if (mvnSnapshot) {
147149 logger.lifecycle(" ❖ Maven Snapshot is enabled!" )
148- maven(url = versionCatalog.getString(" repo-mvn-snapshot" ).orEmpty()) {
150+ maven(url = versionCatalog? .getString(" repo-mvn-snapshot" ).orEmpty()) {
149151 mavenContent { snapshotsOnly() }
150152 }
151153 }
0 commit comments