Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ jar {
from file("$buildDir/install/lib64/${System.mapLibraryName("tiledb")}")
from file("$buildDir/install/lib64/${System.mapLibraryName("tiledbjni")}")
}

manifest {
attributes("Implementation-Title": "Gradle",
"Implementation-Version": version)
}
}

task sourceJar(type: Jar) {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
23 changes: 13 additions & 10 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -154,16 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
37 changes: 37 additions & 0 deletions src/main/java/io/tiledb/java/api/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ private void createContext(Config config) throws TileDBError {
this.ctxpp = _ctxpp;
this.ctxp = tiledb.tiledb_ctx_tpp_value(_ctxpp);
this.errorHandler = new ContextCallback();

// Set default tags
setDefaultTags();
}

protected SWIGTYPE_p_tiledb_ctx_t getCtxp() {
Expand All @@ -187,6 +190,40 @@ public Config getConfig() throws TileDBError {
return new Config(_configpp);
}

/**
* Set context tasks
*
* @param key to set
* @param value value to set
* @throws TileDBError
*/
public void setTag(String key, String value) throws TileDBError {
handleError(tiledb.tiledb_ctx_set_tag(ctxp, key, value));
}

/**
* Set default context tags
*
* @throws TileDBError
*/
private void setDefaultTags() throws TileDBError {
setTag("x-tiledb-api-language", "java");
Package pkg = Context.class.getPackage();
if (pkg != null) {
String version = pkg.getImplementationVersion();
if (version != null) {
setTag("x-tiledb-api-language-version", version);
}
}
String platform =
System.getProperty("os.name")
+ "-"
+ System.getProperty("os.verions")
+ "-"
+ System.getProperty("os.arch");
setTag("x-tiledb-api-sys-platform", platform);
}

/**
* Close the context and delete all native objects. Should be called always to cleanup the context
*/
Expand Down