[java-idp-plugin-archetype] branch main updated: Move plugin and module classes to impl

Phil Smart philip.smart at jisc.ac.uk
Thu Aug 31 17:27:10 UTC 2023


This is an automated email from the git hooks/post-receive script.

philsmart pushed a commit to branch main
in repository java-idp-plugin-archetype.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-archetype.git;a=commit;h=ea8eb8909340dc2eb58d8d9bcd5e65d40aaa5727

The following commit(s) were added to refs/heads/main by this push:
     new ea8eb89  Move plugin and module classes to impl
ea8eb89 is described below

commit ea8eb8909340dc2eb58d8d9bcd5e65d40aaa5727
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Thu Aug 31 18:26:55 2023 +0100

    Move plugin and module classes to impl
---
 src/main/resources/META-INF/archetype-post-generate.groovy  | 13 +++++++++++++
 .../plugin-impl/src/main/java/ExampleModule.java            |  2 +-
 .../plugin-impl/src/main/java/ExamplePlugin.java            |  2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/META-INF/archetype-post-generate.groovy b/src/main/resources/META-INF/archetype-post-generate.groovy
index 5752208..8896c86 100644
--- a/src/main/resources/META-INF/archetype-post-generate.groovy
+++ b/src/main/resources/META-INF/archetype-post-generate.groovy
@@ -25,6 +25,19 @@ apiDir.renameTo(apiRenameDir);
 distDir.renameTo(distRenameDir);
 println 'Renaming module directories to include pluginBase...done'
 
+println 'Creating an impl directory and moving impl classes over...'
+
+def packageDirectory = request.getPackage()replaceAll('\\.','/');
+def examplePluginFile = new File(implRenameDir, "/src/main/java/"+packageDirectory+"/ExamplePlugin.java");
+def exampleModuleFile = new File(implRenameDir, "/src/main/java/"+packageDirectory+"/ExampleModule.java");
+def packageImplDirectory = new File(implRenameDir, "/src/main/java/"+packageDirectory+"/impl");
+println("New impl directory: "+packageImplDirectory);
+packageImplDirectory.mkdirs();
+examplePluginFile.renameTo(new File(packageImplDirectory,"/ExamplePlugin.java").getPath());
+exampleModuleFile.renameTo(new File(packageImplDirectory,"/ExampleModule.java").getPath());
+
+println 'Creating an impl directory and moving impl classes over...done'
+
 /**
  * Create a bin, doc and views directory in the impl module
  */
diff --git a/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExampleModule.java b/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExampleModule.java
index 5e894f3..f0dd580 100644
--- a/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExampleModule.java
+++ b/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExampleModule.java
@@ -1,4 +1,4 @@
-package ${package};
+package ${package}.impl;
 
 import java.io.IOException;
 
diff --git a/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExamplePlugin.java b/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExamplePlugin.java
index e6ed0a7..0bd5659 100644
--- a/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExamplePlugin.java
+++ b/src/main/resources/archetype-resources/plugin-impl/src/main/java/ExamplePlugin.java
@@ -1,4 +1,4 @@
-package ${package};
+package ${package}.impl;
 
 import java.io.IOException;
 import javax.annotation.Nonnull;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list