1+ import org.jetbrains.dokka.gradle.LinkMapping
12import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
23
34plugins {
4- kotlin(" jvm" ) version " 1.3.50"
5- id(" org.jetbrains.dokka" ) version " 0.9.17"
5+ kotlin(" jvm" ) version " 1.3.50" apply (true )
6+ id(" org.jetbrains.dokka" ) version " 0.9.18"
7+ id(" com.jfrog.bintray" ) version " 1.8.4"
68 `build- scan`
79}
810
@@ -12,43 +14,70 @@ buildScan {
1214 publishAlways()
1315}
1416
17+ group = " org.mechdancer"
1518version = " 0.2.5-dev-3"
1619
17- allprojects {
18- apply (plugin = " kotlin" )
19- group = " org.mechdancer"
20- repositories {
21- mavenCentral()
22- jcenter()
23- }
24- dependencies {
25- implementation(kotlin(" stdlib-jdk8" ))
2620
27- testImplementation(" junit" , " junit" , " +" )
28- testImplementation(kotlin(" test-junit" ))
29- }
30- tasks.withType<KotlinCompile > {
31- kotlinOptions {
32- jvmTarget = " 1.8"
33- }
21+ repositories {
22+ mavenCentral()
23+ jcenter()
24+ }
25+ dependencies {
26+ implementation(kotlin(" stdlib-jdk8" ))
27+
28+ testImplementation(" junit" , " junit" , " +" )
29+ testImplementation(kotlin(" test-junit" ))
30+ }
31+ tasks.withType<KotlinCompile > {
32+ kotlinOptions {
33+ jvmTarget = " 1.8"
3434 }
3535}
3636
37+
3738tasks.dokka {
3839 outputFormat = " html"
3940 outputDirectory = " $buildDir /javadoc"
41+ linkMappings.add(LinkMapping ().apply {
42+ dir = " src"
43+ url = " https://github.com/MechDancer/linearalgebra/tree/master/src"
44+ suffix = " #L"
45+ })
4046}
4147
42- val dokkaJar by tasks.creating( Jar :: class ) {
48+ val doc = tasks.register< Jar >( " javadocJar " ) {
4349 group = JavaBasePlugin .DOCUMENTATION_GROUP
4450 description = " Assembles Kotlin docs with Dokka"
4551 archiveClassifier.set(" javadoc" )
4652 from(tasks.dokka)
4753}
4854
49- val packJars by tasks.creating( Jar :: class ) {
55+ val sources = tasks.register< Jar >( " sourcesJar " ) {
5056 group = JavaBasePlugin .BUILD_TASK_NAME
51- description = " pack all jars "
52- from(tasks.jar )
53- from(dokkaJar )
57+ description = " Creates sources jar "
58+ archiveClassifier.set( " sources " )
59+ from(sourceSets.main.get().allSource )
5460}
61+
62+ val fat = tasks.register<Jar >(" fatJar" ) {
63+ group = JavaBasePlugin .BUILD_TASK_NAME
64+ description = " Packs binary output with dependencies"
65+ archiveClassifier.set(" all" )
66+ from(sourceSets.main.get().output)
67+ from({
68+ configurations.runtimeClasspath.get().filter { it.name.endsWith(" jar" ) }.map { zipTree(it) }
69+ })
70+ }
71+
72+ tasks.register(" allJars" ) {
73+ group = JavaBasePlugin .BUILD_TASK_NAME
74+ description = " Assembles all jars in one task"
75+ dependsOn(doc, sources, fat, tasks.jar)
76+ }
77+
78+ artifacts {
79+ add(" archives" , tasks.jar)
80+ add(" archives" , fat)
81+ add(" archives" , sources)
82+ add(" archives" , doc)
83+ }
0 commit comments