Răsfoiți Sursa

Transform the project into a maven project

Baglio Tabifata 4 ani în urmă
părinte
comite
7285306f42

+ 44 - 0
.classpath

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+			<attribute name="test" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" path="target/generated-sources/annotations">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+			<attribute name="ignore_optional_problems" value="true"/>
+			<attribute name="m2e-apt" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+			<attribute name="ignore_optional_problems" value="true"/>
+			<attribute name="m2e-apt" value="true"/>
+			<attribute name="test" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

+ 23 - 0
.project

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>dupal-analyzer</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+	</natures>
+</projectDescription>

+ 4 - 0
.settings/org.eclipse.core.resources.prefs

@@ -0,0 +1,4 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/test/java=UTF-8
+encoding/<project>=UTF-8

+ 2 - 0
.settings/org.eclipse.jdt.apt.core.prefs

@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.apt.aptEnabled=false

+ 9 - 0
.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,9 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=14
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
+org.eclipse.jdt.core.compiler.processAnnotations=disabled
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=14

+ 4 - 0
.settings/org.eclipse.m2e.core.prefs

@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1

+ 2 - 2
.vscode/settings.json

@@ -1,3 +1,3 @@
 {
-	"java.home": "/usr/lib/jvm/java-14-openjdk/"
-}
+    "java.configuration.updateBuildConfiguration": "interactive"
+}

+ 0 - 14
README.md

@@ -1,14 +0,0 @@
-## Getting Started
-
-Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.
-
-## Folder Structure
-
-The workspace contains two folders by default, where:
-
-- `src`: the folder to maintain sources
-- `lib`: the folder to maintain dependencies
-
-## Dependency Management
-
-The `JAVA DEPENDENCIES` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-pack/blob/master/release-notes/v0.9.0.md#work-with-jar-files-directly).

+ 123 - 0
pom.xml

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>info.hkzlab.dupal.analyzer</groupId>
+  <artifactId>dupal-analyzer</artifactId>
+  <version>0.0.1</version>
+
+  <name>dupal-analyzer</name>
+  <!-- FIXME change it to the project's website -->
+  <url>http://www.example.com</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <maven.compiler.source>14</maven.compiler.source>
+    <maven.compiler.target>1.8</maven.compiler.target>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.github.java-native</groupId>
+      <artifactId>jssc</artifactId>
+      <version>2.9.2</version>
+      <scope>system</scope>
+      <systemPath>${project.basedir}/lib/jssc-2.9.2.jar</systemPath>
+    </dependency>
+
+    <dependency>
+      <groupId>io.github.java-native</groupId>
+      <artifactId>jssc-javadoc</artifactId>
+      <version>2.9.2</version>
+      <scope>system</scope>
+      <systemPath>${project.basedir}/lib/jssc-2.9.2-javadoc.jar</systemPath>
+    </dependency>
+
+    <dependency>
+      <groupId>io.github.java-native</groupId>
+      <artifactId>jssc-sources</artifactId>
+      <version>2.9.2</version>
+      <scope>system</scope>
+      <systemPath>${project.basedir}/lib/jssc-2.9.2-sources.jar</systemPath>
+    </dependency>
+
+    <dependency>
+     <groupId>org.slf4j</groupId>
+     <artifactId>slf4j-api</artifactId>
+     <version>1.7.30</version>
+    </dependency>
+
+    <!--dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-jdk14</artifactId>
+      <version>1.7.30</version>
+    </dependency-->
+
+    <dependency>
+     <groupId>org.slf4j</groupId>
+     <artifactId>slf4j-simple</artifactId>
+     <version>1.7.30</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.scijava</groupId>
+      <artifactId>native-lib-loader</artifactId>
+      <version>2.3.4</version>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.11</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
+      <plugins>
+        <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
+        <plugin>
+          <artifactId>maven-clean-plugin</artifactId>
+          <version>3.1.0</version>
+        </plugin>
+        <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
+        <plugin>
+          <artifactId>maven-resources-plugin</artifactId>
+          <version>3.0.2</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.8.0</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>2.22.1</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-jar-plugin</artifactId>
+          <version>3.0.2</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-install-plugin</artifactId>
+          <version>2.5.2</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-deploy-plugin</artifactId>
+          <version>2.8.2</version>
+        </plugin>
+        <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
+        <plugin>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>3.7.1</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-project-info-reports-plugin</artifactId>
+          <version>3.0.0</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>

+ 4 - 9
src/net/hkzlab/dupal/App.java → src/main/java/info/hkzlab/dupal/analyzer/App.java

@@ -1,14 +1,9 @@
-package net.hkzlab.dupal;
+package info.hkzlab.dupal.analyzer;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.slf4j.*;
 
