Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
98 lines (82 sloc) 2.57 KB
buildscript {
ext.kotlin_version = '1.2.31'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id "com.github.johnrengelman.shadow" version "2.0.3"
id 'com.github.kt3k.coveralls' version '2.6.3'
id 'net.saliman.cobertura' version '2.5.4'
}
apply plugin: "jacoco"
group "uk.co.jrtapsell"
version "1.0"
apply plugin: 'java'
apply plugin: 'kotlin'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven {
url "https://dl.bintray.com/kotlin/kotlin-dev/"
}
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-compiler:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-script-runtime:$kotlin_version"
compile group: 'org.jetbrains.kotlin', name: 'kotlin-script-util', version: kotlin_version
testCompile group: 'org.testng', name: 'testng', version: '6.13.1'
compile group: 'org.jetbrains.kotlin', name: 'kotlin-jsr223-local-example', version: '1.1-M04-eap-14'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.2'
compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.9.+"
}
// https://gist.github.com/JonasGroeger/7620911
def getCheckedOutGitCommitHash() {
def gitFolder = "$projectDir/.git/"
/*
* '.git/HEAD' contains either
* in case of detached head: the currently checked out commit hash
* otherwise: a reference to a file containing the current commit hash
*/
def head = new File(gitFolder + "HEAD").text.split(":") // .git/HEAD
def isCommit = head.length == 1 // e5a7c79edabbf7dd39888442df081b1c9d8e88fd
// def isRef = head.length > 1 // ref: refs/heads/master
if (isCommit) return head[0].trim() // e5a7c79edabb
def refHead = new File(gitFolder + head[1].trim()) // .git/refs/heads/master
refHead.text.trim()
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
test {
useTestNG {
suites 'src/test/testng.xml'
}
}
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Quickstart',
'Implementation-Version': version,
'Main-Class': 'jotlin.runner.EntryPoint',
'Specification-Version': getCheckedOutGitCommitHash()
}
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled true
}
}
coveralls {
sourceDirs = ['src/main/kotlin']
}
cobertura {
coverageSourceDirs = ['src/main/kotlin']
}
You can’t perform that action at this time.