Skip to content
Open
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 .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.gradle/
.idea/
kotlin/sample/build/
kotlin/library/build/
kotlin/build/
36 changes: 6 additions & 30 deletions kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,27 @@

buildscript {
ext {
kotlin_version = '1.1.51'
kotlin_version = '1.2.31'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.junit.platform:junit-platform-gradle-plugin:1.0.1"
}
}

apply plugin: "idea"
apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "application"
apply plugin: "org.junit.platform.gradle.plugin"

sourceSets {
main.java.srcDirs += 'src/'
}

junitPlatform {
filters {
engines {
include 'spek'
}
allprojects {
repositories {
mavenCentral()
jcenter()
}
}

mainClassName = "LogEvent"

repositories {
mavenCentral()
jcenter()
maven { url "http://dl.bintray.com/jetbrains/spek" }
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile 'com.github.kittinunf.fuel:fuel:1.11.0'

testCompile 'org.jetbrains.kotlin:kotlin-test'
testCompile 'org.jetbrains.spek:spek-api:1.1.5'
testCompile 'org.junit.platform:junit-platform-runner:1.0.1'
testRuntime 'org.jetbrains.spek:spek-junit-platform-engine:1.1.5'
}
mainClassName = "vacuumanalytics.LogEventKt"
57 changes: 57 additions & 0 deletions kotlin/library/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright 2018 Sourcerer Inc. All Rights Reserved.

buildscript {
ext {
kotlin_version = '1.1.51'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

apply plugin: "idea"
apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "application"

mainClassName = "vacuumanalytics.LogEventKt"

repositories {
mavenCentral()
jcenter()
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile 'com.github.kittinunf.fuel:fuel:1.11.0'
}

repositories {
mavenCentral()
jcenter()
flatDir {
dirs 'libs'
}
}

// Include dependent libraries in archive.
jar {
manifest {
attributes "Main-Class": "$mainClassName"
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}

baseName 'library'
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2018 Sourcerer Inc. All Rights Reserved.
// Author: Alexander Surkov ([email protected])

package sourcererio.vacuumanalytics
package vacuumanalytics

import com.github.kittinunf.fuel.core.FuelError
import com.github.kittinunf.fuel.core.FuelManager
Expand Down
52 changes: 52 additions & 0 deletions kotlin/sample/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright 2018 Sourcerer Inc. All Rights Reserved.

buildscript {
ext {
kotlin_version = '1.1.51'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

apply plugin: "idea"
apply plugin: "java"
apply plugin: "kotlin"
apply plugin: "application"

sourceSets {
main.java.srcDirs += 'src/main/'
}

repositories {
mavenCentral()
jcenter()
}

dependencies {
compile project(':library')
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
/*compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"*/
}

mainClassName = "sample.MainKt"

jar {
manifest {
attributes "Main-Class": "$mainClassName"
}

from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}

baseName 'sample'
}
17 changes: 17 additions & 0 deletions kotlin/sample/src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2018 Sourcerer Inc. All Rights Reserved.
// Author: Alexander Surkov ([email protected])

package sample

import com.github.kittinunf.fuel.core.Response
import java.net.URL
import vacuumanalytics.LogEvent

fun main(argv : Array<String>) {
val fakeResponse = Response(
url = URL("http://0.0.0.0"),
headers = mapOf("Set-Cookie" to listOf("sessionid=kotlintst"))
)
val logger = LogEvent("http://0.0.0.0:8080", fakeResponse, "sessionid")
logger.error("B'eba-%pBeba")
}
1 change: 1 addition & 0 deletions kotlin/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include 'library', 'sample'