-import net.hkzlab.devices.PAL16R4Specs;
-import net.hkzlab.devices.PAL16R6Specs;
-import net.hkzlab.devices.PAL16R8Specs;
-import net.hkzlab.devices.PALSpecs;
-import net.hkzlab.dupal.boardio.DuPALAnalyzer;
-import net.hkzlab.dupal.boardio.DuPALManager;
+import info.hkzlab.dupal.analyzer.board.boardio.*;
+import info.hkzlab.dupal.analyzer.devices.*;
 
 public class App {
     private final static Logger logger = LoggerFactory.getLogger(DuPALManager.class);

+ 4 - 6
src/net/hkzlab/dupal/boardio/DuPALAnalyzer.java → src/main/java/info/hkzlab/dupal/analyzer/board/boardio/DuPALAnalyzer.java

@@ -1,4 +1,4 @@
-package net.hkzlab.dupal.boardio;
+package info.hkzlab.dupal.analyzer.board.boardio;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -18,11 +18,9 @@ import java.util.Stack;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import net.hkzlab.devices.PALSpecs;
-import net.hkzlab.dupal.dupalproto.DuPALProto;
-import net.hkzlab.palanalisys.MacroState;
-import net.hkzlab.palanalisys.StateLink;
-import net.hkzlab.palanalisys.SubState;
+import info.hkzlab.dupal.analyzer.board.dupalproto.DuPALProto;
+import info.hkzlab.dupal.analyzer.devices.*;
+import info.hkzlab.dupal.analyzer.palanalisys.*;
 
 public class DuPALAnalyzer {
     private static final Logger logger = LoggerFactory.getLogger(DuPALAnalyzer.class);

+ 1 - 1
src/net/hkzlab/dupal/boardio/DuPALManager.java → src/main/java/info/hkzlab/dupal/analyzer/board/boardio/DuPALManager.java

@@ -1,4 +1,4 @@
-package net.hkzlab.dupal.boardio;
+package info.hkzlab.dupal.analyzer.board.boardio;
 
 import static jssc.SerialPort.*;
 

+ 1 - 1
src/net/hkzlab/dupal/dupalproto/DuPALProto.java → src/main/java/info/hkzlab/dupal/analyzer/board/dupalproto/DuPALProto.java

@@ -1,4 +1,4 @@
-package net.hkzlab.dupal.dupalproto;
+package info.hkzlab.dupal.analyzer.board.dupalproto;
 
 import java.util.ArrayList;
 

+ 1 - 1
src/net/hkzlab/devices/PAL16R4Specs.java → src/main/java/info/hkzlab/dupal/analyzer/devices/PAL16R4Specs.java

@@ -1,4 +1,4 @@
-package net.hkzlab.devices;
+package info.hkzlab.dupal.analyzer.devices;
 
 public class PAL16R4Specs implements PALSpecs {
     private static final String[] ROUT_PIN_NAMES = { "ro14", "ro15", "ro16", "ro17" };

+ 1 - 1
src/net/hkzlab/devices/PAL16R6Specs.java → src/main/java/info/hkzlab/dupal/analyzer/devices/PAL16R6Specs.java

@@ -1,4 +1,4 @@
-package net.hkzlab.devices;
+package info.hkzlab.dupal.analyzer.devices;
 
 public class PAL16R6Specs implements PALSpecs {
     private static final String[] ROUT_PIN_NAMES = { "ro13", "ro14", "ro15", "ro16", "ro17", "ro18" };

+ 1 - 1
src/net/hkzlab/devices/PAL16R8Specs.java → src/main/java/info/hkzlab/dupal/analyzer/devices/PAL16R8Specs.java

@@ -1,4 +1,4 @@
-package net.hkzlab.devices;
+package info.hkzlab.dupal.analyzer.devices;
 
 public class PAL16R8Specs implements PALSpecs {
     private static final String[] ROUT_PIN_NAMES = { "ro12", "ro13", "ro14", "ro15", "ro16", "ro17", "ro18", "ro19" };

+ 1 - 1
src/net/hkzlab/devices/PALSpecs.java → src/main/java/info/hkzlab/dupal/analyzer/devices/PALSpecs.java

@@ -1,4 +1,4 @@
-package net.hkzlab.devices;
+package info.hkzlab.dupal.analyzer.devices;
 
 public interface PALSpecs {
     public static final int READ_WRITE_SHIFT = 10;

+ 1 - 1
src/net/hkzlab/palanalisys/MacroState.java → src/main/java/info/hkzlab/dupal/analyzer/palanalisys/MacroState.java

@@ -1,4 +1,4 @@
-package net.hkzlab.palanalisys;
+package info.hkzlab.dupal.analyzer.palanalisys;
 
 import java.io.Serializable;
 import java.util.HashMap;

+ 1 - 1
src/net/hkzlab/palanalisys/StateLink.java → src/main/java/info/hkzlab/dupal/analyzer/palanalisys/StateLink.java

@@ -1,4 +1,4 @@
-package net.hkzlab.palanalisys;
+package info.hkzlab.dupal.analyzer.palanalisys;
 
 import java.io.Serializable;
 

+ 1 - 1
src/net/hkzlab/palanalisys/SubState.java → src/main/java/info/hkzlab/dupal/analyzer/palanalisys/SubState.java

@@ -1,4 +1,4 @@
-package net.hkzlab.palanalisys;
+package info.hkzlab.dupal.analyzer.palanalisys;
 
 import java.io.Serializable;
 import java.util.Arrays;

+ 20 - 0
src/test/java/info/hkzlab/dupal/analyzer/AppTest.java

@@ -0,0 +1,20 @@
+package info.hkzlab.dupal.analyzer;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest 
+{
+    /**
+     * Rigorous Test :-)
+     */
+    @Test
+    public void shouldAnswerWithTrue()
+    {
+        assertTrue( true );
+    }
+}