-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle.kts
116 lines (107 loc) · 4.07 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
114
115
116
import magik.createGithubPublication
import magik.github
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
import uns.gen.GenerateCode
import java.util.*
plugins {
kotlin("multiplatform") version embeddedKotlinVersion
id("elect86.magik") version "0.3.3"
`maven-publish`
signing
`jvm-test-suite`
// id("com.github.johnrengelman.shadow") version "8.1.1"
}
repositories { mavenCentral() }
kotlin {
jvm {
jvmToolchain(11)
withJava()
}
val hostOs = System.getProperty("os.name")
val isArm64 = System.getProperty("os.arch") == "aarch64"
val isMingwX64 = hostOs.startsWith("Windows")
val nativeTarget = when {
hostOs == "Mac OS X" && isArm64 -> macosArm64("native")
hostOs == "Mac OS X" && !isArm64 -> macosX64("native")
hostOs == "Linux" && isArm64 -> linuxArm64("native")
hostOs == "Linux" && !isArm64 -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
sourceSets {
val commonMain by getting {
dependencies {
implementation("com.ionspin.kotlin:bignum:0.3.8")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting
val jvmTest by getting
// val jsMain by getting
// val jsTest by getting
val nativeMain by getting
val nativeTest by getting
}
}
tasks {
val generateCode by registering(GenerateCode::class)
kotlin.sourceSets.commonMain { kotlin.srcDir(generateCode) }
withType<KotlinCompile<*>>().all { kotlinOptions { freeCompilerArgs += listOf("-opt-in=kotlin.RequiresOptIn") } }
}
testing.suites {
val test by getting(JvmTestSuite::class) { useJUnitJupiter() }
}
//java {
// withJavadocJar()
// withSourcesJar()
//}
publishing {
// publications {
// withType<MavenPublication> {
// groupId = "io.github.kotlin-graphics"
// artifactId = "kotlin-unsigned"
//// from(components["java"])
//// versionMapping {
//// usage("java-api") { fromResolutionOf("runtimeClasspath") }
//// usage("java-runtime") { fromResolutionResult() }
//// }
// pom {
// name = "kotlin-unsigned"
// description = "unsigned support for Kotlin via boxed types and unsigned operators"
// url = "https://github.com/kotlin-graphics/kotlin-unsigned"
// licenses { license { name = "MIT"; url = "https://choosealicense.com/licenses/mit/" } }
// developers {
// developer { id = "elect86"; name = "Giuseppe Barbieri"; email = "[email protected]" }
// developer { id = "bixilon"; name = "Moritz Zwerger"; email = "[email protected]" }
// }
// scm {
// connection = "scm:git:https://github.com/kotlin-graphics/kotlin-unsigned.git"
// developerConnection = "scm:git:ssh://[email protected]:kotlin-graphics/kotlin-unsigned.git"
// url = "https://github.com/kotlin-graphics/kotlin-unsigned"
// }
// }
// }
// }
repositories {
github { domain = "kotlin-graphics/mary" }
// maven {
// name = "mavenCentral"
// credentials {
// username = project.properties["NEXUS_USERNAME"].toString()
// password = project.properties["NEXUS_PASSWORD"].toString()
// }
// url = uri("https://s01.oss.sonatype.org/content/repositories/releases/")
// }
}
}
signing {
val rawKey = project.properties["SIGNING_KEY"]?.toString() ?: return@signing
val key = String(Base64.getDecoder().decode(rawKey)) // \n is not working in environment variables
val password = project.properties["SIGNING_KEY_PASSWORD"]?.toString() ?: ""
useInMemoryPgpKeys(key, password)
sign(publishing.publications["mavenCentral"])
}