Repository: avaje/avaje-inject
Pull request #601 (2024-06-10 03:19:32)

Split AOP into a separate module
- makes AOP into a separate module added as a transitive dep to inject


Patch:
diff --git a/blackbox-aspect/src/main/java/module-info.java b/blackbox-aspect/src/main/java/module-info.java
index 27c8c20c..d6cabc4d 100644
--- a/blackbox-aspect/src/main/java/module-info.java
+++ b/blackbox-aspect/src/main/java/module-info.java
@@ -1,6 +1,7 @@
 module blackbox.aspect {
 
   requires io.avaje.inject;
+  requires io.avaje.inject.aop;
 
   //remove this and compilation fails
   provides io.avaje.inject.spi.InjectSPI with org.example.external.aspect.sub.ExampleExternalAspectModule;
diff --git a/inject-aop/pom.xml b/inject-aop/pom.xml
new file mode 100644
index 00000000..068f0778
--- /dev/null
+++ b/inject-aop/pom.xml
@@ -0,0 +1,20 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>io.avaje</groupId>
+    <artifactId>avaje-inject-parent</artifactId>
+    <version>10.0-RC6</version>
+  </parent>
+  <artifactId>avaje-inject-aop</artifactId>
+  <dependencies>
+    <!-- test dependencies -->
+    <dependency>
+      <groupId>io.avaje</groupId>
+      <artifactId>junit</artifactId>
+      <version>1.5</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/inject/src/main/java/io/avaje/inject/aop/AOPFallback.java b/inject-aop/src/main/java/io/avaje/inject/aop/AOPFallback.java
similarity index 100%
rename from inject/src/main/java/io/avaje/inject/aop/AOPFallback.java
rename to inject-aop/src/main/java/io/avaje/inject/aop/AOPFallback.java
diff --git a/inject/src/main/java/io/avaje/inject/aop/Aspect.java b/inject-aop/src/main/java/io/avaje/inject/aop/Aspect.java
similarity index 100%
rename from inject/src/main/java/io/avaje/inject/aop/Aspect.java
rename to inject-aop/src/main/java/io/avaje/inject/aop/Aspect.java
diff --git a/inject/src/main/java/io/avaje/inject/aop/AspectProvider.java b/inject-aop/src/main/java/io/avaje/inject/aop/AspectProvider.java
similarity index 100%
rename from inject/src/main/java/io/avaje/inject/aop/AspectProvider.java
rename to inject-aop/src/main/java/io/avaje/inject/aop/AspectProvider.java
diff --git a/inject/src/main/java/io/avaje/inject/aop/Invocation.java b/inject-aop/src/main/java/io/avaje/inject/aop/Invocation.java
similarity index 100%
rename from inject/src/main/java/io/avaje/inject/aop/Invocation.java
rename to inject-aop/src/main/java/io/avaje/inject/aop/Invocation.java
diff --git a/inject/src/main/java/io/avaje/inject/aop/InvocationException.java b/inject-aop/src/main/java/io/avaje/inject/aop/InvocationException.java
similarity index 100%
rename from inject/src/main/java/io/avaje/inject/aop/InvocationException.java
rename to inject-aop/src/main/java/io/avaje/inject/aop/InvocationException.java
diff --git a/inject/src/main/java/io/avaje/inject/aop/MethodInterceptor.java b/inject-aop/src/main/java/io/avaje/inject/aop/MethodInterceptor.java
similarity index 100%
rename from inject/src/main/java/io/avaje/inject/aop/MethodInterceptor.java
rename to inject-aop/src/main/java/io/avaje/inject/aop/MethodInterceptor.java
diff --git a/inject/src/main/java/io/avaje/inject/aop/package-info.java b/inject-aop/src/main/java/io/avaje/inject/aop/package-info.java
similarity index 100%
rename from inject/src/main/java/io/avaje/inject/aop/package-info.java
rename to inject-aop/src/main/java/io/avaje/inject/aop/package-info.java
diff --git a/inject-aop/src/main/java/module-info.java b/inject-aop/src/main/java/module-info.java
new file mode 100644
index 00000000..cbe5fd49
--- /dev/null
+++ b/inject-aop/src/main/java/module-info.java
@@ -0,0 +1,5 @@
+module io.avaje.inject.aop {
+
+  exports io.avaje.inject.aop;
+
+}
diff --git a/inject/src/test/java/io/avaje/inject/aop/InvocationCallTest.java b/inject-aop/src/test/java/io/avaje/inject/aop/InvocationCallTest.java
similarity index 100%
rename from inject/src/test/java/io/avaje/inject/aop/InvocationCallTest.java
rename to inject-aop/src/test/java/io/avaje/inject/aop/InvocationCallTest.java
diff --git a/inject/src/test/java/io/avaje/inject/aop/InvocationFallbackRawTest.java b/inject-aop/src/test/java/io/avaje/inject/aop/InvocationFallbackRawTest.java
similarity index 100%
rename from inject/src/test/java/io/avaje/inject/aop/InvocationFallbackRawTest.java
rename to inject-aop/src/test/java/io/avaje/inject/aop/InvocationFallbackRawTest.java
diff --git a/inject/src/test/java/io/avaje/inject/aop/InvocationFallbackTest.java b/inject-aop/src/test/java/io/avaje/inject/aop/InvocationFallbackTest.java
similarity index 100%
rename from inject/src/test/java/io/avaje/inject/aop/InvocationFallbackTest.java
rename to inject-aop/src/test/java/io/avaje/inject/aop/InvocationFallbackTest.java
diff --git a/inject/src/test/java/io/avaje/inject/aop/InvocationRunTest.java b/inject-aop/src/test/java/io/avaje/inject/aop/InvocationRunTest.java
similarity index 100%
rename from inject/src/test/java/io/avaje/inject/aop/InvocationRunTest.java
rename to inject-aop/src/test/java/io/avaje/inject/aop/InvocationRunTest.java
diff --git a/inject-generator/src/main/java/module-info.java b/inject-generator/src/main/java/module-info.java
index 76013e98..cf8df601 100644
--- a/inject-generator/src/main/java/module-info.java
+++ b/inject-generator/src/main/java/module-info.java
@@ -2,7 +2,9 @@ module io.avaje.inject.generator {
 
   requires java.compiler;
   requires io.avaje.inject;
+  requires io.avaje.inject.aop;
   requires io.avaje.inject.events;
+
   requires static io.avaje.prism;
 
   uses io.avaje.inject.spi.InjectSPI;
diff --git a/inject/pom.xml b/inject/pom.xml
index f59bf564..c8ae69be 100644
--- a/inject/pom.xml
+++ b/inject/pom.xml
@@ -18,6 +18,12 @@
       <version>2.0.1</version> <!-- jakarta -->
     </dependency>
 
+    <dependency>
+      <groupId>io.avaje</groupId>
+      <artifactId>avaje-inject-aop</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    
     <dependency>
       <groupId>io.avaje</groupId>
       <artifactId>avaje-lang</artifactId>
diff --git a/inject/src/main/java/module-info.java b/inject/src/main/java/module-info.java
index 625b62c5..a4ac4a86 100644
--- a/inject/src/main/java/module-info.java
+++ b/inject/src/main/java/module-info.java
@@ -1,7 +1,6 @@
 module io.avaje.inject {
 
   exports io.avaje.inject;
-  exports io.avaje.inject.aop;
   exports io.avaje.inject.spi;
 
   requires transitive io.avaje.lang;
diff --git a/jakarta-to-javax.sh b/jakarta-to-javax.sh
index 84ab6fd6..7a12209a 100755
--- a/jakarta-to-javax.sh
+++ b/jakarta-to-javax.sh
@@ -4,6 +4,7 @@
 
 sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' pom.xml
 sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' inject/pom.xml
+sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' inject-aop/pom.xml
 sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' inject-events/pom.xml
 sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' inject-generator/pom.xml
 sed -i -E '0,/<version>[^<]*<\/version>/ s/<version>([^-]*)-?([^<]*)(<\/version>)/<version>\1-javax\2\3/' inject-test/pom.xml
diff --git a/javax-to-jakarta.sh b/javax-to-jakarta.sh
index c0176051..d3384c41 100755
--- a/javax-to-jakarta.sh
+++ b/javax-to-jakarta.sh
@@ -4,6 +4,7 @@
 
 sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' pom.xml
 sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' inject/pom.xml
+sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' inject-aop/pom.xml
 sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' inject-events/pom.xml
 sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' inject-generator/pom.xml
 sed -i 's/\(<version>[^<]*\)-javax\([^<]*<\/version>\)/\1\2/' inject-test/pom.xml
diff --git a/pom.xml b/pom.xml
index 1541f7b1..5d3f0ccd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,6 +27,7 @@
     <module>inject-events</module>
     <module>inject-generator</module>
     <module>inject-test</module>
+    <module>inject-aop</module>
   </modules>
 
   <profiles>


Test patch:
diff --git a/inject-test/src/main/java/module-info.java b/inject-test/src/main/java/module-info.java
index 4500839e..0ff8c697 100644
--- a/inject-test/src/main/java/module-info.java
+++ b/inject-test/src/main/java/module-info.java
@@ -3,6 +3,7 @@ module io.avaje.inject.test {
   exports io.avaje.inject.test;
 
   requires transitive io.avaje.inject;
+  requires transitive io.avaje.inject.aop;
   requires transitive org.junit.jupiter.engine;
   requires transitive org.junit.jupiter.api;
   requires static org.apiguardian.api; // needed for javadoc