com.freeletics.gradle.monorepo.plugin.DomainAndroidPlugin.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plugins Show documentation
Show all versions of plugins Show documentation
A set of reusable Gradle plugins
package com.freeletics.gradle.monorepo.plugin
import com.freeletics.gradle.monorepo.setup.applyPlatformConstraints
import com.freeletics.gradle.monorepo.setup.disableAndroidLibraryTasks
import com.freeletics.gradle.monorepo.tasks.CheckDependencyRulesTask.Companion.registerCheckDependencyRulesTasks
import com.freeletics.gradle.monorepo.util.ProjectType
import com.freeletics.gradle.monorepo.util.appType
import com.freeletics.gradle.monorepo.util.projectType
import com.freeletics.gradle.plugin.FreeleticsAndroidPlugin
import com.freeletics.gradle.util.freeleticsAndroidExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
public abstract class DomainAndroidPlugin : Plugin {
override fun apply(target: Project) {
target.plugins.apply(FreeleticsAndroidPlugin::class.java)
target.freeleticsAndroidExtension.minSdkVersion(target.appType()?.minSdkVersion(target))
target.freeleticsAndroidExtension.enableParcelize()
target.registerCheckDependencyRulesTasks(
allowedProjectTypes = listOf(
ProjectType.DOMAIN_API,
ProjectType.DOMAIN_IMPLEMENTATION,
ProjectType.DOMAIN_TESTING,
),
allowedDependencyProjectTypes = listOfNotNull(
ProjectType.CORE_API,
ProjectType.CORE_TESTING,
ProjectType.DOMAIN_API,
ProjectType.DOMAIN_TESTING,
if (target.projectType() == ProjectType.DOMAIN_IMPLEMENTATION) ProjectType.FEATURE_NAV else null,
),
)
target.applyPlatformConstraints()
target.disableAndroidLibraryTasks()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy