-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
108 lines (89 loc) · 2.63 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
plugins {
kotlin("multiplatform") version "1.6.10"// kotlin version
id("convention.publication")
id("com.android.library")
}
val coroutinesVersion = "1.6.1-native-mt"
/*
Publish to maven
https://dev.to/kotlin/how-to-build-and-publish-a-kotlin-multiplatform-library-going-public-4a8k
https://getstream.io/blog/publishing-libraries-to-mavencentral-2021/#your-first-release
Build and send
0. ./gradlew clean
1. ./gradlew publishAllPublicationsToSonatypeRepository
Confirm
1. go to https://s01.oss.sonatype.org/#stagingRepositories
2. Find your repository in the ‘Staging repositories’ section.
3. Close it.
4. 🚀 Release it!
*/
object libVersion{
private val major = 0
private val minor = 1
private val patch = 8
val num = 10_000 * major + 100 * minor + 1 * patch
val text = "$major.$minor.$patch"
}
group = "io.github.september669"
version = libVersion.text
repositories {
gradlePluginPortal() // To use 'maven-publish' and 'signing' plugins in our own plugin
google()
mavenCentral()
}
kotlin {
targets.all {
compilations.all {
kotlinOptions {
// -Werror
//allWarningsAsErrors = true
}
}
}
android {
publishLibraryVariants("release", "debug")
}
ios()
sourceSets {
val commonMain by getting {
dependencies {
api("io.github.september669:AnkoLogger:0.2.8")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("org.jetbrains.kotlinx:atomicfu:0.16.3")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val androidMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
implementation("androidx.lifecycle:lifecycle-viewmodel:2.4.1")
}
}
val androidTest by getting
val iosMain by getting
val iosTest by getting
}
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
android {
compileSdkVersion(30)
defaultConfig {
minSdkVersion(20)
targetSdkVersion(30)
versionCode = libVersion.num
versionName = libVersion.text
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
}