mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-10 13:32:24 +00:00
Merge pull request #164 from bzz/ci-remove-tip
ci: remove go tip and move default to 1.10
This commit is contained in:
commit
ccb6264699
23
.travis.yml
23
.travis.yml
@ -1,8 +1,9 @@
|
|||||||
language: go
|
sudo: false
|
||||||
|
dist: trusty
|
||||||
|
|
||||||
|
language: go
|
||||||
go:
|
go:
|
||||||
- 1.9.x
|
- '1.10.x'
|
||||||
- tip
|
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
@ -10,13 +11,14 @@ addons:
|
|||||||
- libonig-dev
|
- libonig-dev
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
allow_failures:
|
|
||||||
- go: tip
|
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- ONIGURUMA=0
|
global:
|
||||||
- ONIGURUMA=1
|
- GO_VERSION='1.10.x'
|
||||||
|
matrix:
|
||||||
|
- ONIGURUMA=0
|
||||||
|
- ONIGURUMA=1
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- go version
|
- go version
|
||||||
@ -53,7 +55,9 @@ jobs:
|
|||||||
jdk: oraclejdk8
|
jdk: oraclejdk8
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- GIMME_OUTPUT=$(gimme 1.9 | tee -a $HOME/.bashrc) && eval "$GIMME_OUTPUT"
|
- gimme version
|
||||||
|
- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=$GO_VERSION bash)"
|
||||||
|
- go version
|
||||||
- export GOPATH=$HOME/gopath
|
- export GOPATH=$HOME/gopath
|
||||||
- mkdir -p $GOPATH/src/gopkg.in/src-d/enry.v1
|
- mkdir -p $GOPATH/src/gopkg.in/src-d/enry.v1
|
||||||
- rsync -az ${TRAVIS_BUILD_DIR}/ $GOPATH/src/gopkg.in/src-d/enry.v1
|
- rsync -az ${TRAVIS_BUILD_DIR}/ $GOPATH/src/gopkg.in/src-d/enry.v1
|
||||||
@ -121,7 +125,8 @@ jobs:
|
|||||||
jdk: oraclejdk8
|
jdk: oraclejdk8
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- GIMME_OUTPUT=$(gimme 1.9 | tee -a $HOME/.bashrc) && eval "$GIMME_OUTPUT"
|
- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=$GO_VERSION bash)"
|
||||||
|
- go version
|
||||||
- export GOPATH=$HOME/gopath
|
- export GOPATH=$HOME/gopath
|
||||||
- mkdir -p $GOPATH/src/gopkg.in/src-d/enry.v1
|
- mkdir -p $GOPATH/src/gopkg.in/src-d/enry.v1
|
||||||
- rsync -az ${TRAVIS_BUILD_DIR}/ $GOPATH/src/gopkg.in/src-d/enry.v1
|
- rsync -az ${TRAVIS_BUILD_DIR}/ $GOPATH/src/gopkg.in/src-d/enry.v1
|
||||||
|
@ -18,6 +18,8 @@ $(JAR): $(RESOURCES_DIR) $(JNAERATOR_JAR)
|
|||||||
-package tech.sourced.enry.nativelib \
|
-package tech.sourced.enry.nativelib \
|
||||||
-library enry \
|
-library enry \
|
||||||
$(HEADER_FILE) \
|
$(HEADER_FILE) \
|
||||||
|
-I/usr/lib/gcc/x86_64-linux-gnu/4.8/include \
|
||||||
|
-D__GNUC__=4 \
|
||||||
-o $(JARS_DIR) \
|
-o $(JARS_DIR) \
|
||||||
-mode StandaloneJar \
|
-mode StandaloneJar \
|
||||||
-runtime JNA;
|
-runtime JNA;
|
||||||
|
@ -35,6 +35,7 @@ pgpSecretRing := baseDirectory.value / "project" / ".gnupg" / "secring.gpg"
|
|||||||
pgpPublicRing := baseDirectory.value / "project" / ".gnupg" / "pubring.gpg"
|
pgpPublicRing := baseDirectory.value / "project" / ".gnupg" / "pubring.gpg"
|
||||||
pgpPassphrase := Some(SONATYPE_PASSPHRASE.toArray)
|
pgpPassphrase := Some(SONATYPE_PASSPHRASE.toArray)
|
||||||
|
|
||||||
|
libraryDependencies += "com.nativelibs4java" % "jnaerator-runtime" % "0.12"
|
||||||
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test
|
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test
|
||||||
|
|
||||||
unmanagedBase := baseDirectory.value / "lib"
|
unmanagedBase := baseDirectory.value / "lib"
|
||||||
|
@ -3,13 +3,14 @@ package tech.sourced.enry;
|
|||||||
import com.sun.jna.Memory;
|
import com.sun.jna.Memory;
|
||||||
import com.sun.jna.Pointer;
|
import com.sun.jna.Pointer;
|
||||||
import tech.sourced.enry.nativelib.GoSlice;
|
import tech.sourced.enry.nativelib.GoSlice;
|
||||||
import tech.sourced.enry.nativelib.GoString;
|
import tech.sourced.enry.nativelib._GoString_;
|
||||||
|
import com.ochafik.lang.jnaerator.runtime.NativeSize;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
|
||||||
class GoUtils {
|
class GoUtils {
|
||||||
|
|
||||||
static GoString.ByValue toGoString(String str) {
|
static _GoString_.ByValue toGoString(String str) {
|
||||||
byte[] bytes;
|
byte[] bytes;
|
||||||
try {
|
try {
|
||||||
bytes = str.getBytes("utf-8");
|
bytes = str.getBytes("utf-8");
|
||||||
@ -26,19 +27,19 @@ class GoUtils {
|
|||||||
ptr = ptrFromBytes(bytes);
|
ptr = ptrFromBytes(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
GoString.ByValue val = new GoString.ByValue();
|
_GoString_.ByValue val = new _GoString_.ByValue();
|
||||||
val.n = length;
|
val.n = new NativeSize(length);
|
||||||
val.p = ptr;
|
val.p = ptr;
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static String toJavaString(GoString str) {
|
static String toJavaString(_GoString_ str) {
|
||||||
if (str.n == 0) {
|
if (str.n.intValue() == 0) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] bytes = new byte[(int) str.n];
|
byte[] bytes = new byte[(int) str.n.intValue()];
|
||||||
str.p.read(0, bytes, 0, (int) str.n);
|
str.p.read(0, bytes, 0, (int) str.n.intValue());
|
||||||
try {
|
try {
|
||||||
return new String(bytes, "utf-8");
|
return new String(bytes, "utf-8");
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user