forked from libgdx/gdx-liftoff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathofficialExtensions.kt
215 lines (170 loc) · 8.88 KB
/
officialExtensions.kt
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
@file:Suppress("unused") // Extension classes accessed via reflection.
package gdx.liftoff.data.libraries.official
import com.badlogic.gdx.Version
import gdx.liftoff.data.libraries.Library
import gdx.liftoff.data.libraries.Repository
import gdx.liftoff.data.platforms.Android
import gdx.liftoff.data.platforms.Core
import gdx.liftoff.data.platforms.GWT
import gdx.liftoff.data.platforms.Headless
import gdx.liftoff.data.platforms.Lwjgl2
import gdx.liftoff.data.platforms.Lwjgl3
import gdx.liftoff.data.platforms.iOS
import gdx.liftoff.data.project.Project
import gdx.liftoff.views.Extension
/**
* Abstract base for official extensions.
*/
abstract class OfficialExtension : Library {
override val defaultVersion = Version.VERSION
override val official = true
override val repository = Repository.MavenCentral
override val group = "com.badlogicgames.gdx"
override val name: String
get() = id
}
/**
* Official AI utilities.
*/
@Extension(official = true)
class AI : OfficialExtension() {
override val id = "gdx-ai"
override val url = "https://github.com/libgdx/gdx-ai"
override val defaultVersion = "1.8.2"
override fun initiate(project: Project) {
project.properties["aiVersion"] = version
addDependency(project, Core.ID, "com.badlogicgames.gdx:gdx-ai:\$aiVersion")
addDependency(project, GWT.ID, "com.badlogicgames.gdx:gdx-ai:\$aiVersion:sources")
addGwtInherit(project, "com.badlogic.gdx.ai")
}
}
/**
* Official entity system.
*/
@Extension(official = true)
class Ashley : OfficialExtension() {
override val id = "ashley"
override val url = "https://github.com/libgdx/ashley"
override val group = "com.badlogicgames.ashley"
override val defaultVersion = "1.7.4"
override fun initiate(project: Project) {
project.properties[id + "Version"] = version
addDependency(project, Core.ID, "com.badlogicgames.ashley:ashley:\$ashleyVersion")
addDependency(project, GWT.ID, "com.badlogicgames.ashley:ashley:\$ashleyVersion:sources")
addGwtInherit(project, "com.badlogic.ashley_gwt")
}
}
/**
* Official 2D physics engine.
*/
@Extension(official = true)
class Box2D : OfficialExtension() {
override val id = "gdx-box2d"
override val url = "https://libgdx.com/wiki/extensions/physics/box2d"
override fun initiate(project: Project) {
addDependency(project, Core.ID, "com.badlogicgames.gdx:gdx-box2d:\$gdxVersion")
addNativeAndroidDependency(project, "com.badlogicgames.gdx:gdx-box2d-platform:\$gdxVersion:natives-armeabi-v7a")
addNativeAndroidDependency(project, "com.badlogicgames.gdx:gdx-box2d-platform:\$gdxVersion:natives-arm64-v8a")
addNativeAndroidDependency(project, "com.badlogicgames.gdx:gdx-box2d-platform:\$gdxVersion:natives-x86")
addNativeAndroidDependency(project, "com.badlogicgames.gdx:gdx-box2d-platform:\$gdxVersion:natives-x86_64")
addDesktopDependency(project, "com.badlogicgames.gdx:gdx-box2d-platform:\$gdxVersion:natives-desktop")
addDependency(project, Headless.ID, "com.badlogicgames.gdx:gdx-box2d-platform:\$gdxVersion:natives-desktop")
addDependency(project, GWT.ID, "com.badlogicgames.gdx:gdx-box2d:\$gdxVersion:sources")
addDependency(project, GWT.ID, "com.badlogicgames.gdx:gdx-box2d-gwt:\$gdxVersion")
addDependency(project, GWT.ID, "com.badlogicgames.gdx:gdx-box2d-gwt:\$gdxVersion:sources")
addGwtInherit(project, "com.badlogic.gdx.physics.box2d.box2d-gwt")
addDependency(project, iOS.ID, "com.badlogicgames.gdx:gdx-box2d-platform:\$gdxVersion:natives-ios")
}
}
/**
* Official 2D lights extension to Box2D.
*/
@Extension(official = true)
class Box2DLights : OfficialExtension() {
override val id = "box2dlights"
override val url = "https://github.com/libgdx/box2dlights"
override val group = "com.badlogicgames.box2dlights"
override val defaultVersion = "1.5"
override fun initiate(project: Project) {
project.properties[id + "Version"] = version
addDependency(project, Core.ID, "com.badlogicgames.box2dlights:box2dlights:\$box2dlightsVersion")
addDependency(project, GWT.ID, "com.badlogicgames.box2dlights:box2dlights:\$box2dlightsVersion:sources")
addGwtInherit(project, "Box2DLights")
// Making sure Box2D is included as well:
Box2D().initiate(project)
}
}
/**
* Official 3D physics engine.
*/
@Extension(official = true)
class Bullet : OfficialExtension() {
override val id = "gdx-bullet"
override val url = "https://libgdx.com/wiki/extensions/physics/bullet/bullet-physics"
override fun initiate(project: Project) {
addDependency(project, Core.ID, "com.badlogicgames.gdx:gdx-bullet:\$gdxVersion")
addNativeAndroidDependency(project, "com.badlogicgames.gdx:gdx-bullet-platform:\$gdxVersion:natives-armeabi-v7a")
addNativeAndroidDependency(project, "com.badlogicgames.gdx:gdx-bullet-platform:\$gdxVersion:natives-arm64-v8a")
addNativeAndroidDependency(project, "com.badlogicgames.gdx:gdx-bullet-platform:\$gdxVersion:natives-x86")
addNativeAndroidDependency(project, "com.badlogicgames.gdx:gdx-bullet-platform:\$gdxVersion:natives-x86_64")
addDesktopDependency(project, "com.badlogicgames.gdx:gdx-bullet-platform:\$gdxVersion:natives-desktop")
addDependency(project, iOS.ID, "com.badlogicgames.gdx:gdx-bullet-platform:\$gdxVersion:natives-ios")
// Other platforms are not officially supported (GWT).
}
}
/**
* Official controllers support. See https://github.com/libgdx/gdx-controllers for Android ProGuard info.
* Note, the code for gdx-controllers (and its version) are separate from the earlier gdx-controllers extension.
* If you used a version of gdx-controllers before 2.0.0, there may be some important changes.
*/
@Extension(official = true)
class Controllers : OfficialExtension() {
override val id = "gdx-controllers"
override val url = "https://github.com/libgdx/gdx-controllers"
override val group = "com.badlogicgames.gdx-controllers"
override val name = "gdx-controllers-core"
override val defaultVersion = "2.2.1"
override fun initiate(project: Project) {
project.properties["gdxControllersVersion"] = version
addDependency(project, Core.ID, "com.badlogicgames.gdx-controllers:gdx-controllers-core:\$gdxControllersVersion")
addDependency(project, Android.ID, "com.badlogicgames.gdx-controllers:gdx-controllers-android:\$gdxControllersVersion")
addDependency(project, Lwjgl2.ID, "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:\$gdxControllersVersion")
addDependency(project, Lwjgl3.ID, "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:\$gdxControllersVersion")
addDependency(project, GWT.ID, "com.badlogicgames.gdx-controllers:gdx-controllers-core:\$gdxControllersVersion:sources")
addDependency(project, GWT.ID, "com.badlogicgames.gdx-controllers:gdx-controllers-gwt:\$gdxControllersVersion:sources")
addGwtInherit(project, "com.badlogic.gdx.controllers")
addGwtInherit(project, "com.badlogic.gdx.controllers.controllers-gwt")
addDependency(project, iOS.ID, "com.badlogicgames.gdx-controllers:gdx-controllers-ios:\$gdxControllersVersion")
}
}
/**
* Official TTF fonts support.
*/
@Extension(official = true)
class Freetype : OfficialExtension() {
override val id = "gdx-freetype"
override val url = "https://libgdx.com/wiki/extensions/gdx-freetype"
override fun initiate(project: Project) {
addDependency(project, Core.ID, "com.badlogicgames.gdx:gdx-freetype:\$gdxVersion")
addNativeAndroidDependency(project, "com.badlogicgames.gdx:gdx-freetype-platform:\$gdxVersion:natives-armeabi-v7a")
addNativeAndroidDependency(project, "com.badlogicgames.gdx:gdx-freetype-platform:\$gdxVersion:natives-arm64-v8a")
addNativeAndroidDependency(project, "com.badlogicgames.gdx:gdx-freetype-platform:\$gdxVersion:natives-x86")
addNativeAndroidDependency(project, "com.badlogicgames.gdx:gdx-freetype-platform:\$gdxVersion:natives-x86_64")
addDesktopDependency(project, "com.badlogicgames.gdx:gdx-freetype-platform:\$gdxVersion:natives-desktop")
addDependency(project, iOS.ID, "com.badlogicgames.gdx:gdx-freetype-platform:\$gdxVersion:natives-ios")
// Other platforms are not officially supported (GWT).
}
}
/**
* Official libGDX tools extension; only usable by Desktop ("Legacy" LWJGL 2) modules.
*/
@Extension(official = true)
class Tools : OfficialExtension() {
override val id = "gdx-tools"
override val url = "https://libgdx.com/wiki/tools/texture-packer"
override fun initiate(project: Project) {
addDependency(project, Lwjgl2.ID, "com.badlogicgames.gdx:gdx-tools:\$gdxVersion")
// Headless is unlikely to work because gdx-tools relies on graphics classes.
// addDependency(project, Headless.ID, "com.badlogicgames.gdx:gdx-tools:\$gdxVersion")
}
}