• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョンd8a2a23da4f357ab8ef87d6db111073696df1699 (tree)
日時2021-09-03 16:25:06
作者SimonIT <simonit.orig@gmai...>
コミッターGitHub

ログメッセージ

Improve code formatting (#5698)

* basic spotless integration

* fix formatter path

* line endings lf and tabs for cpp

* Update spotless, format only diffs

* Exclude some folders from ignoring

* Add gwt files in webapp

* Fetch more git information in workflows

* Correct test index.html path

* Move spotless version to dependencies.gradle

変更サマリ

差分

--- a/.github/workflows/build-pullrequest.yml
+++ b/.github/workflows/build-pullrequest.yml
@@ -11,6 +11,7 @@ jobs:
1111 steps:
1212 - uses: actions/checkout@v2
1313 with:
14+ fetch-depth: 0
1415 submodules: 'recursive'
1516
1617 - name: Set up JDK 1.8
@@ -30,9 +31,9 @@ jobs:
3031
3132 - name: Build & test Java code
3233 run: |
33- ./gradlew fetchNatives build
34+ ./gradlew fetchNatives build
3435
3536 - name: Cleanup Gradle Cache
3637 run: |
3738 rm -f ~/.gradle/caches/modules-2/modules-2.lock
38- rm -f ~/.gradle/caches/modules-2/gc.properties
\ No newline at end of file
39+ rm -f ~/.gradle/caches/modules-2/gc.properties
--- a/.github/workflows/build-snapshot.yml
+++ b/.github/workflows/build-snapshot.yml
@@ -4,7 +4,7 @@ on:
44 push:
55 branches: [ master ]
66 workflow_dispatch:
7- branches: [ master ]
7+ branches: [ master ]
88
99 jobs:
1010
@@ -13,6 +13,7 @@ jobs:
1313 steps:
1414 - uses: actions/checkout@v2
1515 with:
16+ fetch-depth: 0
1617 submodules: 'recursive'
1718 - name: Set up JDK 1.8
1819 uses: actions/setup-java@v1
@@ -49,24 +50,25 @@ jobs:
4950 uses: actions/upload-artifact@v2
5051 with:
5152 name: natives-ios.zip
52- path: natives-ios.zip
53+ path: natives-ios.zip
5354
5455 - name: Cleanup Gradle Cache
5556 run: |
5657 rm -f ~/.gradle/caches/modules-2/modules-2.lock
5758 rm -f ~/.gradle/caches/modules-2/gc.properties
5859
59- natives-macos:
60+ natives-macos:
6061 runs-on: macos-latest
6162 steps:
6263 - uses: actions/checkout@v2
6364 with:
64- submodules: 'recursive'
65+ fetch-depth: 0
66+ submodules: 'recursive'
6567 - name: Set up JDK 1.8
6668 uses: actions/setup-java@v1
6769 with:
6870 java-version: 1.8
69-
71+
7072 - name: Cache Gradle packages
7173 uses: actions/cache@v2
7274 with:
@@ -96,18 +98,19 @@ jobs:
9698 uses: actions/upload-artifact@v2
9799 with:
98100 name: natives-macos.zip
99- path: natives-macos.zip
101+ path: natives-macos.zip
100102
101103 - name: Cleanup Gradle Cache
102104 run: |
103105 rm -f ~/.gradle/caches/modules-2/modules-2.lock
104106 rm -f ~/.gradle/caches/modules-2/gc.properties
105107
106- natives-linux:
108+ natives-linux:
107109 runs-on: ubuntu-16.04
108110 steps:
109111 - uses: actions/checkout@v2
110112 with:
113+ fetch-depth: 0
111114 submodules: 'recursive'
112115
113116 - name: Set up JDK 1.8
@@ -119,8 +122,8 @@ jobs:
119122 run: |
120123 sudo apt install -y --force-yes gcc g++
121124 sudo apt install -y --force-yes gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross
122- sudo apt install -y --force-yes gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross
123-
125+ sudo apt install -y --force-yes gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross
126+
124127 - name: Cache Gradle packages
125128 uses: actions/cache@v2
126129 with:
@@ -132,8 +135,8 @@ jobs:
132135 ${{ runner.os }}-gradle-
133136
134137 - name: Build Linux natives
135- run: |
136- ./gradlew jniGen jnigenBuildLinux64 jnigenBuildLinuxARM jnigenBuildLinuxARM64
138+ run: |
139+ ./gradlew jniGen jnigenBuildLinux64 jnigenBuildLinuxARM jnigenBuildLinuxARM64
137140
138141 - name: Pack artifacts
139142 run: |
@@ -144,18 +147,19 @@ jobs:
144147 uses: actions/upload-artifact@v2
145148 with:
146149 name: natives-linux.zip
147- path: natives-linux.zip
150+ path: natives-linux.zip
148151
149152 - name: Cleanup Gradle Cache
150153 run: |
151154 rm -f ~/.gradle/caches/modules-2/modules-2.lock
152155 rm -f ~/.gradle/caches/modules-2/gc.properties
153156
154- natives-windows:
157+ natives-windows:
155158 runs-on: ubuntu-16.04
156159 steps:
157160 - uses: actions/checkout@v2
158161 with:
162+ fetch-depth: 0
159163 submodules: 'recursive'
160164
161165 - name: Set up JDK 1.8
@@ -164,9 +168,9 @@ jobs:
164168 java-version: 1.8
165169
166170 - name: Install cross-compilation toolchains
167- run: |
168- sudo apt install -y --force-yes mingw-w64 lib32z1
169-
171+ run: |
172+ sudo apt install -y --force-yes mingw-w64 lib32z1
173+
170174 - name: Cache Gradle packages
171175 uses: actions/cache@v2
172176 with:
@@ -178,8 +182,8 @@ jobs:
178182 ${{ runner.os }}-gradle-
179183
180184 - name: Build Windows natives
181- run: |
182- ./gradlew jniGen jnigenBuildWindows64 jnigenBuildWindows
185+ run: |
186+ ./gradlew jniGen jnigenBuildWindows64 jnigenBuildWindows
183187
184188 - name: Pack artifacts
185189 run: |
@@ -190,25 +194,26 @@ jobs:
190194 uses: actions/upload-artifact@v2
191195 with:
192196 name: natives-windows.zip
193- path: natives-windows.zip
197+ path: natives-windows.zip
194198
195199 - name: Cleanup Gradle Cache
196200 run: |
197201 rm -f ~/.gradle/caches/modules-2/modules-2.lock
198202 rm -f ~/.gradle/caches/modules-2/gc.properties
199203
200- natives-android:
204+ natives-android:
201205 runs-on: ubuntu-16.04
202206 steps:
203207 - uses: actions/checkout@v2
204208 with:
209+ fetch-depth: 0
205210 submodules: 'recursive'
206211
207212 - name: Set up JDK 1.8
208213 uses: actions/setup-java@v1
209214 with:
210- java-version: 1.8
211-
215+ java-version: 1.8
216+
212217 - name: Cache Gradle packages
213218 uses: actions/cache@v2
214219 with:
@@ -220,9 +225,9 @@ jobs:
220225 ${{ runner.os }}-gradle-
221226
222227 - name: Build Android natives
223- run: |
228+ run: |
224229 export NDK_HOME=$ANDROID_NDK_HOME
225- ./gradlew jniGen jnigenBuildAndroid
230+ ./gradlew jniGen jnigenBuildAndroid
226231
227232 - name: Pack artifacts
228233 run: |
@@ -233,14 +238,14 @@ jobs:
233238 uses: actions/upload-artifact@v2
234239 with:
235240 name: natives-android.zip
236- path: natives-android.zip
241+ path: natives-android.zip
237242
238243 - name: Cleanup Gradle Cache
239244 run: |
240245 rm -f ~/.gradle/caches/modules-2/modules-2.lock
241- rm -f ~/.gradle/caches/modules-2/gc.properties
246+ rm -f ~/.gradle/caches/modules-2/gc.properties
242247
243- pack-natives:
248+ pack-natives:
244249 runs-on: ubuntu-16.04
245250 needs: [natives-macos, natives-linux, natives-windows, natives-ios, natives-android]
246251 env:
@@ -249,6 +254,7 @@ jobs:
249254 steps:
250255 - uses: actions/checkout@v2
251256 with:
257+ fetch-depth: 0
252258 submodules: 'recursive'
253259
254260 - name: Set up JDK 1.8
@@ -264,7 +270,7 @@ jobs:
264270 ~/.gradle/wrapper
265271 key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
266272 restore-keys: |
267- ${{ runner.os }}-gradle-
273+ ${{ runner.os }}-gradle-
268274
269275 - name: Download natives-ios artifact
270276 uses: actions/download-artifact@v2
@@ -318,7 +324,7 @@ jobs:
318324 name: natives.zip
319325 path: natives.zip
320326
321- - name: Upload artifacts to S3
327+ - name: Upload artifacts to S3
322328 if: env.AWS_ACCESS_KEY_ID != null
323329 run: |
324330 aws s3 cp natives.zip s3://libgdx-nightlies/libgdx-nightlies/natives.zip
@@ -326,17 +332,18 @@ jobs:
326332 - name: Cleanup Gradle Cache
327333 run: |
328334 rm -f ~/.gradle/caches/modules-2/modules-2.lock
329- rm -f ~/.gradle/caches/modules-2/gc.properties
335+ rm -f ~/.gradle/caches/modules-2/gc.properties
330336
331- release-snapshot:
337+ release-snapshot:
332338 runs-on: ubuntu-16.04
333339 needs: pack-natives
334340 env:
335341 MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
336- MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
342+ MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
337343 steps:
338344 - uses: actions/checkout@v2
339345 with:
346+ fetch-depth: 0
340347 submodules: 'recursive'
341348
342349 - name: Set up JDK 1.8
@@ -346,7 +353,7 @@ jobs:
346353 server-id: sonatype-nexus-snapshots
347354 server-username: MAVEN_USERNAME
348355 server-password: MAVEN_PASSWORD
349-
356+
350357 - name: Cache Maven packages
351358 uses: actions/cache@v2
352359 with:
@@ -354,22 +361,22 @@ jobs:
354361 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
355362 restore-keys: ${{ runner.os }}-m2
356363
357- - name: Download natives artifact
364+ - name: Download natives artifact
358365 uses: actions/download-artifact@v2
359366 with:
360367 name: natives.zip
361368
362- - name: Unpack natives
369+ - name: Unpack natives
363370 run: |
364371 unzip -o natives.zip
365372
366373 - name: Publish snapshot
367374 if: env.MAVEN_USERNAME != null
368375 run: |
369- mvn --batch-mode deploy
370-
371-
372- build-and-upload-runnables:
376+ mvn --batch-mode deploy
377+
378+
379+ build-and-upload-runnables:
373380 runs-on: ubuntu-16.04
374381 env:
375382 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -377,6 +384,7 @@ jobs:
377384 steps:
378385 - uses: actions/checkout@v2
379386 with:
387+ fetch-depth: 0
380388 submodules: 'recursive'
381389
382390 - name: Set up JDK 1.8
@@ -386,7 +394,7 @@ jobs:
386394 - name: Build Runnables
387395 run: ./gradlew clean fetchNatives buildRunnables extensions:gdx-setup:build
388396
389- - name: Upload artifacts to S3
397+ - name: Upload artifacts to S3
390398 if: env.AWS_ACCESS_KEY_ID != null
391399 run: |
392400 aws s3 cp ./extensions/gdx-tools/build/libs/ s3://libgdx-nightlies/libgdx-runnables/ --recursive
--- /dev/null
+++ b/backends/gdx-backends-gwt/.gitignore
@@ -0,0 +1 @@
1+!/src/com/badlogic/gwtref/gen/
--- a/build.gradle
+++ b/build.gradle
@@ -16,6 +16,18 @@
1616
1717 apply from: "gradle/dependencies.gradle"
1818
19+buildscript {
20+ apply from: "gradle/dependencies.gradle"
21+
22+ repositories {
23+ maven { url "https://plugins.gradle.org/m2/" }
24+ }
25+ dependencies {
26+ classpath "com.diffplug.spotless:spotless-plugin-gradle:${versions.spotless}"
27+ classpath "com.badlogicgames.gdx:gdx-jnigen-gradle:2.2.0"
28+ }
29+}
30+
1931 allprojects {
2032 group = 'com.badlogicgames.gdx'
2133 version = '1.10.0-SNAPSHOT'
@@ -29,9 +41,6 @@ allprojects {
2941 maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
3042 maven { url "https://oss.sonatype.org/content/repositories/releases/" }
3143 }
32- dependencies {
33- classpath "com.badlogicgames.gdx:gdx-jnigen-gradle:2.2.0"
34- }
3544 }
3645
3746 repositories {
@@ -47,15 +56,42 @@ allprojects {
4756 configure(subprojects - project(":tests:gdx-tests-android")) {
4857 apply plugin: "idea"
4958 apply plugin: "java"
59+ apply plugin: "com.diffplug.spotless"
5060
5161 compileJava {
5262 options.fork = true
5363 options.incremental = true
5464 }
65+
66+ spotless {
67+ ratchetFrom 'origin/master'
68+
69+ lineEndings 'UNIX'
70+
71+ java {
72+ licenseHeader '/*******************************************************************************\n' +
73+ ' * Copyright 2011 See AUTHORS file.\n' +
74+ ' * \n' +
75+ ' * Licensed under the Apache License, Version 2.0 (the "License");\n' +
76+ ' * you may not use this file except in compliance with the License.\n' +
77+ ' * You may obtain a copy of the License at\n' +
78+ ' * \n' +
79+ ' * http://www.apache.org/licenses/LICENSE-2.0\n' +
80+ ' * \n' +
81+ ' * Unless required by applicable law or agreed to in writing, software\n' +
82+ ' * distributed under the License is distributed on an "AS IS" BASIS,\n' +
83+ ' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n' +
84+ ' * See the License for the specific language governing permissions and\n' +
85+ ' * limitations under the License.\n' +
86+ ' ******************************************************************************/\n'
87+ removeUnusedImports()
88+ eclipse().configFile new File(rootProject.projectDir.absolutePath, 'eclipse-formatter.xml')
89+ }
90+ }
5591 }
5692
5793 ant.importBuild("fetch.xml") { antTargetName ->
58- "ant-task-" + antTargetName
94+ "ant-task-" + antTargetName
5995 }
6096 task fetchNatives(dependsOn: "ant-task-all"){
6197 doLast {
--- /dev/null
+++ b/extensions/gdx-setup/.gitignore
@@ -0,0 +1 @@
1+!/res/com/badlogic/gdx/setup/resources/html/war
--- a/gradle/dependencies.gradle
+++ b/gradle/dependencies.gradle
@@ -38,6 +38,7 @@ versions.androidMinSdk = 14
3838 versions.androidBuildTools = "29.0.3"
3939 versions.androidFragment = "1.2.3"
4040 versions.javaparser = "2.3.0"
41+versions.spotless = "5.14.3"
4142
4243 libraries.lwjgl = [
4344 "org.lwjgl.lwjgl:lwjgl:${versions.lwjgl}",
--- a/tests/gdx-tests-gwt/war/index.html
+++ b/tests/gdx-tests-gwt/webapp/index.html
@@ -1,25 +1,25 @@
1-<!doctype html>
2-<html>
3- <head>
4- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
5- <title>libGDX GWT Test Runner</title>
6- </head>
7- <body>
8- <h1>libGDX GWT Test Runner</h1>
9- UI should load here shortly:<br>
10- <div id="embed-com.badlogic.gdx.tests.gwt.GdxTestsGwt"></div>
11- <small>This page is from <code>tests/gdx-tests-gwt/war/index.html</code>. Enter superdev here:
12- <a class="superdev" href="javascript:%7B%20window.__gwt_bookmarklet_params%20%3D%20%7B'server_url'%3A'http%3A%2F%2Flocalhost%3A9876%2F'%7D%3B%20var%20s%20%3D%20document.createElement('script')%3B%20s.src%20%3D%20'http%3A%2F%2Flocalhost%3A9876%2Fdev_mode_on.js'%3B%20void(document.getElementsByTagName('head')%5B0%5D.appendChild(s))%3B%7D">&#8635;</a>
13- </small>
14- <script type="text/javascript" language="javascript" src="com.badlogic.gdx.tests.gwt.GdxTestsGwt/com.badlogic.gdx.tests.gwt.GdxTestsGwt.nocache.js">
15-window.onkeydown =
16- function(event) {
17- // prevent all navigation keys except the space key
18- if([9, 33, 34, 35, 36, 37, 38, 39, 40].indexOf(event.keyCode) > -1) {
19- event.preventDefault();
20- return false;
21- }
22- };
23- </script>
24- </body>
25-</html>
1+<!doctype html>
2+<html>
3+ <head>
4+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
5+ <title>libGDX GWT Test Runner</title>
6+ </head>
7+ <body>
8+ <h1>libGDX GWT Test Runner</h1>
9+ UI should load here shortly:<br>
10+ <div id="embed-com.badlogic.gdx.tests.gwt.GdxTestsGwt"></div>
11+ <small>This page is from <code>tests/gdx-tests-gwt/webapp/index.html</code>. Enter superdev here:
12+ <a class="superdev" href="javascript:%7B%20window.__gwt_bookmarklet_params%20%3D%20%7B'server_url'%3A'http%3A%2F%2Flocalhost%3A9876%2F'%7D%3B%20var%20s%20%3D%20document.createElement('script')%3B%20s.src%20%3D%20'http%3A%2F%2Flocalhost%3A9876%2Fdev_mode_on.js'%3B%20void(document.getElementsByTagName('head')%5B0%5D.appendChild(s))%3B%7D">&#8635;</a>
13+ </small>
14+ <script type="text/javascript" language="javascript" src="com.badlogic.gdx.tests.gwt.GdxTestsGwt/com.badlogic.gdx.tests.gwt.GdxTestsGwt.nocache.js">
15+window.onkeydown =
16+ function(event) {
17+ // prevent all navigation keys except the space key
18+ if([9, 33, 34, 35, 36, 37, 38, 39, 40].indexOf(event.keyCode) > -1) {
19+ event.preventDefault();
20+ return false;
21+ }
22+ };
23+ </script>
24+ </body>
25+</html>