mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 21:07:04 +05:30
fix(build): avoid most project isolation violations
This commit is contained in:
parent
0151a4d1d6
commit
c72ba1ab97
3 changed files with 10 additions and 6 deletions
|
@ -17,11 +17,11 @@ import org.gradle.kotlin.dsl.withType
|
|||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
@Suppress("Unused")
|
||||
@Suppress("Unused", "UnstableApiUsage")
|
||||
class KotlinCommonPlugin : Plugin<Project> {
|
||||
|
||||
override fun apply(project: Project) {
|
||||
if (project.rootProject == project) {
|
||||
if (project.isolated.rootProject == project.isolated) {
|
||||
LintConfig.configureRootProject(project)
|
||||
} else if (project.name != "benchmark") {
|
||||
LintConfig.configureSubProject(project)
|
||||
|
|
|
@ -16,11 +16,11 @@ import org.gradle.kotlin.dsl.apply
|
|||
import org.gradle.kotlin.dsl.configure
|
||||
import org.gradle.kotlin.dsl.withType
|
||||
|
||||
@Suppress("Unused")
|
||||
@Suppress("Unused", "UnstableApiUsage")
|
||||
class SpotlessPlugin : Plugin<Project> {
|
||||
|
||||
override fun apply(project: Project) {
|
||||
if (project.rootProject != project) {
|
||||
if (project.isolated.rootProject != project.isolated) {
|
||||
throw GradleException("Spotless plugin must only be applied to the root project.")
|
||||
}
|
||||
project.pluginManager.apply(SpotlessPlugin::class)
|
||||
|
|
|
@ -14,8 +14,9 @@ import org.gradle.api.Project
|
|||
private const val KEYSTORE_CONFIG_PATH = "keystore.properties"
|
||||
|
||||
/** Configure signing for all build types. */
|
||||
@Suppress("UnstableApiUsage")
|
||||
internal fun Project.configureBuildSigning() {
|
||||
val keystoreConfigFile = rootProject.layout.projectDirectory.file(KEYSTORE_CONFIG_PATH)
|
||||
val keystoreConfigFile = isolated.rootProject.projectDirectory.file(KEYSTORE_CONFIG_PATH)
|
||||
if (keystoreConfigFile.asFile.exists()) {
|
||||
extensions.configure<CommonExtension<*, ApplicationBuildType, *, *, *, *>>("android") {
|
||||
val contents = providers.fileContents(keystoreConfigFile).asText
|
||||
|
@ -25,7 +26,10 @@ internal fun Project.configureBuildSigning() {
|
|||
signingConfigs.register("release") {
|
||||
keyAlias = keystoreProperties["keyAlias"] as String
|
||||
keyPassword = keystoreProperties["keyPassword"] as String
|
||||
storeFile = rootProject.file(keystoreProperties["storeFile"] as String)
|
||||
storeFile =
|
||||
isolated.rootProject.projectDirectory
|
||||
.file(keystoreProperties["storeFile"] as String)
|
||||
.asFile
|
||||
storePassword = keystoreProperties["storePassword"] as String
|
||||
}
|
||||
buildTypes.configureEach { signingConfig = releaseSigningConfig.get() }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue