Skip to content

Commit

Permalink
init/#1 : simple expression 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
haeti-dev committed Nov 6, 2024
1 parent 47f3b0b commit 8366b0a
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@ import org.gradle.api.artifacts.VersionCatalog
import org.gradle.api.artifacts.VersionConstraint
import org.gradle.api.provider.Provider

fun VersionCatalog.getBundle(bundleName: String): Provider<ExternalModuleDependencyBundle> {
return findBundle(bundleName).orElseThrow {
fun VersionCatalog.getBundle(bundleName: String): Provider<ExternalModuleDependencyBundle> =
findBundle(bundleName).orElseThrow {
NoSuchElementException("Bundle with name $bundleName not found in the catalog")
}
}

fun VersionCatalog.getLibrary(libraryName: String): Provider<MinimalExternalModuleDependency> {
return findLibrary(libraryName).orElseThrow {
fun VersionCatalog.getLibrary(libraryName: String): Provider<MinimalExternalModuleDependency> =
findLibrary(libraryName).orElseThrow {
NoSuchElementException("Library with name $libraryName not found in the catalog")
}
}

fun VersionCatalog.getVersion(versionName: String): VersionConstraint {
return findVersion(versionName).orElseThrow {
fun VersionCatalog.getVersion(versionName: String): VersionConstraint =
findVersion(versionName).orElseThrow {
NoSuchElementException("Version with name $versionName not found in the catalog")
}
}

0 comments on commit 8366b0a

Please sign in to comment.