forked from littlektframework/littlekt-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
129 lines (115 loc) · 3.58 KB
/
build.gradle.kts
File metadata and controls
129 lines (115 loc) · 3.58 KB
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
import com.lehaine.littlekt.gradle.texturepacker.littleKt
import com.lehaine.littlekt.gradle.texturepacker.packing
import com.lehaine.littlekt.gradle.texturepacker.texturePacker
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
buildscript {
val littleKtVersion: String by project
val androidPluginVersion: String by project
repositories {
google()
mavenLocal()
mavenCentral()
maven(url ="https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
dependencies {
classpath("com.lehaine.littlekt.gradle:texturepacker:$littleKtVersion")
classpath("com.android.tools.build:gradle:$androidPluginVersion")
}
}
plugins {
kotlin("multiplatform") version "1.7.20"
kotlin("plugin.serialization") version "1.7.20"
id("com.android.application") version "7.0.4"
id("com.lehaine.littlekt.gradle.texturepacker") version "0.4.0"
}
group = "com.lehaine.littlekt.samples"
version = "1.0"
repositories {
google()
mavenLocal()
mavenCentral()
maven(url ="https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven(url = "https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
}
littleKt {
texturePacker {
inputDir = "art/export_tiles/"
outputDir = "src/commonMain/resources/"
outputName = "tiles.atlas"
packing {
extrude = 2
}
}
}
kotlin {
android()
jvm {
compilations.all {
kotlinOptions.jvmTarget = "11"
}
testRuns["test"].executionTask.configure {
useJUnit()
}
}
js(KotlinJsCompilerType.IR) {
binaries.executable()
browser {
testTask {
useKarma {
useChromeHeadless()
}
}
}
this.attributes.attribute(
KotlinPlatformType.attribute,
KotlinPlatformType.js
)
compilations.all {
kotlinOptions.sourceMap = true
}
}
val kotlinCoroutinesVersion: String by project
val littleKtVersion: String by project
sourceSets {
val commonMain by getting {
dependencies {
implementation("com.lehaine.littlekt:core:$littleKtVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting
val jvmTest by getting
val jsMain by getting {
dependencies {
val kotlinxHtmlVersion = "0.7.2"
implementation("org.jetbrains.kotlinx:kotlinx-html-js:$kotlinxHtmlVersion")
}
}
val jsTest by getting
val androidMain by getting {
dependencies {
implementation("com.lehaine.littlekt:core:$littleKtVersion")
}
}
}
}
android {
sourceSets["main"].apply {
manifest.srcFile("src/androidMain/AndroidManifest.xml")
assets.srcDirs("src/commonMain/resources")
}
compileSdk = (findProperty("android.compileSdk") as String).toInt()
defaultConfig {
minSdk = (findProperty("android.minSdk") as String).toInt()
targetSdk = (findProperty("android.targetSdk") as String).toInt()
}
}
rootProject.extensions.configure<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension> {
versions.webpackCli.version = "4.10.0"
}