Skip to content

Commit

Permalink
Fix the project isolation issues (#1145)
Browse files Browse the repository at this point in the history
* Fix the project isolation issues

With the new project isolation feature in Gradle there are restrictions
on what you can access on a `Project` instance for another module.

* Fix the build error
  • Loading branch information
ansman authored Sep 6, 2024
1 parent 76cfb4e commit a8e7257
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import org.gradle.api.logging.Logger
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.findByType
import org.gradle.kotlin.dsl.withType
import org.gradle.util.GradleVersion

/**
* Validates required dependencies. If GPP can't run in the current context, an error will be
* thrown.
*/
fun Project.validateRuntime() {
rootProject.plugins.apply(RuntimeValidationPlugin::class)

project.plugins.withType<AppPlugin> {
GradleRuntimeValidator(GradleVersion.current(), MIN_GRADLE_VERSION).validate()
plugins.withType<AppPlugin> {
val agpPluginVersion = extensions.findByType<ApplicationAndroidComponentsExtension>()?.pluginVersion
AgpRuntimeValidator(agpPluginVersion, MIN_AGP_VERSION).validate()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ internal abstract class PlayPublisherPlugin @Inject constructor(
}

private fun applyInternal(project: Project) {
val executionDir = project.rootProject.layout.projectDirectory
val executionDir = project.objects.directoryProperty()
.apply { set(project.rootDir) }
.get()
val cliOptionsExtension = project.objects.newInstance<CliPlayPublisherExtension>()
val bootstrapOptionsHolder = BootstrapOptions.Holder()

Expand Down

0 comments on commit a8e7257

Please sign in to comment.