| buildscript { |
| ext.kotlin_version = '1.2.0' |
| repositories { |
| mavenCentral() |
| maven { url 'http://repo.spring.io/plugins-release' } |
| } |
| dependencies { |
| classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7' |
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
| classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0' |
| } |
| } |
| |
| apply plugin: 'java' |
| apply plugin: 'maven' |
| apply plugin: 'propdeps' |
| apply plugin: 'propdeps-maven' |
| apply plugin: 'kotlin' |
| apply plugin: 'org.junit.platform.gradle.plugin' |
| |
| group = 'com.github.username' |
| |
| sourceCompatibility = 1.8 |
| targetCompatibility = 1.8 |
| |
| repositories { |
| jcenter() |
| } |
| |
| task sourcesJar(type: Jar, dependsOn: classes) { |
| classifier = 'sources' |
| from sourceSets.main.allSource |
| } |
| |
| task javadocJar(type: Jar, dependsOn: javadoc) { |
| classifier = 'javadoc' |
| from javadoc.destinationDir |
| } |
| |
| artifacts { |
| archives sourcesJar |
| archives javadocJar |
| } |
| |
| configurations { |
| ktlint |
| } |
| |
| dependencies { |
| compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" |
| provided 'com.github.shyiko.ktlint:ktlint-core:0.14.0' |
| |
| testCompile 'org.jetbrains.spek:spek-api:1.1.5' |
| testRuntime 'org.jetbrains.spek:spek-junit-platform-engine:1.1.5' |
| testCompile 'org.assertj:assertj-core:3.5.2' |
| testCompile 'com.github.shyiko.ktlint:ktlint-test:0.9.0' |
| |
| ktlint 'com.github.shyiko:ktlint:0.14.0' |
| } |
| |
| task ktlint(type: JavaExec, dependsOn: classes) { |
| main = 'com.github.shyiko.ktlint.Main' |
| // adding compiled classes to the classpath so that ktlint would validate project's sources |
| // using its own ruleset (in other words to dogfood) |
| classpath = configurations.ktlint + sourceSets.main.output |
| args '--debug', 'src/**/*.kt' |
| } |
| |
| check.dependsOn ktlint |
| |
| install { |
| repositories.mavenInstaller { |
| pom.project { |
| licenses { |
| license { |
| name 'The Apache Software License, Version 2.0' |
| url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| distribution 'repo' |
| } |
| } |
| } |
| } |
| } |