Skip to content

Commit

Permalink
added publish plugin for jitpack
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrulya-exe committed Apr 21, 2022
1 parent 48a4e1f commit 7d92697
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 17 deletions.
27 changes: 27 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.6.0"
`maven-publish`
}

configure<PublishingExtension> {
repositories {
maven {
name = "JitPack"
url = uri("https://jitpack.io")
}
}

publications {
create<MavenPublication>("mavenKotlin") {
from(components["kotlin"])
}
}
}

group = "ru.nsu"
Expand Down Expand Up @@ -29,6 +45,7 @@ dependencies {

testImplementation(kotlin("test"))
testImplementation("io.kotest:kotest-assertions-core:5.1.0")
implementation(kotlin("stdlib-jdk8"))
}

tasks.test {
Expand All @@ -37,4 +54,14 @@ tasks.test {

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}

val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
}

val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
}
27 changes: 11 additions & 16 deletions src/test/kotlin/ru/nsu/convoyeur/examples/LinearGraphExample.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,21 @@ class LinearGraphExample : ConvoyeurExample<Int>() {
// send value to channel 'filter-id'
emit(it)
}
println("[SOURCE] FINISH")
}

// stateful transform node
val filterNode = StatefulTransformNode<Int, String>(
id = "filter-id",
action = {
// in such nodes we can use
var someState = 0
// get input channel by name
val inputChan = inputChannel("source-id")
inputChan?.consumeEach {
if (it % 2 == 0) {
println("[FILTER] Sending to map $it")
emit("map-id", "Filtered [$it] + state[$someState]")
}
someState = (0..1000).random()
val filterNode = StatefulTransformNode<Int, String>("filter-id") {
// in such nodes we can use
var someState = 0
// get input channel by name
val inputChan = inputChannel("source-id")
inputChan?.consumeEach {
if (it % 2 == 0) {
emit("map-id", "Filtered [$it] + state[$someState]")
}
println("[FILTER] FINISH")
})
someState = (0..1000).random()
}
}

// stateless (except closure variables) transform node (with both inputs and outputs)
val mapNode = TransformNode<String, String>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class SeveralSourcesExample : ConvoyeurExample<Int>() {
) { channelName, value ->
println("[SINK] Get value '$value' from channel '$channelName")
// check backpressure
delay(400)
delay(200)
}

val sinkNode2 = SinkNode<String>(
Expand Down

0 comments on commit 7d92697

Please sign in to comment.