From 11ea094a63803e02d19fdea0b2b35f9a8dbdef7b Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Fri, 7 Jun 2024 09:26:18 +0200 Subject: [PATCH] [FEAT] use Maven a build system root tool --- .checkstyle | 2 +- .classpath | 12 ++- .project | 11 ++ lutin_org-atriasoft-egami.py | 2 +- pom.xml | 123 ++++++++++++++++++++++ src/module-info.java | 3 +- src/org/atriasoft/egami/internal/Log.java | 76 ------------- 7 files changed, 145 insertions(+), 84 deletions(-) create mode 100644 pom.xml delete mode 100644 src/org/atriasoft/egami/internal/Log.java diff --git a/.checkstyle b/.checkstyle index 428926e..5783bc0 100644 --- a/.checkstyle +++ b/.checkstyle @@ -1,7 +1,7 @@ - + diff --git a/.classpath b/.classpath index c1b4392..50809b8 100644 --- a/.classpath +++ b/.classpath @@ -1,13 +1,15 @@ - + + - + + @@ -15,10 +17,10 @@ - + - + - + diff --git a/.project b/.project index 1dffbe9..10a2ec6 100644 --- a/.project +++ b/.project @@ -6,6 +6,11 @@ atriasoft-egami + + org.python.pydev.PyDevBuilder + + + org.eclipse.jdt.core.javabuilder @@ -16,8 +21,14 @@ + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.m2e.core.maven2Nature org.eclipse.jdt.core.javanature net.sf.eclipsecs.core.CheckstyleNature diff --git a/lutin_org-atriasoft-egami.py b/lutin_org-atriasoft-egami.py index 10af6c9..19278bc 100644 --- a/lutin_org-atriasoft-egami.py +++ b/lutin_org-atriasoft-egami.py @@ -37,7 +37,7 @@ def configure(target, my_module): 'src/org/atriasoft/egami/ImageByte.java', 'src/org/atriasoft/egami/ImageFloatRGB.java', 'src/org/atriasoft/egami/ImageByteRGB.java', - 'src/org/atriasoft/egami/internal/Log.java', + 'src/org/atriasoft/egami/internal/LOGGER.java', 'src/org/atriasoft/egami/ImageFloat.java', 'src/org/atriasoft/egami/Image.java', 'src/org/atriasoft/egami/ImageType.java', diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..7c56081 --- /dev/null +++ b/pom.xml @@ -0,0 +1,123 @@ + + 4.0.0 + org.atriasoft + egami + 0.1.0 + + 3.13.0 + 21 + 21 + 3.1.1 + + + + + gitea + https://gitea.atria-soft.org/api/packages/org.atriasoft/maven + + + + + gitea + https://gitea.atria-soft.org/api/packages/org.atriasoft/maven + + + gitea + https://gitea.atria-soft.org/api/packages/org.atriasoft/maven + + + + + + org.atriasoft + etk + 0.1.0 + + + org.junit.jupiter + junit-jupiter-api + 5.9.3 + test + + + org.slf4j + slf4j-simple + 2.0.7 + test + + + + + src + test/src + ${project.basedir}/out/maven/ + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven.compiler.version} + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M5 + + + maven-assembly-plugin + + + + fully.qualified.MainClass + + + + jar-with-dependencies + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + private + true + + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + public + + + + + + diff --git a/src/module-info.java b/src/module-info.java index bb3d4d3..bec9944 100644 --- a/src/module-info.java +++ b/src/module-info.java @@ -4,6 +4,7 @@ open module org.atriasoft.egami { exports org.atriasoft.egami; + requires transitive org.atriasoft.etk; - requires transitive org.atriasoft.reggol; + //requires transitive org.atriasoft.reggol; } diff --git a/src/org/atriasoft/egami/internal/Log.java b/src/org/atriasoft/egami/internal/Log.java deleted file mode 100644 index d1f3165..0000000 --- a/src/org/atriasoft/egami/internal/Log.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.atriasoft.egami.internal; - -import org.atriasoft.reggol.LogLevel; -import org.atriasoft.reggol.Logger; - -public class Log { - private static final boolean FORCE_ALL = false; - private static final String LIB_NAME = "egami"; - private static final String LIB_NAME_DRAW = Logger.getDrawableName(Log.LIB_NAME); - private static final boolean PRINT_CRITICAL = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.CRITICAL); - private static final boolean PRINT_DEBUG = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.DEBUG); - private static final boolean PRINT_ERROR = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.ERROR); - private static final boolean PRINT_INFO = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.INFO); - private static final boolean PRINT_PRINT = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.PRINT); - private static final boolean PRINT_TODO = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.TODO); - private static final boolean PRINT_VERBOSE = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.VERBOSE); - private static final boolean PRINT_WARNING = Logger.getNeedPrint(Log.LIB_NAME, LogLevel.WARNING); - - public static void critical(final Exception e, final String data) { - e.printStackTrace(); - if (PRINT_CRITICAL || FORCE_ALL) { - Logger.critical(LIB_NAME_DRAW, data + " : " + e.getMessage()); - } - } - - public static void critical(final String data, final Object... objects) { - if (PRINT_CRITICAL || FORCE_ALL) { - Logger.critical(LIB_NAME_DRAW, data, objects); - } - } - - public static void debug(final String data, final Object... objects) { - if (PRINT_DEBUG || FORCE_ALL) { - Logger.debug(LIB_NAME_DRAW, data, objects); - } - } - - public static void error(final String data, final Object... objects) { - if (PRINT_ERROR || FORCE_ALL) { - Logger.error(LIB_NAME_DRAW, data, objects); - } - } - - public static void info(final String data, final Object... objects) { - if (PRINT_INFO || FORCE_ALL) { - Logger.info(LIB_NAME_DRAW, data, objects); - } - } - - public static void print(final String data, final Object... objects) { - if (PRINT_PRINT || FORCE_ALL) { - Logger.print(LIB_NAME_DRAW, data, objects); - } - } - - public static void todo(final String data, final Object... objects) { - if (PRINT_TODO || FORCE_ALL) { - Logger.todo(LIB_NAME_DRAW, data, objects); - } - } - - public static void verbose(final String data, final Object... objects) { - if (PRINT_VERBOSE || FORCE_ALL) { - Logger.verbose(LIB_NAME_DRAW, data, objects); - } - } - - public static void warning(final String data, final Object... objects) { - if (PRINT_WARNING || FORCE_ALL) { - Logger.warning(LIB_NAME_DRAW, data, objects); - } - } - - private Log() {} - -}