Skip to content

Commit

Permalink
Fix Gradle project isolation issue when reading a property (#3078)
Browse files Browse the repository at this point in the history
Project.getProperties is not Gradle project isolation safe
as it attempts to also include properties from parent projects.

Instead use providers.gradleProperty that only checks gradle properties
in a given project.

Project isolation feature description
https://docs.gradle.org/current/userguide/isolated_projects.html
  • Loading branch information
liutikas authored and oldergod committed Oct 9, 2024
1 parent a19076a commit 4389e5d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class WirePlugin : Plugin<Project> {
if (!hasJavaOutput && !hasKotlinOutput) return

// Indicates when the plugin is applied inside the Wire repo to Wire's own modules.
val isInternalBuild = project.properties["com.squareup.wire.internal"].toString() == "true"
val isInternalBuild = project.providers.gradleProperty("com.squareup.wire.internal").getOrElse("false").toBoolean()
val isMultiplatform = project.plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")
val isJsOnly =
if (isMultiplatform) false else project.plugins.hasPlugin("org.jetbrains.kotlin.js")
Expand Down

0 comments on commit 4389e5d

Please sign in to comment.