forked from Liftric/KVault
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
156 lines (135 loc) · 3.87 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeSimulatorTest
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("multiplatform") version libs.versions.kotlin
id("com.android.library") version libs.versions.android.tools.gradle
id("maven-publish")
id("signing")
alias(libs.plugins.versioning)
}
repositories {
google()
mavenCentral()
}
kotlin {
ios {
binaries.framework()
}
iosSimulatorArm64()
android {
publishLibraryVariants("debug", "release")
}
sourceSets {
val commonMain by getting
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val androidMain by getting {
dependencies {
implementation(libs.security.crypto)
}
}
val androidTest by getting {
dependencies {
implementation(libs.roboelectric)
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
implementation(libs.androidx.test.core)
}
}
val iosMain by getting
val iosTest by getting
val iosSimulatorArm64Main by getting {
dependsOn(iosMain)
}
val iosSimulatorArm64Test by getting {
dependsOn(iosTest)
}
all {
languageSettings.optIn("kotlin.ExperimentalUnsignedTypes")
}
}
}
tasks {
val iosX64Test by existing(KotlinNativeSimulatorTest::class) {
filter.excludeTestsMatching("com.liftric.kvault.KVaultTest")
}
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
}
}
}
android {
namespace = "com.liftric.kvault"
compileSdk = 33
defaultConfig {
minSdk = 21
targetSdk = 33
testInstrumentationRunner = "androidx.test.runner"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
group = "com.liftric"
version = with(versioning.info) {
if (branch == "HEAD" && dirty.not()) tag else full
}
afterEvaluate {
project.publishing.publications.withType(MavenPublication::class.java).forEach {
it.groupId = project.group.toString()
}
}
val ossrhUsername: String? by project
val ossrhPassword: String? by project
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}
publishing {
repositories {
maven {
name = "sonatype"
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
publications.withType<MavenPublication> {
artifact(javadocJar.get())
pom {
name.set(project.name)
description.set("Secure key-value storage for Kotlin Multiplatform projects")
url.set("https://github.com/Liftric/kvault")
licenses {
license {
name.set("MIT")
url.set("https://github.com/Liftric/kvault/blob/master/LICENSE")
}
}
developers {
developer {
id.set("gaebel")
name.set("Jan Gaebel")
email.set("[email protected]")
}
}
scm {
url.set("https://github.com/Liftric/kvault")
}
}
}
}
signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications)
}