File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,20 @@ permissions:
99 contents : read
1010
1111jobs :
12+ format :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v4
16+ - name : Set up JDK 17
17+ uses : actions/setup-java@v4
18+ with :
19+ distribution : zulu
20+ java-version : ' 17'
21+ - name : Set up Gradle
22+ uses : gradle/actions/setup-gradle@v4
23+ - name : Check Java formatting
24+ run : ./gradlew formatCheck
25+
1226 build :
1327 runs-on : ubuntu-latest
1428 steps :
Original file line number Diff line number Diff line change @@ -38,6 +38,14 @@ Run `./gradlew publishToMavenLocal` to publish all three artifacts to your local
3838Maven repository, using the version from the ` artifacts/ ` configuration files.
3939The published class files target Java 7, matching earlier SoLoader releases.
4040
41+ ## Formatting Java sources
42+
43+ From this directory, run ` ./gradlew format ` to format all Java sources, or
44+ ` ./gradlew formatCheck ` to check them without making changes. Both commands work
45+ in a standalone checkout or in ` fbsource/fbandroid/libraries/soloader ` and use a
46+ pinned Google Java Format version downloaded by Gradle. No formatter binary is
47+ stored in the repository.
48+
4149The existing [ Buck] ( https://buckbuild.com/ ) build is also available. Once you have
4250Buck installed, run the following commands from the project root directory:
4351``` shell
Original file line number Diff line number Diff line change 11plugins {
22 id ' com.android.library' version ' 9.2.1' apply false
3+ id ' com.diffplug.spotless' version ' 8.0.0'
4+ }
5+
6+ spotless {
7+ java {
8+ target ' java/**/*.java'
9+ googleJavaFormat(' 1.25.2' )
10+ }
11+ }
12+
13+ tasks. register(' format' ) {
14+ group = ' formatting'
15+ description = ' Format all SoLoader Java sources.'
16+ dependsOn ' spotlessApply'
17+ }
18+
19+ tasks. register(' formatCheck' ) {
20+ group = ' verification'
21+ description = ' Check formatting of all SoLoader Java sources.'
22+ dependsOn ' spotlessCheck'
323}
424
525def artifactVersions = [' ANNOTATION' , ' NATIVELOADER' , ' SOLOADER' ]. collect { artifact ->
You can’t perform that action at this time.
0 commit comments