-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
113 lines (93 loc) · 3.6 KB
/
build.gradle.kts
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockMismatchReport
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import org.jetbrains.kotlin.utils.addToStdlib.applyIf
group = "io.kinference"
version = "0.2.26"
plugins {
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kinference.primitives) apply false
`maven-publish`
idea apply true
}
allprojects {
repositories {
mavenCentral()
maven(url = "https://packages.jetbrains.team/maven/p/ki/maven")
maven(url = "https://packages.jetbrains.team/maven/p/grazi/grazie-platform-public")
maven("https://repo.kotlin.link")
}
plugins.withType<YarnPlugin>() {
the<YarnRootExtension>().yarnLockMismatchReport = YarnLockMismatchReport.WARNING
}
}
subprojects {
if (this.subprojects.isNotEmpty()) return@subprojects
apply {
plugin("org.jetbrains.kotlin.multiplatform")
plugin("idea")
}
applyIf(path != ":examples") {
apply(plugin = "maven-publish")
publishing {
publications {
all {
if (this !is MavenPublication) return@all
pom {
name = "KInference"
description =
"KInference is a library that simplifies the execution of complex ONNX machine learning models in Kotlin. " +
"It ensures efficient inference of these models on various platforms and is designed for both server-side and local usage."
licenses {
license {
name = "Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0"
}
}
scm {
url = "https://github.com/JetBrains-Research/kinference"
}
}
}
}
repositories {
maven {
name = "SpacePackages"
url = uri("https://packages.jetbrains.team/maven/p/ki/maven")
credentials {
username = System.getenv("JB_SPACE_CLIENT_ID")
password = System.getenv("JB_SPACE_CLIENT_SECRET")
}
}
}
}
}
extensions.getByType(KotlinMultiplatformExtension::class.java).apply {
sourceSets.all {
languageSettings {
optIn("kotlin.RequiresOptIn")
optIn("kotlin.ExperimentalUnsignedTypes")
}
}
}
val kotlinVersion = KotlinVersion.KOTLIN_2_0
val jvmTargetVersion = JvmTarget.JVM_17
tasks.withType(KotlinCompilationTask::class.java) {
compilerOptions {
apiVersion.set(kotlinVersion)
languageVersion.set(kotlinVersion)
if (this is KotlinJvmCompilerOptions) {
jvmTarget.set(jvmTargetVersion)
}
}
}
tasks.withType(JavaCompile::class.java) {
sourceCompatibility = jvmTargetVersion.toString()
targetCompatibility = jvmTargetVersion.toString()
}
}