Skip to content

Commit 6a4604d

Browse files
authored
Shake up the syntax highlighting (#215)
* Properties * More ```` to ``` * groovy to gradle * Fix stray indentation in code blocks I know this looks a bit strange in the IDE, like we're mixing 2- and 4-space indents, but this fixes the blocks all being indented by two spaces on the website.
1 parent bbb264a commit 6a4604d

11 files changed

+93
-93
lines changed

_posts/2021/2021-07-24-devlog-7-lwjgl3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Another viable approach for _outside of your development environment_ is to just
8686
- To use **Swing or AWT** APIs, you'll have to depend on the ([experimental](https://github.com/libgdx/libgdx/issues?q=is%3Aissue+is%3Aopen+label%3Aglfw-awt-macos)) gdx-lwjgl3-glfw-awt-macos extension. See [`AwtTestLWJGL`](https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests-lwjgl3/src/com/badlogic/gdx/tests/lwjgl3/AwtTestLWJGL.java) in gdx-tests-lwjgl3 for an example.
8787
- The LWJGL 3 backend does [not yet](https://github.com/libgdx/libgdx/pull/6247) have an equivalent for `LwjglAWTCanvas` and `LwjglAWTFrame`.
8888
- As the graphical tools in **gdx-tools** require the `LwjglAWTCanvas` class, the library has a hard dependency on LWJGL 2. If you are using one of the non-graphical tools of the gdx-tools project (in particular [TexturePacker](/wiki/tools/texture-packer#from-source)) and the LWJGL 3 backend _in the same (!) project_, you need to modify your gdx-tools dependency like this:
89-
```groovy
89+
```gradle
9090
compile ("com.badlogicgames.gdx:gdx-tools:$gdxVersion") {
9191
exclude group: 'com.badlogicgames.gdx', module: 'gdx-backend-lwjgl'
9292
}

wiki/articles/dependency-management-with-gradle.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The root directory, and each sub directory contains a `build.gradle` file, for c
3030
Here is a small section of the _default_ buildscript that is generated from the setup:
3131

3232
_Full script you will see will differ slightly depending on what other modules you have_
33-
```groovy
33+
```gradle
3434
//Configuration for the script itself (aka, listing the dependencies of the script that lists dependencies - InSCRIPTion!)
3535
buildscript {
3636
//Defines the repositories required by this script, e.g. hosting the android plugin
@@ -119,14 +119,14 @@ In order to add an external dependency to a project, you must declare the depend
119119

120120
(Some) libGDX extensions are mavenized and pushed to the maven repo, which means we can very easily pull them into our projects from the `build.gradle` file. You can see in the list [below](#libgdx-extensions) of the format that these dependencies take.
121121
If you are familiar with maven, notice the format:
122-
```groovy
122+
```gradle
123123
implementation '<groupId>:<artifactId>:<version>:<classifier>'
124124
```
125125

126126
Let's take a quick example to see how this works with the android `build.gradle` file.
127127

128128
[Here](#freetypefont-gradle) we see the dependencies for the FreeType Extension, say we want our Android project to have this dependency:
129-
```groovy
129+
```gradle
130130
dependencies {
131131
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
132132
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
@@ -140,7 +140,7 @@ dependencies {
140140
```
141141

142142
**We know our FreeType extension has the following android declarations:**
143-
```groovy
143+
```gradle
144144
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
145145
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
146146
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
@@ -149,7 +149,7 @@ natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
149149

150150
**So all we need to do is whack it in the dependencies stub**
151151

152-
```groovy
152+
```gradle
153153
dependencies {
154154
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
155155
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
@@ -168,7 +168,7 @@ dependencies {
168168

169169
**Ensure that your Core project has the freetype extension in core/build.gradle**
170170

171-
```groovy
171+
```gradle
172172
dependencies {
173173
api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
174174
api "com.badlogicgames.gdx:gdx:$gdxVersion"
@@ -190,26 +190,26 @@ Mavenized libGDX extensions ready to import from the `build.gradle` script inclu
190190

191191
#### Box2D Gradle
192192
**Core Dependency:**
193-
```groovy
193+
```gradle
194194
api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
195195
```
196196
**Desktop Dependency:**
197-
```groovy
197+
```gradle
198198
implementation "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
199199
```
200200
**Android Dependency:**
201-
```groovy
201+
```gradle
202202
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a"
203203
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
204204
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
205205
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
206206
```
207207
**iOS Dependency:**
208-
```groovy
208+
```gradle
209209
implementation "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
210210
```
211211
**HTML Dependency:**
212-
```groovy
212+
```gradle
213213
implementation "com.badlogicgames.gdx:gdx-box2d:$gdxVersion:sources"
214214
implementation("com.badlogicgames.gdx:gdx-box2d-gwt:$gdxVersion:sources") {exclude group: "com.google.gwt", module: "gwt-user"}
215215
```
@@ -219,23 +219,23 @@ and in `./html/src/yourgamedomain/GdxDefinition*.gwt.xml` add `<inherits name="c
219219

220220
#### Bullet Gradle
221221
**Core Dependency:**
222-
```groovy
222+
```gradle
223223
api "com.badlogicgames.gdx:gdx-bullet:$gdxVersion"
224224
```
225225
**Desktop Dependency:**
226-
```groovy
226+
```gradle
227227
implementation "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-desktop"
228228
```
229229
**Android Dependency:**
230-
```groovy
230+
```gradle
231231
natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-arm64-v8a"
232232
natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-armeabi-v7a"
233233
natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-x86"
234234
natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-x86_64"
235235
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
236236
```
237237
**iOS Dependency:**
238-
```groovy
238+
```gradle
239239
implementation "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-ios"
240240
```
241241
**HTML Dependency:**
@@ -245,26 +245,26 @@ Not compatible!
245245

246246
#### FreeTypeFont Gradle
247247
**Core Dependency:**
248-
```groovy
248+
```gradle
249249
api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
250250
```
251251
**Desktop Dependency:**
252-
```groovy
252+
```gradle
253253
implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
254254
```
255255
**Android Dependency:**
256-
```groovy
256+
```gradle
257257
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
258258
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
259259
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
260260
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
261261
```
262262
**iOS Dependency:**
263-
```groovy
263+
```gradle
264264
implementation "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
265265
```
266266
**iOS-MOE Dependency:**
267-
```groovy
267+
```gradle
268268
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
269269
```
270270
**HTML Dependency:**
@@ -274,24 +274,24 @@ Not compatible! See [gdx-freetype-gwt](https://github.com/intrigus/gdx-freetype-
274274

275275
#### Controllers Gradle
276276
**Core Dependency:**
277-
```groovy
277+
```gradle
278278
api "com.badlogicgames.gdx-controllers:gdx-controllers-core:$gdxControllersVersion"
279279
```
280280
**Desktop Dependency:**
281-
```groovy
281+
```gradle
282282
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion"
283283
```
284284
**Android Dependency:**
285-
```groovy
285+
```gradle
286286
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-android:$gdxControllersVersion"
287287
```
288288
**iOS Dependency:**
289-
```groovy
289+
```gradle
290290
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-ios:$gdxControllersVersion"
291291
```
292292

293293
**HTML Dependency:**
294-
```groovy
294+
```gradle
295295
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-core:$gdxControllersVersion:sources"
296296
implementation("com.badlogicgames.gdx-controllers:gdx-controllers-gwt:$gdxControllersVersion:sources"){exclude group: "com.badlogicgames.gdx", module: "gdx-backend-gwt"}
297297
```
@@ -304,7 +304,7 @@ and in `./html/src/yourgamedomain/GdxDefinition*.gwt.xml` add `<inherits name="c
304304
Don't put me in core!
305305

306306
**Desktop Dependency (LWJGL2 Legacy Desktop only):**
307-
```groovy
307+
```gradle
308308
api "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
309309
```
310310
**Android Dependency:**
@@ -322,7 +322,7 @@ Not compatible!
322322
* **Note:** this extension also requires the [Box2D](#box2d-gradle) extension
323323

324324
**Core Dependency:**
325-
```groovy
325+
```gradle
326326
api "com.badlogicgames.box2dlights:box2dlights:$box2dlightsVersion"
327327
```
328328
**Desktop Dependency:**
@@ -332,7 +332,7 @@ No native dependency required.
332332
No native dependency required.
333333

334334
**HTML Dependency:**
335-
```groovy
335+
```gradle
336336
implementation "com.badlogicgames.box2dlights:box2dlights:$box2dlightsVersion:sources"
337337
```
338338
and in `./html/src/yourgamedomain/GdxDefinition*.gwt.xml` add `<inherits name="Box2DLights" />`
@@ -344,7 +344,7 @@ and in `./html/src/yourgamedomain/GdxDefinition*.gwt.xml` add `<inherits name="B
344344
* **Note:** This extension release cycle is not dependent on the main libGDX library, and so it is not unusual to have a new version published between two libGDX releases. If you want to pull in a new (or different) version, check [https://repo1.maven.org/maven2/com/badlogicgames/ashley/ashley/](https://repo1.maven.org/maven2/com/badlogicgames/ashley/ashley/) and change the `ashleyVersion` value in the `ext` section.
345345

346346
**Core Dependency:**
347-
```groovy
347+
```gradle
348348
api "com.badlogicgames.ashley:ashley:$ashleyVersion"
349349
```
350350

@@ -355,7 +355,7 @@ No native dependency required.
355355
No native dependency required.
356356

357357
**HTML Dependency:**
358-
```groovy
358+
```gradle
359359
implementation "com.badlogicgames.ashley:ashley:$ashleyVersion:sources"
360360
```
361361
and in `./html/src/yourgamedomain/GdxDefinition*.gwt.xml` add `<inherits name="com.badlogic.ashley_gwt" />`
@@ -367,7 +367,7 @@ and in `./html/src/yourgamedomain/GdxDefinition*.gwt.xml` add `<inherits name="c
367367
* **Note:** This extension release cycle is not dependent on the main libGDX library, and so it is not unusual to have a new version published between two libGDX releases. If you want to pull in a new (or different) version, check [https://repo1.maven.org/maven2/com/badlogicgames/gdx/gdx-ai/](https://repo1.maven.org/maven2/com/badlogicgames/gdx/gdx-ai/) and change the `aiVersion` value in the `ext` section.
368368

369369
**Core Dependency:**
370-
```groovy
370+
```gradle
371371
api "com.badlogicgames.gdx:gdx-ai:$aiVersion"
372372
```
373373

@@ -378,7 +378,7 @@ No native dependency required.
378378
No native dependency required.
379379

380380
**HTML Dependency:**
381-
```groovy
381+
```gradle
382382
implementation "com.badlogicgames.gdx:gdx-ai:$aiVersion:sources"
383383
```
384384
and in `./html/src/yourgamedomain/GdxDefinition*.gwt.xml` add `<inherits name="com.badlogic.gdx.ai" />`
@@ -392,7 +392,7 @@ and in `./html/src/yourgamedomain/GdxDefinition*.gwt.xml` add `<inherits name="c
392392
Gradle finds files defined as dependencies by looking through all the repositories defined in the buildscript. Gradle understands several repository formats, which include Maven and Ivy.
393393

394394
Under the `subprojects` stub of the root build.gradle, you can see how repositories are defined. Here is an example:
395-
```groovy
395+
```gradle
396396
subprojects {
397397
version = '1.0.0'
398398
ext.appName = 'MyOriginalGame'
@@ -410,14 +410,14 @@ subprojects {
410410
#### Adding Dependencies
411411
External dependencies are identified by their group, name, version and sometimes classifier attributes.
412412

413-
```groovy
413+
```gradle
414414
dependencies {
415415
implementation group: 'com.badlogicgames.gdx', name: 'gdx', version: '1.0-SNAPSHOT', classifier: 'natives-desktop'
416416
}
417417
```
418418
Gradle allows you to use shortcuts when defining external dependencies, the above configuration is the same as:
419419

420-
```groovy
420+
```gradle
421421
dependencies {
422422
implementation 'com.badlogicgames.gdx:gdx:1.0-SNAPSHOT:natives-desktop'
423423
}
@@ -434,7 +434,7 @@ mvn install:install-file -Dfile=<path-to-source-file> -DgroupId=<group-id> -Dart
434434
```
435435

436436
To then set up gradle to include your new dependency, edit your build.gradle file in the root project directory and edit the core project entry:
437-
```groovy
437+
```gradle
438438
project(":core") {
439439
...
440440
@@ -458,7 +458,7 @@ If you have a dependency that is not mavenized, you can still depend on them!
458458

459459
To do this, in your project stub in the subproject's corresponding `build.gradle` file, locate the dependencies { } section and add the following:
460460

461-
```groovy
461+
```gradle
462462
dependencies {
463463
implementation fileTree(dir: 'libs', include: '*.jar')
464464
}
@@ -470,7 +470,7 @@ This will include all the .jar files in the libs directory as dependencies.
470470
**NOTE**: "dir" is relative to the project root, if you add the dependencies to your android project, 'libs' would need to be in the android/ directory. If you added the dependencies in the core project, 'libs' would need to be in the core/ directory.
471471

472472
An example with a more _complete_ script:
473-
```groovy
473+
```gradle
474474
project(":android") {
475475
apply plugin: "android"
476476
@@ -501,7 +501,7 @@ When adding `flat file` dependencies to a project, for example the core project,
501501

502502
For example, if you were to add the all the jars in your `libs` directory as dependencies for your project, you would need to do the following.
503503

504-
```groovy
504+
```gradle
505505
project(":core") {
506506
...
507507
implementation fileTree(dir: '../libs', include: '*.jar')

wiki/articles/improving-workflow-with-gradle.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ It also allows you to keep the power of Gradle at your disposal, to handle all y
5555
### Creating your IDEA project
5656
From the command line, run the following command from your project root directory:
5757
(If on a UNIX based OS, use ./gradlew to invoke gradle)
58-
```groovy
58+
```gradle
5959
gradlew idea
6060
```
6161

@@ -64,7 +64,7 @@ File > OPEN > Locate the .ipr that the task above generates
6464
### Creating your Eclipse Project
6565
From the command line, run the following command from your project root directory:
6666
(If on a UNIX based OS, use ./gradlew to invoke gradle)
67-
```groovy
67+
```gradle
6868
gradlew eclipse
6969
```
7070

wiki/articles/updating-libgdx.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ libGDX's Gradle based projects make it very easy to switch between libGDX versio
1313

1414
Your Gradle based project makes it very easy to switch between releases and nightly builds. Open up the `gradle.properties` file in the root of your project, and locate the following line:
1515

16-
```groovy
16+
```gradle
1717
gdxVersion=1.12.1
1818
```
1919

wiki/graphics/2d/imgui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ IO.fonts.addFontFromFileTTF("extraFonts/ArialUni.ttf", 18f, glyphRanges = IO.fon
5353

5454
# Option 2: [SpaiR's Bindings](https://github.com/SpaiR/imgui-java)
5555
### Required Dependencies for the LWJGL 3 Subproject
56-
```groovy
56+
```gradle
5757
api "io.github.spair:imgui-java-binding:<version>"
5858
api "io.github.spair:imgui-java-lwjgl3:<version>"
5959
api "io.github.spair:imgui-java-natives-linux:<version>"

0 commit comments

Comments
 (0)