-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
110 lines (100 loc) · 2.81 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
plugins {
kotlin("multiplatform") version "1.7.10"
kotlin("plugin.serialization") version "1.7.10"
id("com.android.library")
id("maven-publish")
signing
}
group = "com.metaplex"
version = "development"
repositories {
google()
jcenter()
mavenCentral()
}
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
testRuns["test"].executionTask.configure {
useJUnit()
}
}
android {
publishLibraryVariants("release")
}
// js {
// moduleName = "kborsh"
// browser()
// nodejs()
// }
sourceSets {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting {
kotlin.srcDir("src/commonJvmAndroid/kotlin")
}
val androidMain by getting {
kotlin.srcDir("src/commonJvmAndroid/kotlin")
dependencies {
implementation("androidx.core:core-ktx:1.9.0")
}
}
val androidTest by getting {
kotlin.srcDir("src/jvmTest/kotlin")
kotlin.srcDir("src/androidTest/kotlin")
}
val jvmTest by getting
// val jsMain by getting {
// dependencies {
// implementation("org.jetbrains.kotlinx:kotlinx-nodejs:0.0.7")
// }
// }
// val jsTest by getting
}
}
android {
compileSdk = 31
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 21
targetSdk = 31
}
namespace = "$group.${rootProject.name}"
}
System.getenv("GITHUB_REPOSITORY")?.let {
val publishedGroupId = "com.metaplex"
val branchName = System.getenv("GITHUB_HEAD_REF")
?: System.getenv("GITHUB_REF_NAME")?.split('/')?.last()
val libraryVersion =
if (System.getenv("GITHUB_REF_TYPE") == "tag")
System.getenv("GITHUB_REF_NAME")
else
"$branchName-SNAPSHOT"
println("PUBLISHING LIBRARY: $publishedGroupId:$libraryVersion")
project.group = publishedGroupId
project.version = libraryVersion
publishing {
publications.withType(MavenPublication::class) {
groupId = publishedGroupId
version = libraryVersion
}
repositories {
maven {
name = "github"
url = uri("https://maven.pkg.github.com/$it")
credentials(PasswordCredentials::class)
}
}
}
}