11apply plugin : ' idea'
22apply plugin : ' eclipse'
33apply plugin : ' java'
4+ apply plugin : ' com.diffplug.spotless'
45
56group = ' io.github.vrchatapi'
67version = ' 1.9.1'
@@ -11,7 +12,8 @@ buildscript {
1112 }
1213 dependencies {
1314 classpath ' com.android.tools.build:gradle:2.3.+'
14- classpath ' com.github.dcendents:android-maven-gradle-plugin:1.5'
15+ classpath ' com.github.dcendents:android-maven-gradle-plugin:2.1'
16+ classpath ' com.diffplug.spotless:spotless-plugin-gradle:6.11.0'
1517 }
1618}
1719
@@ -63,7 +65,7 @@ if(hasProperty('target') && target == 'android') {
6365 task. from variant. javaCompile. destinationDir
6466 task. destinationDir = project. file(" ${ project.buildDir} /outputs/jar" )
6567 task. archiveName = " ${ project.name} -${ variant.baseName} -${ version} .jar"
66- artifacts. add(' archives' , task);
68+ artifacts. add(' archives' , task)
6769 }
6870 }
6971
@@ -104,20 +106,63 @@ ext {
104106}
105107
106108dependencies {
107- implementation ' io.swagger:swagger-annotations:1.5.24 '
109+ implementation ' io.swagger:swagger-annotations:1.6.8 '
108110 implementation " com.google.code.findbugs:jsr305:3.0.2"
109- implementation ' com.squareup.okhttp3:okhttp:4.9.1'
110- implementation ' com.squareup.okhttp3:logging-interceptor:4.9.1'
111- implementation ' com.google.code.gson:gson:2.8.6'
112- implementation ' io.gsonfire:gson-fire:1.8.4'
113- implementation ' org.openapitools:jackson-databind-nullable:0.2.1'
114- implementation group : ' org.apache.commons' , name : ' commons-lang3' , version : ' 3.10'
115- implementation ' org.threeten:threetenbp:1.4.3'
111+ implementation ' com.squareup.okhttp3:okhttp:4.10.0'
112+ implementation ' com.squareup.okhttp3:logging-interceptor:4.10.0'
113+ implementation ' com.google.code.gson:gson:2.9.1'
114+ implementation ' io.gsonfire:gson-fire:1.8.5'
115+ implementation ' javax.ws.rs:jsr311-api:1.1.1'
116+ implementation ' javax.ws.rs:javax.ws.rs-api:2.1.1'
117+ implementation ' org.openapitools:jackson-databind-nullable:0.2.4'
118+ implementation group : ' org.apache.commons' , name : ' commons-lang3' , version : ' 3.12.0'
116119 implementation " jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version "
117- testImplementation ' junit:junit:4.13.1'
118- testImplementation ' org.mockito:mockito-core:3.11.2'
120+ testImplementation ' org.junit.jupiter:junit-jupiter-api:5.9.1'
121+ testImplementation ' org.mockito:mockito-core:3.12.4'
122+ testRuntimeOnly ' org.junit.jupiter:junit-jupiter-engine:5.9.1'
119123}
120124
121125javadoc {
122126 options. tags = [ " http.response.details:a:Http Response Details" ]
123127}
128+
129+ // Use spotless plugin to automatically format code, remove unused import, etc
130+ // To apply changes directly to the file, run `gradlew spotlessApply`
131+ // Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle
132+ spotless {
133+ // comment out below to run spotless as part of the `check` task
134+ enforceCheck false
135+
136+ format ' misc' , {
137+ // define the files (e.g. '*.gradle', '*.md') to apply `misc` to
138+ target ' .gitignore'
139+
140+ // define the steps to apply to those files
141+ trimTrailingWhitespace()
142+ indentWithSpaces() // Takes an integer argument if you don't like 4
143+ endWithNewline()
144+ }
145+ java {
146+ // don't need to set target, it is inferred from java
147+
148+ // apply a specific flavor of google-java-format
149+ googleJavaFormat(' 1.8' ). aosp(). reflowLongStrings()
150+
151+ removeUnusedImports()
152+ importOrder()
153+ }
154+ }
155+
156+ test {
157+ // Enable JUnit 5 (Gradle 4.6+).
158+ useJUnitPlatform()
159+
160+ // Always run tests, even when nothing changed.
161+ dependsOn ' cleanTest'
162+
163+ // Show test results.
164+ testLogging {
165+ events " passed" , " skipped" , " failed"
166+ }
167+
168+ }
0 commit comments