forked from kotlin-graphics/kotlin-unsigned
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
71 lines (58 loc) · 1.57 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
plugins {
id 'maven'
id "org.jetbrains.kotlin.jvm" version "1.3.50"
}
ext{
moduleName = 'com.github.kotlin_graphics.kotlin_unsigned'
kotlin = 'org.jetbrains.kotlin:kotlin'
kotlintest_version = '3.4.0'
}
dependencies {
implementation "$kotlin-stdlib"
testImplementation "io.kotlintest:kotlintest-runner-junit5:$kotlintest_version".toString()
}
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
// archives javadocJar
}
compileKotlin {
// Enable Kotlin compilation to Java 8 class files with method parameter name metadata
kotlinOptions{
jvmTarget = "11"
// javaParameters = true
}
// As per https://stackoverflow.com/a/47669720
// See also https://discuss.kotlinlang.org/t/kotlin-support-for-java-9-module-system/2499/9
destinationDir = compileJava.destinationDir
}
compileTestKotlin {
kotlinOptions{
jvmTarget = "11"
// javaParameters = true
}
}
compileJava {
dependsOn(':compileKotlin')
doFirst {
options.compilerArgs = ['--module-path', classpath.asPath,]
classpath = files()
}
}
jar {
inputs.property("moduleName", moduleName)
// manifest.attributes('Automatic-Module-Name': moduleName)
// duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
test.useJUnitPlatform()