buildscript { repositories { mavenCentral() jcenter() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion" classpath "org.junit.platform:junit-platform-gradle-plugin:$junitPlatformVersion" } } apply plugin: 'kotlin' apply plugin: 'maven-publish' apply plugin: 'org.jetbrains.dokka' apply plugin: 'org.junit.platform.gradle.plugin' repositories { mavenCentral() } dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlinVersion" testCompile "com.natpryce:hamkrest:$hamkrestVersion" testCompile "org.junit.jupiter:junit-jupiter-params:$junitVersion" testCompile "org.junit.jupiter:junit-jupiter-api:$junitVersion" testRuntime "org.junit.jupiter:junit-jupiter-engine:$junitVersion" } compileKotlin { kotlinOptions.jvmTarget = "1.8" } compileTestKotlin { kotlinOptions.jvmTarget = "1.8" } dokka { outputFormat = 'html' outputDirectory = "$buildDir/docs" } task kdocJar(type: Jar, dependsOn: dokka) { group = LifecycleBasePlugin.BUILD_GROUP description = 'Assembles a jar archive containing the KDoc API documentation.' classifier = 'kdoc' from dokka.outputDirectory } task sourcesJar(type: Jar) { group = LifecycleBasePlugin.BUILD_GROUP description = 'Assembles a jar archive containing the main classes with sources.' classifier = 'sources' from sourceSets.main.allSource } publishing { publications { mavenJava(MavenPublication) { from components.java artifact kdocJar artifact sourcesJar } } }