-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2652 from square/bquenaudon.2023-09-18.internalpl…
…ugin Introduce internal plugin
- Loading branch information
Showing
32 changed files
with
592 additions
and
632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Wire Settings Plugin | ||
|
||
This is a Gradle plugin applied to the root `settings.gradle` via `includeBuild` | ||
which automatically adds the `build-support/` Gradle plugin to all projects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
`java-gradle-plugin` | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
create("wireSettings") { | ||
id = "com.squareup.wire.settings" | ||
displayName = "Wire settings plugin" | ||
description = "Gradle plugin for Wire build settings" | ||
implementationClass = "com.squareup.wire.buildsettings.WireSettingsPlugin" | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
google() | ||
} |
Empty file.
24 changes: 24 additions & 0 deletions
24
build-support/settings/src/main/kotlin/com/squareup/wire/buildsettings/WireSettingsPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.squareup.wire.buildsettings | ||
|
||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.api.initialization.Settings | ||
|
||
@Suppress("unused") // Invoked reflectively by Gradle. | ||
class WireSettingsPlugin : Plugin<Settings> { | ||
override fun apply(target: Settings) { | ||
fun applyWireBuildPlugin(project: Project) { | ||
project.plugins.apply("com.squareup.wire.build") | ||
} | ||
|
||
target.gradle.allprojects { | ||
if (project.path == ":") { | ||
// The root project needs to evaluate the buildscript classpath before applying. | ||
// Once we move to the plugins DSL in the main build we can remove this conditional. | ||
project.afterEvaluate(::applyWireBuildPlugin) | ||
} else { | ||
project.beforeEvaluate(::applyWireBuildPlugin) | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.