From 2ad9efae7b67fa7a50cf2c053e8a44294da77f3e Mon Sep 17 00:00:00 2001 From: HaeTi Date: Tue, 5 Nov 2024 18:42:39 +0900 Subject: [PATCH] =?UTF-8?q?init/#1=20:=20simple=20expression=20=EB=B0=98?= =?UTF-8?q?=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extension/VersionCatalogExtension.kt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/build-logic/convention/src/main/java/com/boostcamp/mapisode/convention/extension/VersionCatalogExtension.kt b/build-logic/convention/src/main/java/com/boostcamp/mapisode/convention/extension/VersionCatalogExtension.kt index 8eb90202..91ddb0fe 100644 --- a/build-logic/convention/src/main/java/com/boostcamp/mapisode/convention/extension/VersionCatalogExtension.kt +++ b/build-logic/convention/src/main/java/com/boostcamp/mapisode/convention/extension/VersionCatalogExtension.kt @@ -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 { - return findBundle(bundleName).orElseThrow { +fun VersionCatalog.getBundle(bundleName: String): Provider = + findBundle(bundleName).orElseThrow { NoSuchElementException("Bundle with name $bundleName not found in the catalog") } -} -fun VersionCatalog.getLibrary(libraryName: String): Provider { - return findLibrary(libraryName).orElseThrow { +fun VersionCatalog.getLibrary(libraryName: String): Provider = + 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") } -}