The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

gradle: Integrate spotless to format Java and Kotlin code

See https://github.com/diffplug/spotless.

Signed-off-by: utzcoz <utzcoz@outlook.com>

authored by

utzcoz and committed by
Ryan Pavlik
8e93bbde e3d345d4

+75
+3
build.gradle
··· 52 52 53 53 // So we don't have to check in generated files: we start with SVGs for vector art. 54 54 id "com.quittle.svg-2-android-vector" version "0.0.6" apply false 55 + 56 + // Spotless for Java and Kotlin's code formatting 57 + id 'com.diffplug.spotless' version "6.18.0" apply false 55 58 } 56 59 57 60 ext {
+17
src/xrt/auxiliary/android/build.gradle
··· 5 5 id 'com.android.library' 6 6 id 'kotlin-android' 7 7 id 'dagger.hilt.android.plugin' 8 + id 'com.diffplug.spotless' 8 9 } 9 10 10 11 android { ··· 49 50 // Only a Java file has annotations right now, so we don't yet need kapt 50 51 annotationProcessor "com.google.dagger:hilt-compiler:$hiltVersion" 51 52 } 53 + 54 + spotless { 55 + java { 56 + target 'src/main/java/**/*.java' 57 + // apply a specific flavor of google-java-format. 58 + googleJavaFormat('1.8').aosp().reflowLongStrings() 59 + // fix formatting of type annotations. 60 + formatAnnotations() 61 + } 62 + 63 + kotlin { 64 + target 'src/main/java/**/*.kt' 65 + // Use ktfmt(https://github.com/facebook/ktfmt) as the default Kotlin formatter. 66 + ktfmt('0.43').kotlinlangStyle() 67 + } 68 + }
+18
src/xrt/ipc/android/build.gradle
··· 7 7 8 8 id 'kotlin-kapt' 9 9 id 'dagger.hilt.android.plugin' 10 + 11 + id 'com.diffplug.spotless' 10 12 } 11 13 12 14 android { ··· 64 66 api "com.google.dagger:hilt-android:$hiltVersion" 65 67 kapt "com.google.dagger:hilt-compiler:$hiltVersion" 66 68 } 69 + 70 + spotless { 71 + java { 72 + target 'src/main/java/**/*.java' 73 + // apply a specific flavor of google-java-format. 74 + googleJavaFormat('1.8').aosp().reflowLongStrings() 75 + // fix formatting of type annotations. 76 + formatAnnotations() 77 + } 78 + 79 + kotlin { 80 + target 'src/main/java/**/*.kt' 81 + // Use ktfmt(https://github.com/facebook/ktfmt) as the default Kotlin formatter. 82 + ktfmt('0.43').kotlinlangStyle() 83 + } 84 + }
+18
src/xrt/targets/android_common/build.gradle
··· 11 11 12 12 // SVG files in the "raw" resource directory will be transformed into vector drawables of the same name. 13 13 id 'com.quittle.svg-2-android-vector' 14 + 15 + // Use spotless to format Java and Kotlin code. 16 + id 'com.diffplug.spotless' 14 17 } 15 18 19 + spotless { 20 + java { 21 + target 'src/main/java/**/*.java' 22 + // apply a specific flavor of google-java-format. 23 + googleJavaFormat('1.8').aosp().reflowLongStrings() 24 + // fix formatting of type annotations. 25 + formatAnnotations() 26 + } 27 + 28 + kotlin { 29 + target 'src/main/java/**/*.kt' 30 + // Use ktfmt(https://github.com/facebook/ktfmt) as the default Kotlin formatter. . 31 + ktfmt('0.43').kotlinlangStyle() 32 + } 33 + } 16 34 17 35 android { 18 36 compileSdk project.sharedCompileSdk
+19
src/xrt/targets/openxr_android/build.gradle
··· 17 17 18 18 // SVG files in the "raw" resource directory will be transformed into vector drawables of the same name. 19 19 id 'com.quittle.svg-2-android-vector' 20 + 21 + // Use spotless to format Java and Kotlin code 22 + id 'com.diffplug.spotless' 23 + } 24 + 25 + spotless { 26 + java { 27 + target 'src/main/java/**/*.java' 28 + // apply a specific flavor of google-java-format. 29 + googleJavaFormat('1.8').aosp().reflowLongStrings() 30 + // fix formatting of type annotations. 31 + formatAnnotations() 32 + } 33 + 34 + kotlin { 35 + target 'src/main/java/**/*.kt' 36 + // Use ktfmt(https://github.com/facebook/ktfmt) as the default Kotlin formatter. 37 + ktfmt('0.43').kotlinlangStyle() 38 + } 20 39 } 21 40 22 41 // apply from: file("../android_common/fetch-eigen.gradle")