Skip to content

Commit

Permalink
Merge pull request #74 from kuzzleio/1.3.0-proposal
Browse files Browse the repository at this point in the history
Release 1.3.0
  • Loading branch information
Shiranuit authored Apr 27, 2022
2 parents 9be2a59 + 01a8042 commit b169c97
Show file tree
Hide file tree
Showing 128 changed files with 1,096 additions and 317 deletions.
6 changes: 4 additions & 2 deletions .ci/doc/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---

snippets:
mount: /mnt
path: 'doc/**/snippets/*.test.yml'
templates: /mnt/.ci/doc/templates
protocols:
- http
- websocket

runners:
default: java
Expand All @@ -15,4 +17,4 @@ runners:
cmd: cd /mnt && ./gradlew jar
run:
before: timeout 600 bash -c 'until stat /tmp/runner_is_ready && curl -f -s -o /dev/null http://kuzzle:7512/_now; do sleep 1; done'
cmd: /mnt/.ci/doc/test-snippet.sh {{ snippet.source }}
cmd: SNIPPET_PROTOCOL="{{ snippet.protocol }}" /mnt/.ci/doc/test-snippet.sh {{ snippet.source }}
6 changes: 4 additions & 2 deletions .ci/doc/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ services:
- CONFIG_FILE=/mnt/.ci/doc/config.yml

doc-runner-java:
image: adoptopenjdk/openjdk8
image: adoptopenjdk/openjdk11
command: >
bash -c '
sh -c '
mkdir -p /var/snippets/java;
touch /tmp/runner_is_ready;
tail -f /dev/null
'
links:
- kuzzle
volumes:
- ../..:/mnt
- snippets:/var/snippets
Expand Down
24 changes: 13 additions & 11 deletions .ci/doc/java-project/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,27 @@ repositories {
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile 'io.ktor:ktor-client-websockets:1.5.2'
compile 'io.ktor:ktor-client-okhttp:1.5.2'
compile 'io.ktor:ktor-client-cio:1.5.2'
compile 'io.ktor:ktor-client-json:1.5.2'
compile 'io.ktor:ktor-client-gson:1.5.2'
compile 'io.ktor:ktor-client-serialization:1.5.2'
compile 'com.google.code.gson:gson:2.8.5'
compile fileTree(dir: 'libs', include: ['*.jar'])
testImplementation group: 'junit', name: 'junit', version: '4.12'
implementation 'io.ktor:ktor-client-core:1.6.8'
implementation 'io.ktor:ktor-client-websockets:1.6.8'
implementation 'io.ktor:ktor-client-okhttp:1.6.8'
implementation 'io.ktor:ktor-client-cio:1.6.8'
implementation 'io.ktor:ktor-client-json:1.6.8'
implementation 'io.ktor:ktor-client-gson:1.6.8'
implementation 'io.ktor:ktor-client-serialization:1.6.8'
implementation 'com.google.code.gson:gson:2.9.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
}

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Class-Path': configurations.runtimeClasspath.collect { it.getName() }.join(' '),
'Main-Class': 'SnippetTest'
)
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
26 changes: 14 additions & 12 deletions .ci/doc/kotlin-project/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
id 'org.jetbrains.kotlin.jvm' version '1.6.10'
}

