Skip to content

Commit

Permalink
fix(buildSrc): add missing hasType extension function
Browse files Browse the repository at this point in the history
This checks if there's an extension of the specified type
  • Loading branch information
EdricChan03 committed May 6, 2024
1 parent 4d8378b commit a6e952e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package io.github.edricchan03.plugin.library

import io.github.edricchan03.plugin.library.extensions.LibraryPluginExtension
import org.gradle.api.Project
import org.gradle.api.plugins.ExtensionContainer
import org.gradle.api.publish.maven.MavenPom
import org.gradle.kotlin.dsl.findByType
import org.gradle.util.Path as GradleProjectPath

internal val Project.pathAsFilePath
Expand Down Expand Up @@ -64,6 +66,8 @@ fun MavenPom.setConventions(project: Project, extension: LibraryPluginExtension)
}
}

internal inline fun <reified T : Any> ExtensionContainer.hasType() = findByType<T>() != null

/** The GitHub repository for the project. */
const val SOURCE_URL = "https://github.com/EdricChan03/androidx-ktx-extras"

Expand Down

0 comments on commit a6e952e

Please sign in to comment.