forked from ton-community/ton-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
129 lines (117 loc) · 3.99 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
117
118
119
120
121
122
123
124
125
126
127
128
129
import java.util.*
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
id("org.jetbrains.kotlinx.benchmark")
`maven-publish`
signing
}
val localPropsFile = project.rootProject.file("local.properties")
if (localPropsFile.exists()) {
val p = Properties()
localPropsFile.inputStream().use { p.load(it) }
p.forEach { name, value -> ext.set(name.toString(), value) }
}
allprojects {
group = "org.ton"
version = "0.0.3"
apply(plugin = "kotlin-multiplatform")
apply(plugin = "kotlinx-serialization")
apply(plugin = "maven-publish")
apply(plugin = "signing")
repositories {
mavenCentral()
maven("https://jitpack.io")
}
kotlin {
jvm {
withJava()
compilations.all {
kotlinOptions.jvmTarget = "11"
}
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
// linuxX64()
// macosX64()
// js {
// useCommonJs()
// browser()
// }
sourceSets {
val commonMain by getting {
dependencies {
subprojects {
api(this)
}
}
}
val commonTest by getting {
dependencies {
implementation("io.mockk:mockk:1.12.4")
implementation(kotlin("test"))
}
}
val jvmMain by getting {
}
val jvmTest by getting {
dependencies {
implementation(kotlin("test"))
implementation("junit:junit:4.13.1")
}
}
}
}
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}
publishing {
repositories {
maven {
val releasesUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().contains("SNAPSHOT")) snapshotsUrl else releasesUrl
credentials {
username = project.properties["ossrhUsername"].toString()
password = project.properties["ossrhPassword"].toString()
}
}
}
publications.withType<MavenPublication> {
artifact(javadocJar.get())
pom {
name.set("ton-kotlin")
description.set("Pure Kotlin implementation of The Open Network")
url.set("https://github.com/andreypfau/ton-kotlin")
licenses {
license {
name.set("GNU General Public License v3.0")
url.set("https://www.gnu.org/licenses/gpl-3.0.html")
}
}
developers {
developer {
id.set("andreypfau")
name.set("Andrey Pfau")
email.set("andreypfau@ton.org")
}
}
scm {
connection.set("scm:git:git://github.com/andreypfau/ton-kotlin.git")
developerConnection.set("scm:git:ssh://github.com/andreypfau/ton-kotlin.git")
url.set("https://github.com/andreypfau/ton-kotlin")
}
}
}
}
val signingKeyId = project.properties["signing.keyId"]?.toString()
val signingSecretKey = project.properties["signing.secretKey"]?.toString()
val signingPassword = project.properties["signing.password"]?.toString()
if (signingKeyId != null && signingSecretKey != null && signingPassword != null) {
signing {
sign(publishing.publications)
useInMemoryPgpKeys(signingKeyId, signingSecretKey, signingPassword)
}
}
}