group 'test.example.java'
Expand All @@ -12,25 +12,27 @@ repositories {
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile 'io.ktor:ktor-client-websockets:1.5.2'
compile 'io.ktor:ktor-client-okhttp:1.5.2'
compile 'io.ktor:ktor-client-cio:1.5.2'
compile 'io.ktor:ktor-client-json:1.5.2'
compile 'io.ktor:ktor-client-gson:1.5.2'
compile 'io.ktor:ktor-client-serialization:1.5.2'
compile 'com.google.code.gson:gson:2.8.5'
compile fileTree(dir: 'libs', include: ['*.jar'])
testImplementation group: 'junit', name: 'junit', version: '4.12'
implementation 'io.ktor:ktor-client-core:1.6.8'
implementation 'io.ktor:ktor-client-websockets:1.6.8'
implementation 'io.ktor:ktor-client-okhttp:1.6.8'
implementation 'io.ktor:ktor-client-cio:1.6.8'
implementation 'io.ktor:ktor-client-json:1.6.8'
implementation 'io.ktor:ktor-client-gson:1.6.8'
implementation 'io.ktor:ktor-client-serialization:1.6.8'
implementation 'com.google.code.gson:gson:2.9.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
}

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Class-Path': configurations.runtimeClasspath.collect { it.getName() }.join(' '),
'Main-Class': 'SnippetTestKt'
)
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
10 changes: 8 additions & 2 deletions .ci/doc/templates/catch.tpl.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import io.kuzzle.sdk.Kuzzle;
import java.util.ArrayList;
import io.kuzzle.sdk.protocol.WebSocket;
import io.kuzzle.sdk.protocol.*;
import io.kuzzle.sdk.coreClasses.responses.Response;
import java.util.*;

