diff --git a/y9plugins/build.gradle b/y9plugins/build.gradle index b32e261..593cfbd 100644 --- a/y9plugins/build.gradle +++ b/y9plugins/build.gradle @@ -1,4 +1,7 @@ +import org.gradle.internal.composite.ChildBuildRegisteringSettingsLoader + plugins { + id 'groovy-gradle-plugin' id 'com.gradle.plugin-publish' version '1.3.0' //这个plugin本身已经包含了Java-gradle-plugin和maven-publish } @@ -8,10 +11,43 @@ version = '1.0' gradlePlugin { website = 'https://svn.youshengyun.com:3000/risesoft/y9-build-logic' vcsUrl = 'https://svn.youshengyun.com:3000/risesoft/y9-build-logic' - -} + plugins{ + project.afterEvaluate { + removeIf { it.id.equals 'net.risesoft.y9.aspectj'} + register('y9aspectj') { + id = 'net.risesoft.y9.aspectj' + implementationClass = "NetRisesoftY9AspectjPlugin" + displayName = "Gradle convention plugin that using aspectj" + description = "Gradle convention plugin for y9digitalbase aspectj" + tags.addAll('y9','y9digitalbase','risesoft') + } -// https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html#sub:disabling-gmm-publication -tasks.withType(GenerateModuleMetadata) { - enabled = false + removeIf { it.id.equals 'net.risesoft.y9.docker'} + register('y9docker') { + id = 'net.risesoft.y9.docker' + implementationClass = "NetRisesoftY9DockerPlugin" + displayName = "Gradle convention plugin that using docker" + description = "Gradle convention plugin for y9digitalbase docker" + tags.addAll('y9','y9digitalbase','risesoft') + } + + removeIf { it.id.equals 'net.risesoft.y9.java-conventions'} + register('y9javaConventions') { + id = 'net.risesoft.y9.java-conventions' + implementationClass = "NetRisesoftY9JavaConventionsPlugin" + displayName = "Gradle convention plugin that using java" + description = "Gradle convention plugin for y9digitalbase java convention" + tags.addAll('y9','y9digitalbase','risesoft') + } + + removeIf { it.id.equals 'net.risesoft.y9.smart-doc'} + register('y9SmartDoc') { + id = 'net.risesoft.y9.smart-doc' + implementationClass = "NetRisesoftY9SmartDocPlugin" + displayName = "Gradle convention plugin that using smart doc" + description = "Gradle convention plugin for y9digitalbase smart doc" + tags.addAll('y9','y9digitalbase','risesoft') + } + } + } } \ No newline at end of file diff --git a/y9plugins/src/main/java/net/risesoft/y9/AspectjPlugin.java b/y9plugins/src/main/java/net/risesoft/y9/AspectjPlugin.java deleted file mode 100644 index f6a520d..0000000 --- a/y9plugins/src/main/java/net/risesoft/y9/AspectjPlugin.java +++ /dev/null @@ -1,14 +0,0 @@ -package net.risesoft.y9; - -import org.gradle.api.NonNullApi; -import org.gradle.api.Plugin; -import org.gradle.api.Project; - -@NonNullApi -abstract public class AspectjPlugin implements Plugin { - - @Override - public void apply(Project project) { - project.getPlugins().apply("io.freefair.aspectj.post-compile-weaving"); - } -} diff --git a/y9plugins/src/main/java/net/risesoft/y9/DockerPlugin.java b/y9plugins/src/main/java/net/risesoft/y9/DockerPlugin.java deleted file mode 100644 index a0f7384..0000000 --- a/y9plugins/src/main/java/net/risesoft/y9/DockerPlugin.java +++ /dev/null @@ -1,14 +0,0 @@ -package net.risesoft.y9; - -import org.gradle.api.NonNullApi; -import org.gradle.api.Plugin; -import org.gradle.api.Project; - -@NonNullApi -abstract public class DockerPlugin implements Plugin { - - @Override - public void apply(Project project) { - project.getPlugins().apply("io.freefair.aspectj.post-compile-weaving"); - } -} diff --git a/y9plugins/src/main/java/net/risesoft/y9/JavaConventionsPlugin.java b/y9plugins/src/main/java/net/risesoft/y9/JavaConventionsPlugin.java deleted file mode 100644 index 454a565..0000000 --- a/y9plugins/src/main/java/net/risesoft/y9/JavaConventionsPlugin.java +++ /dev/null @@ -1,14 +0,0 @@ -package net.risesoft.y9; - -import org.gradle.api.NonNullApi; -import org.gradle.api.Plugin; -import org.gradle.api.Project; - -@NonNullApi -abstract public class JavaConventionsPlugin implements Plugin { - - @Override - public void apply(Project project) { - project.getPlugins().apply("io.freefair.aspectj.post-compile-weaving"); - } -} diff --git a/y9plugins/src/main/java/net/risesoft/y9/SmartDocPlugin.java b/y9plugins/src/main/java/net/risesoft/y9/SmartDocPlugin.java deleted file mode 100644 index d45fac9..0000000 --- a/y9plugins/src/main/java/net/risesoft/y9/SmartDocPlugin.java +++ /dev/null @@ -1,15 +0,0 @@ -package net.risesoft.y9; - -import org.gradle.api.NonNullApi; -import org.gradle.api.Plugin; -import org.gradle.api.Project; - -@NonNullApi -abstract public class SmartDocPlugin implements Plugin { - - @Override - public void apply(Project project) { - project.getPlugins().apply("io.freefair.aspectj.post-compile-weaving"); - } -} -