André Martins
03/18/2022, 4:28 PMephemient
03/18/2022, 4:31 PMAndré Martins
03/18/2022, 4:32 PMAndré Martins
03/18/2022, 4:32 PMAndré Martins
03/18/2022, 4:34 PMAndré Martins
03/18/2022, 4:35 PMAndré Martins
03/18/2022, 4:36 PMpluginManagement {
repositories {
maven(url = "uri")
gradlePluginPortal()
mavenCentral()
}
resolutionStrategy {
eachPlugin {
when(requested.id.namespace) {
"my.namespace" -> useModule("${requested.id.namespace}:${requested.id.name}:${requested.version}")
}
}
}
}
André Martins
03/18/2022, 4:41 PMplugins {
id("my.namespace.pluginName") version "version"
}
Sam
03/18/2022, 4:44 PMgradlePlugin {
plugins {
register("My Plugin") {
id = "namespace.pluginName"
implementationClass = "com.example.Whatever"
}
}
}
Sam
03/18/2022, 4:45 PMAndré Martins
03/18/2022, 4:45 PMephemient
03/18/2022, 4:45 PMgradlePlugin
creates metadata in the jar's META-INF
for each declared pluginSam
03/18/2022, 4:46 PMephemient
03/18/2022, 4:46 PMAndré Martins
03/18/2022, 4:50 PMAndré Martins
03/18/2022, 4:52 PMSam
03/18/2022, 4:53 PMSam
03/18/2022, 4:53 PMAndré Martins
03/18/2022, 4:54 PMephemient
03/18/2022, 4:54 PMephemient
03/18/2022, 4:55 PMephemient
03/18/2022, 4:55 PMephemient
03/18/2022, 4:57 PMAndré Martins
03/18/2022, 4:58 PMapply plugin: …
in groovyAndré Martins
03/18/2022, 4:59 PMephemient
03/18/2022, 4:59 PMapply plugin:
?André Martins
03/18/2022, 4:59 PMephemient
03/18/2022, 5:01 PMbuildscript
+ apply
in gradle.kts, it should work just like in groovy, you just won't get any type-safe accessorsAndré Martins
03/18/2022, 5:01 PMAndré Martins
03/18/2022, 5:01 PMAndré Martins
03/18/2022, 5:02 PMAndré Martins
03/18/2022, 5:03 PMbuildscript {
repositories {
clear()
maven {
url myRepo
}
mavenCentral()
}
dependencies {
classpath 'namespace:plugin:version'
}
}
apply plugin: "pluginId"
ephemient
03/18/2022, 5:08 PMbuildscript { repositories { ... } }
for buildscript, or pluginManagement { repositories { ... } }
for pluginsAndré Martins
03/18/2022, 5:09 PMAndré Martins
03/18/2022, 5:09 PMAndré Martins
03/18/2022, 5:09 PMAndré Martins
03/18/2022, 5:09 PM