Expand All @@ -9,7 +9,13 @@ public class SnippetTest {

public static void main(String[] argv) {
try {
kuzzle = new Kuzzle(new WebSocket("kuzzle"));
AbstractProtocol protocol;
if (System.getenv("SNIPPET_PROTOCOL") != null && System.getenv("SNIPPET_PROTOCOL").equals("http")) {
protocol = new Http("kuzzle");
} else {
protocol = new WebSocket("kuzzle");
}
kuzzle = new Kuzzle(protocol);
kuzzle.connect();
[snippet-code]
System.out.println("Error");
Expand Down
11 changes: 8 additions & 3 deletions .ci/doc/templates/catch.tpl.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import io.kuzzle.sdk.Kuzzle
import io.kuzzle.sdk.protocol.WebSocket
import io.kuzzle.sdk.protocol.*

import java.util.concurrent.ExecutionException
import io.kuzzle.sdk.coreClasses.responses.Response

fun main() {
val ws = WebSocket("kuzzle")
val kuzzle = Kuzzle(ws).apply {
val protocol: AbstractProtocol;
if (System.getenv("SNIPPET_PROTOCOL") != null && System.getenv("SNIPPET_PROTOCOL") == "http") {
protocol = Http("kuzzle")
} else {
protocol = WebSocket("kuzzle")
}
val kuzzle = Kuzzle(protocol).apply {
connect()
}
try {
Expand Down
10 changes: 8 additions & 2 deletions .ci/doc/templates/default.tpl.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import io.kuzzle.sdk.Kuzzle;
import io.kuzzle.sdk.protocol.WebSocket;
import io.kuzzle.sdk.protocol.*;
import io.kuzzle.sdk.coreClasses.responses.Response;
import io.kuzzle.sdk.coreClasses.SearchResult;
import io.kuzzle.sdk.coreClasses.lang.Lang;
Expand All @@ -10,7 +10,13 @@ public class SnippetTest {

public static void main(String[] argv) {
try {
kuzzle = new Kuzzle(new WebSocket("kuzzle"));
AbstractProtocol protocol;
if (System.getenv("SNIPPET_PROTOCOL") != null && System.getenv("SNIPPET_PROTOCOL").equals("http")) {
protocol = new Http("kuzzle");
} else {
protocol = new WebSocket("kuzzle");
}
kuzzle = new Kuzzle(protocol);
kuzzle.connect();
[snippet-code]
System.out.println("Success");
Expand Down
11 changes: 8 additions & 3 deletions .ci/doc/templates/default.tpl.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import io.kuzzle.sdk.Kuzzle
import io.kuzzle.sdk.protocol.WebSocket
import io.kuzzle.sdk.protocol.*

import java.util.concurrent.ExecutionException
import io.kuzzle.sdk.coreClasses.responses.Response
Expand All @@ -8,8 +8,13 @@ import io.kuzzle.sdk.coreClasses.lang.Lang
import java.util.*;

fun main() {
val ws = WebSocket("kuzzle")
val kuzzle = Kuzzle(ws).apply {
val protocol: AbstractProtocol;
if (System.getenv("SNIPPET_PROTOCOL") != null && System.getenv("SNIPPET_PROTOCOL") == "http") {
protocol = Http("kuzzle")
} else {
protocol = WebSocket("kuzzle")
}
val kuzzle = Kuzzle(protocol).apply {
connect()
}
try {
Expand Down
10 changes: 8 additions & 2 deletions .ci/doc/templates/print-result-array.tpl.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import io.kuzzle.sdk.Kuzzle;
import io.kuzzle.sdk.protocol.WebSocket;
import io.kuzzle.sdk.protocol.*;
import io.kuzzle.sdk.coreClasses.responses.Response;
import io.kuzzle.sdk.coreClasses.lang.Lang;
import java.util.*;
Expand All @@ -9,7 +9,13 @@ public class SnippetTest {

public static void main(String[] argv) {
try {
kuzzle = new Kuzzle(new WebSocket("kuzzle"));
AbstractProtocol protocol;
if (System.getenv("SNIPPET_PROTOCOL") != null && System.getenv("SNIPPET_PROTOCOL").equals("http")) {
protocol = new Http("kuzzle");
} else {
protocol = new WebSocket("kuzzle");
}
kuzzle = new Kuzzle(protocol);
kuzzle.connect();
[snippet-code]
for (Object o : result.get("successes")) {
Expand Down
11 changes: 8 additions & 3 deletions .ci/doc/templates/print-result-array.tpl.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import io.kuzzle.sdk.Kuzzle
import io.kuzzle.sdk.protocol.WebSocket
import io.kuzzle.sdk.protocol.*

import java.util.concurrent.ExecutionException
import io.kuzzle.sdk.coreClasses.responses.Response
import io.kuzzle.sdk.coreClasses.maps.KuzzleMap
import io.kuzzle.sdk.coreClasses.lang.Lang

fun main() {
val ws = WebSocket("kuzzle")
val kuzzle = Kuzzle(ws).apply {
val protocol: AbstractProtocol;
if (System.getenv("SNIPPET_PROTOCOL") != null && System.getenv("SNIPPET_PROTOCOL") == "http") {
protocol = Http("kuzzle")
} else {
protocol = WebSocket("kuzzle")
}
val kuzzle = Kuzzle(protocol).apply {
connect()
}
try {
Expand Down
10 changes: 8 additions & 2 deletions .ci/doc/templates/print-result-arraylist.tpl.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import io.kuzzle.sdk.Kuzzle;
import io.kuzzle.sdk.protocol.WebSocket;
import io.kuzzle.sdk.protocol.*;
import io.kuzzle.sdk.coreClasses.responses.Response;
import io.kuzzle.sdk.coreClasses.lang.Lang;
import java.util.*;
Expand All @@ -9,7 +9,13 @@ public class SnippetTest {

public static void main(String[] argv) {
try {
kuzzle = new Kuzzle(new WebSocket("kuzzle"));
AbstractProtocol protocol;
if (System.getenv("SNIPPET_PROTOCOL") != null && System.getenv("SNIPPET_PROTOCOL").equals("http")) {
protocol = new Http("kuzzle");
} else {
protocol = new WebSocket("kuzzle");
}
kuzzle = new Kuzzle(protocol);
kuzzle.connect();
[snippet-code]
for (Object o : result) {
Expand Down
11 changes: 8 additions & 3 deletions .ci/doc/templates/print-result-arraylist.tpl.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import io.kuzzle.sdk.Kuzzle
import io.kuzzle.sdk.protocol.WebSocket
import io.kuzzle.sdk.protocol.*

import java.util.concurrent.ExecutionException
import io.kuzzle.sdk.coreClasses.responses.Response
import io.kuzzle.sdk.coreClasses.lang.Lang

fun main() {
val ws = WebSocket("kuzzle")
val kuzzle = Kuzzle(ws).apply {
val protocol: AbstractProtocol;
if (System.getenv("SNIPPET_PROTOCOL") != null && System.getenv("SNIPPET_PROTOCOL") == "http") {
protocol = Http("kuzzle")
} else {
protocol = WebSocket("kuzzle")
}
val kuzzle = Kuzzle(protocol).apply {
connect()
}
try {
Expand Down
10 changes: 8 additions & 2 deletions .ci/doc/templates/print-result.tpl.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import io.kuzzle.sdk.Kuzzle;
import io.kuzzle.sdk.protocol.WebSocket;
import io.kuzzle.sdk.protocol.*;
import io.kuzzle.sdk.coreClasses.responses.Response;
import io.kuzzle.sdk.coreClasses.lang.Lang;
import java.util.*;
Expand All @@ -9,7 +9,13 @@ public class SnippetTest {

public static void main(String[] argv) {
try {
kuzzle = new Kuzzle(new WebSocket("kuzzle"));
AbstractProtocol protocol;
if (System.getenv("SNIPPET_PROTOCOL") != null && System.getenv("SNIPPET_PROTOCOL").equals("http")) {
protocol = new Http("kuzzle");
} else {
protocol = new WebSocket("kuzzle");
}
kuzzle = new Kuzzle(protocol);
kuzzle.connect();
[snippet-code]
System.out.println(result.toString());
Expand Down
11 changes: 8 additions & 3 deletions .ci/doc/templates/print-result.tpl.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import io.kuzzle.sdk.Kuzzle
import io.kuzzle.sdk.protocol.WebSocket
import io.kuzzle.sdk.protocol.*
import java.util.Date

import java.util.concurrent.ExecutionException
import io.kuzzle.sdk.coreClasses.lang.Lang
import io.kuzzle.sdk.coreClasses.responses.Response

fun main() {
val ws = WebSocket("kuzzle")
val kuzzle = Kuzzle(ws).apply {
val protocol: AbstractProtocol;
if (System.getenv("SNIPPET_PROTOCOL") != null && System.getenv("SNIPPET_PROTOCOL") == "http") {
protocol = Http("kuzzle")
} else {
protocol = WebSocket("kuzzle")
}
val kuzzle = Kuzzle(protocol).apply {
connect()
}
try {
Expand Down
12 changes: 9 additions & 3 deletions .ci/doc/templates/print-search-result.tpl.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import io.kuzzle.sdk.Kuzzle;
import java.util.*;
import io.kuzzle.sdk.protocol.WebSocket;
import io.kuzzle.sdk.protocol.*;
import io.kuzzle.sdk.coreClasses.responses.Response;
import io.kuzzle.sdk.coreClasses.SearchResult;
import io.kuzzle.sdk.coreClasses.lang.Lang;
Expand All @@ -10,10 +10,16 @@ public class SnippetTest {

public static void main(String[] argv) {
try {
kuzzle = new Kuzzle(new WebSocket("kuzzle"));
AbstractProtocol protocol;
if (System.getenv("SNIPPET_PROTOCOL") != null && System.getenv("SNIPPET_PROTOCOL").equals("http")) {
protocol = new Http("kuzzle");
} else {
protocol = new WebSocket("kuzzle");
}
kuzzle = new Kuzzle(protocol);
kuzzle.connect();
[snippet-code]
System.out.println("Successfully retrieved " + matched.size() + " documents");
System.out.println("Successfully retrieved " + matched.size() + " documents");
} catch (Exception e) {
e.printStackTrace();
} finally {
Expand Down
Loading

0 comments on commit b169c97

Please sign in to comment.