194 lines
4.3 KiB
Groovy
194 lines
4.3 KiB
Groovy
apply plugin: 'org.jetbrains.kotlin.multiplatform'
|
|
|
|
/*
|
|
* Here's the main hierarchy of variants. Any `expect` functions in one level of the tree are
|
|
* `actual` functions in a (potentially indirect) child node.
|
|
*
|
|
* ```
|
|
* common
|
|
* |-- jvm
|
|
* '-- nonJvm
|
|
* |-- js
|
|
* '-- native
|
|
* |- unix
|
|
* | |-- apple
|
|
* | | |-- iosArm64
|
|
* | | |-- iosX64
|
|
* | | |-- macosX64
|
|
* | | |-- watchosArm32
|
|
* | | |-- watchosArm64
|
|
* | | '-- watchosX86
|
|
* | '-- linux
|
|
* | '-- linuxX64
|
|
* '-- mingw
|
|
* '-- mingwX64
|
|
* ```
|
|
*
|
|
* Every child of `native` also includes a source set that depends on the pointer size:
|
|
*
|
|
* * sizet32 for watchOS, including watchOS 64-bit architectures
|
|
* * sizet64 for everything else
|
|
*
|
|
* The `hashFunctions` source set builds on all platforms. It ships as a main source set on non-JVM
|
|
* platforms and as a test source set on the JVM platform.
|
|
*/
|
|
kotlin {
|
|
jvm {
|
|
withJava()
|
|
}
|
|
if (kmpJsEnabled) {
|
|
js {
|
|
configure([compilations.main, compilations.test]) {
|
|
tasks.getByName(compileKotlinTaskName).kotlinOptions {
|
|
moduleKind = "umd"
|
|
sourceMap = true
|
|
metaInfo = true
|
|
}
|
|
}
|
|
nodejs {
|
|
testTask {
|
|
useMocha {
|
|
timeout = "30s"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (kmpNativeEnabled) {
|
|
iosX64()
|
|
iosArm64()
|
|
watchosArm32()
|
|
watchosArm64()
|
|
watchosX86()
|
|
// Required to generate tests tasks: https://youtrack.jetbrains.com/issue/KT-26547
|
|
linuxX64()
|
|
macosX64()
|
|
mingwX64()
|
|
}
|
|
sourceSets {
|
|
all {
|
|
languageSettings {
|
|
useExperimentalAnnotation('kotlin.RequiresOptIn')
|
|
}
|
|
}
|
|
commonMain {
|
|
dependencies {
|
|
api deps.kotlin.stdLib.common
|
|
}
|
|
}
|
|
commonTest {
|
|
dependencies {
|
|
implementation deps.kotlin.test.common
|
|
implementation deps.kotlin.test.annotations
|
|
implementation deps.kotlin.time
|
|
}
|
|
}
|
|
nonJvmMain {
|
|
kotlin.srcDirs += 'src/hashFunctions/kotlin'
|
|
}
|
|
jvmMain {
|
|
dependencies {
|
|
api deps.kotlin.stdLib.jdk6
|
|
compileOnly deps.animalSniffer.annotations
|
|
}
|
|
}
|
|
jvmTest {
|
|
kotlin.srcDirs += 'src/hashFunctions/kotlin'
|
|
dependencies {
|
|
implementation deps.test.junit
|
|
implementation deps.test.assertj
|
|
implementation deps.kotlin.test.jdk
|
|
}
|
|
}
|
|
jsMain {
|
|
dependsOn nonJvmMain
|
|
dependencies {
|
|
api deps.kotlin.stdLib.js
|
|
}
|
|
}
|
|
jsTest {
|
|
dependencies {
|
|
implementation deps.kotlin.test.js
|
|
}
|
|
}
|
|
|
|
nativeMain {
|
|
dependsOn nonJvmMain
|
|
}
|
|
nativeTest {
|
|
dependsOn commonTest
|
|
}
|
|
|
|
sizet32Main {
|
|
dependsOn nativeMain
|
|
}
|
|
sizet64Main {
|
|
dependsOn nativeMain
|
|
}
|
|
|
|
mingwMain {
|
|
dependsOn nativeMain
|
|
}
|
|
mingwX64Main {
|
|
dependsOn sizet64Main
|
|
dependsOn mingwMain
|
|
}
|
|
mingwX64Test {
|
|
dependsOn nativeTest
|
|
}
|
|
|
|
unixMain {
|
|
dependsOn nativeMain
|
|
}
|
|
|
|
appleMain {
|
|
dependsOn unixMain
|
|
}
|
|
appleTest {
|
|
dependsOn nativeTest
|
|
}
|
|
configure([iosX64Main, iosArm64Main, macosX64Main]) {
|
|
dependsOn sizet64Main
|
|
dependsOn appleMain
|
|
}
|
|
configure([iosX64Test, iosArm64Test, macosX64Test]) {
|
|
dependsOn appleTest
|
|
}
|
|
configure([watchosArm32Main, watchosArm64Main, watchosX86Main]) {
|
|
// Note that size_t is 32-bit on all watchOS versions (ie. pointers are always 32-bit).
|
|
dependsOn sizet32Main
|
|
dependsOn appleMain
|
|
}
|
|
configure([watchosArm32Test, watchosArm64Test, watchosX86Test]) {
|
|
dependsOn appleTest
|
|
}
|
|
|
|
linuxMain {
|
|
dependsOn unixMain
|
|
dependsOn nativeMain
|
|
}
|
|
linuxX64Main {
|
|
dependsOn sizet64Main
|
|
dependsOn linuxMain
|
|
}
|
|
linuxX64Test {
|
|
dependsOn nativeTest
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.encoding = 'UTF-8'
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
// modify these lines for MANIFEST.MF properties or for specific bnd instructions
|
|
project.ext.bndManifest = '''
|
|
Export-Package: okio
|
|
Automatic-Module-Name: okio
|
|
Bundle-SymbolicName: com.squareup.okio
|
|
'''
|
|
|
|
apply from: 'jvm/jvm.gradle'
|
|
apply from: "$rootDir/gradle/gradle-mvn-mpp-push.gradle"
|