-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
173 lines (155 loc) · 4.84 KB
/
build.gradle
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
172
173
version = "0.0.1"
group = "io.github.inoutch"
buildscript {
ext.kotlinVersion = "1.3.61"
ext.lwjglVersion = "3.2.1"
repositories {
google()
jcenter()
mavenCentral()
maven { url = "https://plugins.gradle.org/m2" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.android.tools.build:gradle:3.5.3"
}
}
apply plugin: "kotlin-multiplatform"
apply plugin: "com.android.library"
apply plugin: "kotlin-android-extensions"
apply plugin: "maven-publish"
repositories {
google()
jcenter()
mavenCentral()
}
configurations {
ktlint
}
dependencies {
ktlint "com.pinterest:ktlint:0.35.0"
}
// jvm
def platform = org.gradle.internal.os.OperatingSystem.current()
switch (platform) {
case org.gradle.internal.os.OperatingSystem.WINDOWS:
project.ext.lwjglNatives = "natives-windows"
break
case org.gradle.internal.os.OperatingSystem.LINUX:
project.ext.lwjglNatives = "natives-linux"
break
case org.gradle.internal.os.OperatingSystem.MAC_OS:
project.ext.lwjglNatives = "natives-macos"
break
}
kotlin {
jvm {}
js {}
iosArm64 {
compilations.main {
cinterops {
eaglview {
includeDirs "./src/iosArm64Main/objc/EAGLView"
}
}
}
}
android {
publishLibraryVariants("release")
}
androidNativeArm64 {}
sourceSets {
commonMain {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion"
}
}
jvmMain {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation "org.lwjgl:lwjgl:$lwjglVersion"
implementation "org.lwjgl:lwjgl-stb:$lwjglVersion"
implementation "org.lwjgl:lwjgl-glfw:$lwjglVersion"
implementation "org.lwjgl:lwjgl-opengl:$lwjglVersion"
}
}
jsMain {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlinVersion"
}
}
iosArm64Main {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion"
}
}
androidMain {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "com.android.support.constraint:constraint-layout:1.1.3"
}
}
commonTest {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-test-common:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlinVersion"
}
}
jvmTest {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
runtimeOnly "org.lwjgl:lwjgl:$lwjglVersion:$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-stb:$lwjglVersion:$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-glfw:$lwjglVersion:$lwjglNatives"
}
}
jsTest {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-test-js:$kotlinVersion"
}
}
iosArm64Test {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
}
}
androidTest {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
}
}
}
}
// android
android {
compileSdkVersion 26
defaultConfig {
minSdkVersion 24
targetSdkVersion 26
versionName "1.0"
}
packagingOptions {
exclude "META-INF/common.kotlin_module"
}
}
// publish configure
def repo = new File(rootDir, "repository")
publishing.repositories.maven { url "file://${repo.absolutePath}" }
// extra tasks
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
classpath = configurations.ktlint
main = "com.pinterest.ktlint.Main"
args "src/**/*.kt"
}
check.dependsOn ktlint
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
classpath = configurations.ktlint
main = "com.pinterest.ktlint.Main"
args "-F", "src/**/*.kt"
}