-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
171 lines (158 loc) · 4.4 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
plugins {
kotlin("multiplatform") version "1.8.22"
id("com.android.library")
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
ext["PUBLISH_GROUP_ID"] = "com.davidarvelo"
ext["PUBLISH_VERSION"] = "3.2.2"
ext["PUBLISH_ARTIFACT_ID"] = "fractional-indexing"
apply(from = "${rootDir}/scripts/publish-root.gradle")
apply(from = "${rootProject.projectDir}/scripts/publish-module.gradle")
repositories {
google()
mavenCentral()
}
//group = "com.davidarvelo"
//version = "3.2.0"
group = ext["PUBLISH_GROUP_ID"]!!
version = ext["PUBLISH_VERSION"]!!
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "11"
}
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
js(IR) {
browser {
commonWebpackConfig {
cssSupport {
enabled.set(true)
}
}
}
binaries.executable()
nodejs {
}
}
val hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows")
val nativeTarget = when {
// hostOs == "Mac OS X" -> macosX64("native")
// hostOs == "Linux" -> linuxX64("native")
// isMingwX64 -> mingwX64("native")
hostOs == "Mac OS X" -> macosX64()
hostOs == "Linux" -> linuxX64()
isMingwX64 -> mingwX64()
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
macosX64 {
binaries {
executable {
entryPoint = "main"
}
}
}
iosArm64 {
binaries {
framework {
baseName = "library"
}
}
}
iosX64 {
binaries {
framework {
baseName = "library"
}
}
}
iosSimulatorArm64 {
binaries {
framework {
baseName = "library"
}
}
}
android {
publishAllLibraryVariants()
}
linuxX64()
sourceSets {
val commonMain by getting
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting
val jvmTest by getting
val jsMain by getting
val jsTest by getting
// val nativeMain by getting
// val nativeTest by getting
val iosSimulatorArm64Main by sourceSets.getting
val iosSimulatorArm64Test by sourceSets.getting
val macosX64Main by getting
val macosX64Test by getting
val iosArm64Main by getting
val iosArm64Test by getting
val iosX64Main by getting
val iosX64Test by getting
val androidMain by getting
val androidInstrumentedTest by getting {
// dependencies {
// implementation("junit:junit:4.13.2")
// }
}
val linuxX64Main by getting
val linuxX64Test by getting
// Set up dependencies between the source sets
iosSimulatorArm64Main.dependsOn(iosArm64Main)
iosSimulatorArm64Test.dependsOn(iosArm64Test)
}
}
android {
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") // Create AndroidManifest.xml and provide path to it
namespace = "com.davidarvelo"
compileSdk = 34
kotlin {
jvmToolchain(11)
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
defaultConfig {
minSdk = 23
targetSdk = 34
}
buildTypes {
getByName("debug") {
// namespace = "com.davidarvelo.fractional-indexing-android-debug"
isMinifyEnabled = false
}
getByName("release") {
// namespace = "com.davidarvelo.fractional-indexing-android"
isMinifyEnabled = false
// proguardFiles(
// getDefaultProguardFile("proguard-android-optimize.txt"),
// "proguard-rules.pro"
// )
}
}
}
task("listComponents") {
afterEvaluate {
println("Components: " + components.map { it.name })
}
}
val signingTasks: TaskCollection<Sign> = tasks.withType<Sign>()
tasks.withType<PublishToMavenRepository>().configureEach {
mustRunAfter(signingTasks)
}
tasks.withType<PublishToMavenLocal>().configureEach {
mustRunAfter(signingTasks)
}