-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
119 lines (110 loc) · 3.27 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
import org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency
plugins {
kotlin("multiplatform") version "1.3.72"
id("com.android.library")
id("maven-publish")
}
group = Configuration.group
version = Configuration.version
repositories {
gradlePluginPortal()
google()
jcenter()
mavenCentral()
maven {
url = uri("https://dl.bintray.com/kotlin/kotlin-eap")
}
}
kotlin {
android()
ios {
binaries {
framework {
baseName = "kotorra"
}
}
}
js {
browser()
}
jvm()
val commonMain by sourceSets.getting {
dependencies {
implementation(kotlin("stdlib-common"))
}
}
val commonTest by sourceSets.getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val androidMain by sourceSets.getting {
dependencies {
implementation(kotlin("stdlib-jdk7"))
}
}
val androidTest by sourceSets.getting {}
val iosMain by sourceSets.getting {}
val iosTest by sourceSets.getting {}
val jsMain by sourceSets.getting {
dependencies {
implementation(kotlin("stdlib-js"))
}
}
val jsTest by sourceSets.getting {
dependencies {
implementation(kotlin("test-js"))
}
}
val jvmMain by sourceSets.getting {
dependencies {
implementation(kotlin("stdlib-jdk7"))
}
}
val jvmTest by sourceSets.getting {}
}
android {
compileSdkVersion(29)
defaultConfig {
minSdkVersion(15)
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
}
project.afterEvaluate {
publishing {
publications {
create<MavenPublication>("maven") {
groupId = Configuration.group
artifactId = Configuration.Android.artifactId
version = Configuration.version
artifact("${project.buildDir}/outputs/aar/${project.name}-release.aar")
pom {
withXml {
val dependenciesNode = asNode().appendNode("dependencies")
listOf(
Pair("compile", "compile"),
Pair("api", "api"),
Pair("implementation", "runtime")
).forEach { scope ->
configurations.findByName(scope.first)?.dependencies
?.filterIsInstance<DefaultExternalModuleDependency>()
?.forEach { dependency ->
dependenciesNode.appendNode("dependency").apply {
appendNode("groupId", dependency.group)
appendNode("artifactId", dependency.name)
appendNode("version", dependency.version)
appendNode("scope", scope.second)
}
}
}
}
}
}
}
}
}