All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.javiersc.hubdle.project.extensions._internal.hasPluginExensions.kt Maven / Gradle / Ivy

There is a newer version: 0.7.18
Show newest version
package com.javiersc.hubdle.project.extensions._internal

import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper

internal val Project.isAndroidApplication: Boolean
    get() = pluginManager.hasPlugin("com.android.application")

internal val Project.isAndroidLibrary: Boolean
    get() = pluginManager.hasPlugin("com.android.library") && isKotlinMultiplatform.not()

internal val Project.isGradlePlugin: Boolean
    get() = pluginManager.hasPlugin("org.gradle.java-gradle-plugin")

internal val Project.isJavaPlatform: Boolean
    get() = pluginManager.hasPlugin("org.gradle.java-platform")

internal val Project.isKotlin: Boolean
    get() =
        isKotlinJvm ||
            isKotlinMultiplatform ||
            isKotlinMultiplatformWithAndroid ||
            hasKotlinGradlePlugin

internal val Project.isKotlinJvm: Boolean
    get() = pluginManager.hasPlugin("org.jetbrains.kotlin.jvm")

internal val Project.isKotlinMultiplatform: Boolean
    get() = pluginManager.hasPlugin("org.jetbrains.kotlin.multiplatform")

internal val Project.isKotlinMultiplatformWithAndroid: Boolean
    get() = isKotlinMultiplatform && pluginManager.hasPlugin("com.android.library")

internal val Project.isVersionCatalog: Boolean
    get() = pluginManager.hasPlugin("org.gradle.version-catalog")

internal val Project.hasKotlinGradlePlugin: Boolean
    get() = plugins.asSequence().mapNotNull { (it as? KotlinBasePluginWrapper) }.count() > 0




© 2015 - 2024 Weber Informatics LLC | Privacy Policy