11plugins {
22 java
33 kotlin(" jvm" ) version " 1.3.72"
4+ id(" org.jetbrains.dokka" ) version " 0.10.1"
45}
56
67val moduleName = " com.github.kotlin_graphics.kotlin_unsigned"
78val kot = " org.jetbrains.kotlin:kotlin"
8- val kotlintest_version = " 3.4.2 "
9+ val kotlintest_version = " 4.0.5 "
910
1011repositories {
1112 mavenCentral()
13+ jcenter()
1214 maven { url = uri(" https://jitpack.io" ) }
1315}
1416
1517dependencies {
18+ implementation(kotlin(" stdlib" ))
1619 implementation(kotlin(" stdlib-jdk8" ))
1720
1821 attributesSchema.attribute(LibraryElements .LIBRARY_ELEMENTS_ATTRIBUTE ).compatibilityRules.add(ModularJarCompatibilityRule ::class )
22+ components { withModule<ModularKotlinRule >(kotlin(" stdlib" )) }
1923 components { withModule<ModularKotlinRule >(kotlin(" stdlib-jdk8" )) }
2024
21- testImplementation(" io.kotlintest:kotlintest-runner-junit5:$kotlintest_version " )
25+ listOf (" runner-junit5" , " assertions-core" /* , "property"*/ ).forEach {
26+ testImplementation(" io.kotest:kotest-$it -jvm:$kotlintest_version " )
27+ }
2228}
2329
2430java {
2531 modularity.inferModulePath.set(true )
2632}
2733
28- // java {
29- // withJavadocJar()
30- // withSourcesJar()
31- // }
32-
33- // task sourcesJar(type: Jar, dependsOn: classes) {
34- // archiveClassifier = 'sources'
35- // from sourceSets.main.allSource
36- // }
37- //
38- // task javadocJar(type: Jar, dependsOn: javadoc) {
39- // archiveClassifier = 'javadoc'
40- // from javadoc.destinationDir
41- // }
42- //
43- // artifacts {
44- // archives sourcesJar
45- // // archives javadocJar
46- // }
47- //
34+ tasks {
35+ val dokka by getting(org.jetbrains.dokka.gradle.DokkaTask ::class ) {
36+ outputFormat = " html"
37+ outputDirectory = " $buildDir /dokka"
38+ }
39+ }
40+
41+ val dokkaJar by tasks.creating(Jar ::class ) {
42+ group = JavaBasePlugin .DOCUMENTATION_GROUP
43+ description = " Assembles Kotlin docs with Dokka"
44+ archiveClassifier.set(" javadoc" )
45+ from(tasks.dokka)
46+ }
47+
48+ val sourceJar = task(" sourceJar" , Jar ::class ) {
49+ dependsOn(tasks[" classes" ])
50+ archiveClassifier.set(" sources" )
51+ from(sourceSets.main.get().allSource)
52+ }
53+
54+ artifacts {
55+ archives(sourceJar)
56+ archives(dokkaJar)
57+ }
58+
4859
4960tasks.compileKotlin {
5061 // Enable Kotlin compilation to Java 8 class files with method parameter name metadata
@@ -70,8 +81,9 @@ tasks.compileJava {
7081 options.compilerArgs = listOf (" --patch-module" , " $moduleName =${sourceSets.main.get().output.asPath} " )
7182}
7283
73-
74- // test.useJUnitPlatform()
84+ tasks.withType<Test > {
85+ useJUnitPlatform()
86+ }
7587
7688// == Add access to the 'modular' variant of kotlin("stdlib"): Put this into a buildSrc plugin and reuse it in all your subprojects
7789configurations.all {
0 commit comments