From 4b8a239025be42fdbee642ab27ba3da913d89533 Mon Sep 17 00:00:00 2001 From: dingzhaojun Date: Thu, 17 Oct 2024 10:47:57 +0800 Subject: [PATCH] add java plugin --- y9plugins/build.gradle | 1 - .../main/java/net/risesoft/y9/AspectjPlugin.java | 14 ++++++++++++++ .../main/java/net/risesoft/y9/DockerPlugin.java | 14 ++++++++++++++ .../net/risesoft/y9/JavaConventionsPlugin.java | 14 ++++++++++++++ .../main/java/net/risesoft/y9/SmartDocPlugin.java | 15 +++++++++++++++ 5 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 y9plugins/src/main/java/net/risesoft/y9/AspectjPlugin.java create mode 100644 y9plugins/src/main/java/net/risesoft/y9/DockerPlugin.java create mode 100644 y9plugins/src/main/java/net/risesoft/y9/JavaConventionsPlugin.java create mode 100644 y9plugins/src/main/java/net/risesoft/y9/SmartDocPlugin.java diff --git a/y9plugins/build.gradle b/y9plugins/build.gradle index 22f828f..b32e261 100644 --- a/y9plugins/build.gradle +++ b/y9plugins/build.gradle @@ -1,5 +1,4 @@ plugins { - id 'groovy-gradle-plugin' //groovy DSL id 'com.gradle.plugin-publish' version '1.3.0' //这个plugin本身已经包含了Java-gradle-plugin和maven-publish } diff --git a/y9plugins/src/main/java/net/risesoft/y9/AspectjPlugin.java b/y9plugins/src/main/java/net/risesoft/y9/AspectjPlugin.java new file mode 100644 index 0000000..f6a520d --- /dev/null +++ b/y9plugins/src/main/java/net/risesoft/y9/AspectjPlugin.java @@ -0,0 +1,14 @@ +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 new file mode 100644 index 0000000..a0f7384 --- /dev/null +++ b/y9plugins/src/main/java/net/risesoft/y9/DockerPlugin.java @@ -0,0 +1,14 @@ +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 new file mode 100644 index 0000000..454a565 --- /dev/null +++ b/y9plugins/src/main/java/net/risesoft/y9/JavaConventionsPlugin.java @@ -0,0 +1,14 @@ +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 new file mode 100644 index 0000000..d45fac9 --- /dev/null +++ b/y9plugins/src/main/java/net/risesoft/y9/SmartDocPlugin.java @@ -0,0 +1,15 @@ +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"); + } +} +