mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Apply formatting to C# sources.
This commit is contained in:
parent
f48e2ae2f8
commit
287f6dfb24
@ -5,5 +5,6 @@ You will need the following in your `PATH`:
|
|||||||
|
|
||||||
- JDK 10+
|
- JDK 10+
|
||||||
- clang-format 12 (i.e. `brew install clang-format`)
|
- clang-format 12 (i.e. `brew install clang-format`)
|
||||||
|
- dotnet format (i.e. `dotnet tool install -g dotnet-format`, comes with dotnet 6 out of the box)
|
||||||
|
|
||||||
To run the formatter, invoke the `format.sh` script. This will shuffle around the Gradle config files, invoke spotless, then undo the config file shuffling. Invoking `./gradlew spotlessApply` from the `formatters/` directory will not work.
|
To run the formatter, invoke the `format.sh` script. This will shuffle around the Gradle config files, invoke spotless, then undo the config file shuffling. Invoking `./gradlew spotlessApply` from the `formatters/` directory will not work.
|
||||||
@ -8,21 +8,33 @@ setup() {
|
|||||||
cp $dir/.clang-format $dir/..
|
cp $dir/.clang-format $dir/..
|
||||||
cp $dir/build.gradle $dir/..
|
cp $dir/build.gradle $dir/..
|
||||||
cp $dir/settings.gradle $dir/..
|
cp $dir/settings.gradle $dir/..
|
||||||
|
cp $dir/.editorconfig $dir/../spine-csharp
|
||||||
|
cp $dir/.editorconfig $dir/../spine-xna
|
||||||
|
cp $dir/.editorconfig $dir/../spine-monogame
|
||||||
|
cp $dir/.editorconfig $dir/../spine-unity
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
rm $dir/../.clang-format
|
rm $dir/../.clang-format
|
||||||
rm $dir/../build.gradle
|
rm $dir/../build.gradle
|
||||||
rm $dir/../settings.gradle
|
rm $dir/../settings.gradle
|
||||||
|
rm $dir/../spine-csharp/.editorconfig
|
||||||
|
rm $dir/../spine-xna/.editorconfig
|
||||||
|
rm $dir/../spine-monogame/.editorconfig
|
||||||
|
rm $dir/../spine-unity/.editorconfig
|
||||||
}
|
}
|
||||||
|
|
||||||
# copy Gradle and clang-format config to root
|
# copy Gradle, dotnet-format, and clang-format config to root
|
||||||
setup
|
setup
|
||||||
|
|
||||||
# Execute spotless
|
# Execute spotless and dotnet-format
|
||||||
pushd $dir/..
|
pushd $dir/..
|
||||||
./formatters/gradlew spotlessApply
|
./formatters/gradlew spotlessApply
|
||||||
|
dotnet-format spine-csharp/spine-csharp.sln
|
||||||
|
dotnet-format -f spine-xna
|
||||||
|
dotnet-format -f spine-monogame
|
||||||
|
dotnet-format -f spine-unity
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Delete Gradle and clang-format config files in root
|
# Delete Gradle, dotnet-format, and clang-format config files in root
|
||||||
cleanup
|
cleanup
|
||||||
Loading…
x
Reference in New Issue
Block a user