-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from simelo/stdevHan_t3_test_libjava
Fixes #4 Implementing libskycoin test suite for Java
- Loading branch information
Showing
142 changed files
with
39,854 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.7"> | ||
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "gopath/src/github.com/skycoin/skycoin"] | ||
path = gopath/src/github.com/skycoin/skycoin | ||
url = https://github.com/simelo/skycoin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>libskycoin-java</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.m2e.core.maven2Nature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/main/java=UTF-8 | ||
encoding//src/test/java=UTF-8 | ||
encoding/<project>=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.apt.aptEnabled=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.7 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning | ||
org.eclipse.jdt.core.compiler.processAnnotations=disabled | ||
org.eclipse.jdt.core.compiler.release=disabled | ||
org.eclipse.jdt.core.compiler.source=1.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
activeProfiles= | ||
eclipse.preferences.version=1 | ||
resolveWorkspaceProjects=true | ||
version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
language: java | ||
jdk: | ||
- oraclejdk8 | ||
- oraclejdk9 | ||
- openjdk8 | ||
- openjdk9 | ||
install: | ||
- eval "$(gimme 1.11)" | ||
- go version | ||
- mkdir swig_build && cd swig_build && wget http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz && tar -zxf swig-3.0.12.tar.gz && cd swig-3.0.12 && sudo ./configure --prefix=/usr && sudo make && sudo make install && cd ../../ && sudo rm -rf swig_build | ||
|
||
script: | ||
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V | ||
- make configure | ||
- make build-libc | ||
- make build-swig | ||
- make build-libjava | ||
- make test | ||
|
||
notifications: | ||
email: false | ||
webhooks: https://fathomless-fjord-24024.herokuapp.com/notify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Java", | ||
"type": "java", | ||
"request": "launch", | ||
"stopOnEntry": true, | ||
"jdkPath": "${env:JAVA_HOME}/bin", | ||
"cwd": "${fileDirname}", | ||
"startupClass": "${fileBasenameNoExtension}", | ||
"classpath": [ | ||
".", | ||
"${fileDirname}" | ||
] | ||
}, | ||
{ | ||
"name": "Java Console App", | ||
"type": "java", | ||
"request": "launch", | ||
"stopOnEntry": true, | ||
"jdkPath": "${env:JAVA_HOME}/bin", | ||
"cwd": "${fileDirname}", | ||
"startupClass": "${fileBasenameNoExtension}", | ||
"classpath": [ | ||
".", | ||
"${fileDirname}" | ||
], | ||
"externalConsole": true | ||
}, | ||
{ | ||
"type": "java", | ||
"name": "Debug (Launch)", | ||
"request": "launch", | ||
"cwd": "${workspaceFolder}", | ||
"console": "internalConsole", | ||
"stopOnEntry": false, | ||
"mainClass": "", | ||
"args": "" | ||
}, | ||
{ | ||
"type": "java", | ||
"name": "Debug (Attach)", | ||
"request": "attach", | ||
"hostName": "localhost", | ||
"port": "<debug port of remote debuggee>" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"run": { | ||
"default": "", | ||
"items": [ | ||
{ | ||
"name": "libskycoin-java", | ||
"projectName": "libskycoin-java", | ||
"workingDirectory": "/home/maykel/go/src/github.com/skycoin/libjava-skycoin", | ||
"args": [], | ||
"vmargs": [], | ||
"env": {}, | ||
"preLaunchTask": "" | ||
} | ||
] | ||
}, | ||
"debug": { | ||
"default": "", | ||
"items": [ | ||
{ | ||
"name": "libskycoin-java", | ||
"projectName": "libskycoin-java", | ||
"workingDirectory": "/home/maykel/go/src/github.com/skycoin/libjava-skycoin", | ||
"args": [], | ||
"vmargs": [], | ||
"env": {}, | ||
"preLaunchTask": "" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "automatic" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
PWD = $(shell pwd) | ||
GOPATH_DIR = $(PWD)/gopath | ||
SKYCOIN_DIR = gopath/src/github.com/skycoin/skycoin | ||
SKYBUILD_DIR = $(SKYCOIN_DIR)/build | ||
BUILDLIBC_DIR = $(SKYBUILD_DIR)/libskycoin | ||
LIBC_DIR = $(SKYCOIN_DIR)/lib/cgo | ||
LIBSWIG_DIR = swig | ||
BUILD_DIR = build | ||
BIN_DIR = $(SKYCOIN_DIR)/bin | ||
INCLUDE_DIR = $(SKYCOIN_DIR)/include | ||
FULL_PATH_LIB = $(PWD)/$(BUILDLIBC_DIR) | ||
|
||
LIB_FILES = $(shell find $(SKYCOIN_DIR)/lib/cgo -type f -name "*.go") | ||
SRC_FILES = $(shell find $(SKYCOIN_DIR)/src -type f -name "*.go") | ||
SWIG_FILES = $(shell find $(LIBSWIG_DIR) -type f -name "*.i") | ||
HEADER_FILES = $(shell find $(SKYCOIN_DIR)/include -type f -name "*.h") | ||
|
||
configure: | ||
mkdir -p $(BUILD_DIR)/usr/tmp $(BUILD_DIR)/usr/lib $(BUILD_DIR)/usr/include | ||
mkdir -p $(BUILDLIBC_DIR) $(BIN_DIR) $(INCLUDE_DIR) | ||
|
||
$(BUILDLIBC_DIR)/libskycoin.a: $(LIB_FILES) $(SRC_FILES) $(HEADER_FILES) | ||
rm -f $(BUILDLIBC_DIR)/libskycoin.a | ||
GOPATH="$(GOPATH_DIR)" make -C $(SKYCOIN_DIR) build-libc-static | ||
ls $(BUILDLIBC_DIR) | ||
rm -f swig/include/libskycoin.h | ||
mkdir -p swig/include | ||
grep -v _Complex $(INCLUDE_DIR)/libskycoin.h > swig/include/libskycoin.h | ||
|
||
## Build libskycoin C client library | ||
build-libc: configure $(BUILDLIBC_DIR)/libskycoin.a | ||
|
||
build-swig: | ||
#Generate structs.i from skytypes.gen.h | ||
rm -f $(LIBSWIG_DIR)/structs.i | ||
cp $(INCLUDE_DIR)/skytypes.gen.h $(LIBSWIG_DIR)/structs.i | ||
#sed -i 's/#/%/g' $(LIBSWIG_DIR)/structs.i | ||
{ \ | ||
if [[ "$$(uname -s)" == "Darwin" ]]; then \ | ||
sed -i '.kbk' 's/#/%/g' $(LIBSWIG_DIR)/structs.i ;\ | ||
else \ | ||
sed -i 's/#/%/g' $(LIBSWIG_DIR)/structs.i ;\ | ||
fi \ | ||
} | ||
rm -f swig/include/swig.h | ||
rm -f skycoinnet_wrap.c | ||
cp -v gopath/src/github.com/skycoin/skycoin/include/swig.h swig/include/ | ||
rm -rfv src/main/java/skycoin/libjava | ||
mkdir -p src/main/java/skycoin/libjava | ||
swig -DUSE_ASSERT_EXCEPTIONS -java -v -package skycoin.libjava -Iswig/include -I$(INCLUDE_DIR) -outdir src/main/java/skycoin/libjava -o skycoin_wrap.c $(LIBSWIG_DIR)/skycoin.i | ||
|
||
build-libc-swig: build-libc build-swig | ||
|
||
build-libjava: | ||
gcc -c -fpic -I /usr/lib/jvm/java-8-openjdk-amd64/include/ -I /usr/lib/jvm/java-8-openjdk-amd64/include/linux -I swig/include -I$(INCLUDE_DIR) skycoin_wrap.c | ||
gcc -shared skycoin_wrap.o $(BUILDLIBC_DIR)/libskycoin.a -o libskycoin.so | ||
sudo cp libskycoin.so /lib | ||
|
||
|
||
test: build-libc build-swig build-libjava | ||
mvn clean | ||
mvn test | ||
mvn clean |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?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>skycoin.libjava</groupId> | ||
<artifactId>libskycoin-java</artifactId> | ||
<version>0.0.1</version> | ||
|
||
<name>libskycoin-java</name> | ||
<!-- FIXME change it to the project's website --> | ||
<url>https://github.com/simelo/libjava-skycoin</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.7</maven.compiler.source> | ||
<maven.compiler.target>1.7</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-clean-plugin</artifactId> | ||
<version>3.0.0</version> | ||
</plugin> | ||
<!-- see http://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.7.0</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.20.1</version> | ||
<configuration> | ||
<useSystemClassLoader>false</useSystemClassLoader> | ||
</configuration> | ||
</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> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
</project> |
Oops, something went wrong.