[DEV] correct build path

This commit is contained in:
Edouard DUPIN 2020-09-07 21:09:06 +02:00
parent 89b968393b
commit 3ae0ff9a06
4 changed files with 64 additions and 45 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/classes" path="src"> <classpathentry kind="src" path="src">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="test/src"> <classpathentry including="**/*.java" kind="src" output="out/eclipse/classes-test" path="test/src">
<attributes> <attributes>
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
@ -15,6 +15,7 @@
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-14"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-14">
<attributes> <attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
@ -23,10 +24,5 @@
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <classpathentry kind="output" path="out/eclipse/classes"/>
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -16,14 +16,8 @@
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature> <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
</natures> </natures>

View File

@ -6,7 +6,10 @@
xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
<property environment="env"/> <property environment="env"/>
<property name="version" value="0.1.0" /> <!-- <property name="version" value="0.1.0" /> -->
<loadfile property="version" srcFile="version.txt"/>
<property name="title" value="Generic Scenarium Logger"/>
<property name="vendor" value="scenarium.io"/>
<property name="debuglevel" value="source,lines,vars"/> <property name="debuglevel" value="source,lines,vars"/>
<!-- configure dependency of JAVA --> <!-- configure dependency of JAVA -->
@ -16,7 +19,7 @@
<property name="source.lib.dir" location="./src/" /> <property name="source.lib.dir" location="./src/" />
<property name="source.test.dir" location="./test/src/" /> <property name="source.test.dir" location="./test/src/" />
<property name="result.dir" location="./out/" /> <property name="result.dir" location="./out/ant/" />
<property name="result.jar.dir" location="${result.dir}/package" /> <property name="result.jar.dir" location="${result.dir}/package" />
<property name="result.javadoc.dir" location="${result.dir}/javadoc" /> <property name="result.javadoc.dir" location="${result.dir}/javadoc" />
<property name="result.juint.dir" location="${result.dir}/junit" /> <property name="result.juint.dir" location="${result.dir}/junit" />
@ -39,28 +42,31 @@
<classpath path="${extern.checkstyle.dir}/checkstyle-all.jar" /> <classpath path="${extern.checkstyle.dir}/checkstyle-all.jar" />
</taskdef> </taskdef>
<!-- <!--
mkdir -p extern/lib mkdir -p ~/extern/jacoco
cd extern/lib wget http://search.maven.org/remotecontent?filepath=org/jacoco/jacoco/0.8.5/jacoco-0.8.5.zip -O /tmp/jacoco.zip
wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-commons/1.6.2/junit-platform-commons-1.6.2.jar unzip -d /tmp/jacoco_unzip /tmp/jacoco.zip
wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-engine/1.6.2/junit-platform-engine-1.6.2.jar mv /tmp/jacoco_unzip/lib/*.jar ~/extern/jacoco
wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-launcher/1.6.2/junit-platform-launcher-1.6.2.jar rm -rf /tmp/jacoco_unzip /tmp/jacoco.zip
wget https://repo1.maven.org/maven2/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar
wget https://repo1.maven.org/maven2/junit/junit/4.13/junit-4.13.jar mkdir -p ~/extern/checkstyle
wget https://repo1.maven.org/maven2/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar wget https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.36/checkstyle-8.36-all.jar -O ~/extern/checkstyle/checkstyle-all.jar
wget https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-api/5.6.2/junit-jupiter-api-5.6.2.jar
wget https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-engine/5.6.2/junit-jupiter-engine-5.6.2.jar mkdir -p ~/extern/lib
wget https://repo1.maven.org/maven2/org/junit/vintage/junit-vintage-engine/5.6.2/junit-vintage-engine-5.6.2.jar wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-commons/1.6.2/junit-platform-commons-1.6.2.jar -O ~/extern/lib/junit-platform-commons.jar
wget https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-params/5.6.2/junit-jupiter-params-5.6.2.jar wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-engine/1.6.2/junit-platform-engine-1.6.2.jar -O ~/extern/lib/junit-platform-engine.jar
wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-runner/1.6.2/junit-platform-runner-1.6.2.jar wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-launcher/1.6.2/junit-platform-launcher-1.6.2.jar -O ~/extern/lib/junit-platform-launcher.jar
wget https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-migrationsupport/5.6.2/junit-jupiter-migrationsupport-5.6.2.jar wget https://repo1.maven.org/maven2/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar -O ~/extern/lib/opentest4j.jar
wget https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/2.2/hamcrest-core-2.2.jar wget https://repo1.maven.org/maven2/junit/junit/4.13/junit-4.13.jar -O ~/extern/lib/junit.jar
wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-suite-api/1.6.2/junit-platform-suite-api-1.6.2.jar wget https://repo1.maven.org/maven2/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar -O ~/extern/lib/apiguardian-api.jar
wget https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar wget https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-api/5.6.2/junit-jupiter-api-5.6.2.jar -O ~/extern/lib/junit-jupiter-api.jar
cd ../../ wget https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-engine/5.6.2/junit-jupiter-engine-5.6.2.jar -O ~/extern/lib/junit-jupiter-engine.jar
mkdir -p extern/checkstyle wget https://repo1.maven.org/maven2/org/junit/vintage/junit-vintage-engine/5.6.2/junit-vintage-engine-5.6.2.jar -O ~/extern/lib/junit-vintage-engine.jar
cd extern/checkstyle wget https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-params/5.6.2/junit-jupiter-params-5.6.2.jar -O ~/extern/lib/junit-jupiter-params.jar
wget https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.36/checkstyle-8.36-all.jar wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-runner/1.6.2/junit-platform-runner-1.6.2.jar -O ~/extern/lib/junit-platform-runner.jar
cd ../../ wget https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-migrationsupport/5.6.2/junit-jupiter-migrationsupport-5.6.2.jar -O ~/extern/lib/junit-jupiter-migrationsupport.jar
wget https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/2.2/hamcrest-core-2.2.jar -O ~/extern/lib/hamcrest-core.jar
wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-suite-api/1.6.2/junit-platform-suite-api-1.6.2.jar -O ~/extern/lib/junit-platform-suite-api.jar
wget https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar -O ~/extern/lib/hamcrest-core.jar
--> -->
<path id="junit.classpath"> <path id="junit.classpath">
<!-- keep all lib in this directiry--> <!-- keep all lib in this directiry-->
@ -82,11 +88,11 @@ cd ../../
<pathelement location="${basedir}/hamcrest-core-1.3.jar"/> <pathelement location="${basedir}/hamcrest-core-1.3.jar"/>
--> -->
</path> </path>
<path id="io.scenarium.logger.classpath"> <path id="library.classpath">
<pathelement location="${result.classes.lib.dir}"/> <pathelement location="${result.classes.lib.dir}"/>
</path> </path>
<path id="test.scenarium.logger.classpath"> <path id="test.classpath">
<path refid="io.scenarium.logger.classpath"/> <path refid="library.classpath"/>
<pathelement location="${result.classes.test.dir}"/> <pathelement location="${result.classes.test.dir}"/>
<path refid="junit.classpath"/> <path refid="junit.classpath"/>
</path> </path>
@ -139,7 +145,7 @@ cd ../../
<echo message="${ant.project.name}: ${ant.file}"/> <echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="${result.classes.lib.dir}" includeantruntime="false" source="${source}" target="${target}"> <javac debug="true" debuglevel="${debuglevel}" destdir="${result.classes.lib.dir}" includeantruntime="false" source="${source}" target="${target}">
<src path="${source.lib.dir}"/> <src path="${source.lib.dir}"/>
<classpath refid="io.scenarium.logger.classpath"/> <classpath refid="library.classpath"/>
</javac> </javac>
</target> </target>
<target depends="init" name="build-test"> <target depends="init" name="build-test">
@ -147,7 +153,7 @@ cd ../../
<javac debug="true" debuglevel="${debuglevel}" destdir="${result.classes.test.dir}" includeantruntime="false" source="${source}" target="${target}"> <javac debug="true" debuglevel="${debuglevel}" destdir="${result.classes.test.dir}" includeantruntime="false" source="${source}" target="${target}">
<src path="${source.test.dir}"/> <src path="${source.test.dir}"/>
<include name="**/*.java"/> <include name="**/*.java"/>
<classpath refid="test.scenarium.logger.classpath"/> <classpath refid="test.classpath"/>
</javac> </javac>
</target> </target>
@ -165,7 +171,7 @@ cd ../../
<formatter type="xml"/> <formatter type="xml"/>
<test name="test.scenarium.logger.TestBasicLog" todir="${result.juint.dir}"/> <test name="test.scenarium.logger.TestBasicLog" todir="${result.juint.dir}"/>
<jvmarg line="-ea"/> <jvmarg line="-ea"/>
<classpath refid="test.scenarium.logger.classpath"/> <classpath refid="test.classpath"/>
</junit> </junit>
</jacoco:coverage> </jacoco:coverage>
</target> </target>
@ -234,7 +240,18 @@ cd ../../
<!-- =========================================================================== --> <!-- =========================================================================== -->
<target name="package-lib" depends="build" description="Package compile java in a jar"> <target name="package-lib" depends="build" description="Package compile java in a jar">
<buildnumber /> <buildnumber />
<jar destfile="${result.jar.dir}/${ant.project.name}-${version}.jar" indexMetaInf="true" basedir="${result.classes.lib.dir}" /> <jar destfile="${result.jar.dir}/${ant.project.name}-${version}.jar" indexMetaInf="true" basedir="${result.classes.lib.dir}">
<manifest>
<section name="common">
<attribute name="Specification-Title" value="${title}" />
<attribute name="Specification-Version" value="${version}" />
<attribute name="Specification-Vendor" value="${vendor}" />
<attribute name="Implementation-Title" value="${title}" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Implementation-Vendor" value="${vendor}" />
</section>
</manifest>
</jar>
</target> </target>
<target name="package-src" description="Package sources in a jar"> <target name="package-src" description="Package sources in a jar">
<buildnumber /> <buildnumber />

View File

@ -79,10 +79,22 @@ public class Logger {
Log.print(" " + applicationName + " --logger-color --logger-level=2 --logger-lib=etk:5 --logger-lib=appl:5"); Log.print(" " + applicationName + " --logger-color --logger-level=2 --logger-lib=etk:5 --logger-lib=appl:5");
} }
// private static void displayPackageDetails(final Package pkg)
// {
// final String name = pkg.getName();
// out.println(name);
// out.println("\tSpec Title/Version: " + pkg.getSpecificationTitle() + " " + pkg.getSpecificationVersion());
// out.println("\tSpec Vendor: " + pkg.getSpecificationVendor());
// out.println("\tImplementation: " + pkg.getImplementationTitle() + " " + pkg.getImplementationVersion());
// out.println("\tImplementation Vendor: " + pkg.getImplementationVendor());
// }
public static void init(String applicationName, List<String> args) { public static void init(String applicationName, List<String> args) {
if (isInit) if (isInit)
return; return;
isInit = true; isInit = true;
// displayPackageDetails(Package.getPackage("dustin.examples"));
for (int iii = 0; iii < args.size(); ++iii) { for (int iii = 0; iii < args.size(); ++iii) {
String data = args.get(iii); String data = args.get(iii);
if (data.startsWith("--logger-level=")) { if (data.startsWith("--logger-level=")) {