Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grasscutter
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
ziqian zhang
Grasscutter
Commits
a1f1af59
Commit
a1f1af59
authored
3 years ago
by
Luke H-W
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1484 from Birdulon/development
Automatic whitespace formatting
parents
4cbd3c7b
42559015
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.github/workflows/build.yml
+0
-1
0 additions, 1 deletion
.github/workflows/build.yml
.github/workflows/build_lint.yml
+48
-0
48 additions, 0 deletions
.github/workflows/build_lint.yml
build.gradle
+35
-6
35 additions, 6 deletions
build.gradle
with
83 additions
and
7 deletions
.github/workflows/build.yml
+
0
−
1
View file @
a1f1af59
...
...
@@ -6,7 +6,6 @@ on:
-
"
**.java"
branches
:
-
"
stable"
-
"
development"
pull_request
:
paths
:
-
"
**.java"
...
...
This diff is collapsed.
Click to expand it.
.github/workflows/build_lint.yml
0 → 100644
+
48
−
0
View file @
a1f1af59
name
:
"
Lint
and
Build"
on
:
workflow_dispatch
:
~
push
:
paths
:
-
"
**.java"
branches
:
-
"
development"
jobs
:
Build-Server-Jar
:
runs-on
:
ubuntu-latest
steps
:
-
name
:
Checkout LintRatchet
uses
:
actions/checkout@v2
with
:
ref
:
LintRatchet
-
name
:
Checkout branch
uses
:
actions/checkout@v2
-
name
:
Setup Java
uses
:
actions/setup-java@v3
with
:
distribution
:
temurin
java-version
:
'
17'
-
name
:
Cache gradle files
uses
:
actions/cache@v2
with
:
path
:
|
~/.gradle/caches
~/.gradle/wrapper
./.gradle/loom-cache
key
:
${{ runner.os }}-gradle-${{ hashFiles('*.gradle', 'gradle.properties', '**/*.accesswidener') }}
restore-keys
:
|
${{ runner.os }}-gradle-
-
name
:
Run Spotless
run
:
./gradlew spotlessApply
-
name
:
Run Gradle
run
:
./gradlew && ./gradlew jar
-
name
:
Upload build
uses
:
actions/upload-artifact@v3
with
:
name
:
Grasscutter
path
:
grasscutter-*.jar
-
name
:
Commit any Spotless changes
uses
:
EndBug/add-and-commit@v9
with
:
add
:
'
-u'
default_author
:
github_actions
message
:
'
Fix
whitespace'
This diff is collapsed.
Click to expand it.
build.gradle
+
35
−
6
View file @
a1f1af59
...
...
@@ -34,6 +34,9 @@ plugins {
// Maven
id
'maven-publish'
id
'signing'
// Spotless formatter
id
"com.diffplug.spotless"
version
"6.8.0"
}
compileJava
.
options
.
encoding
=
"UTF-8"
...
...
@@ -93,8 +96,8 @@ dependencies {
compileOnly
'org.projectlombok:lombok:1.18.24'
annotationProcessor
'org.projectlombok:lombok:1.18.24'
testCompileOnly
'org.projectlombok:lombok:1.18.24'
testAnnotationProcessor
'org.projectlombok:lombok:1.18.24'
testCompileOnly
'org.projectlombok:lombok:1.18.24'
testAnnotationProcessor
'org.projectlombok:lombok:1.18.24'
}
configurations
.
all
{
...
...
@@ -103,7 +106,7 @@ configurations.all {
application
{
// Define the main class for the application
m
ainClass
Name
=
'emu.grasscutter.Grasscutter'
getM
ainClass
().
set
(
'emu.grasscutter.Grasscutter'
)
}
...
...
@@ -112,8 +115,10 @@ jar {
attributes
'Main-Class'
:
'emu.grasscutter.Grasscutter'
}
jar
.
baseName
=
'grasscutter'
jar
.
archiveName
=
project
.
hasProperty
(
'jarFilename'
)
?
"${jarFilename}.${extension}"
:
archiveName
archiveBaseName
=
'grasscutter'
if
(
project
.
hasProperty
(
'jarFilename'
))
{
archiveFileName
=
"${jarFilename}.${extension}"
}
from
{
configurations
.
runtimeClasspath
.
collect
{
it
.
isDirectory
()
?
it
:
zipTree
(
it
)
}
...
...
@@ -125,7 +130,7 @@ jar {
include
'*.xml'
}
destinationDir
=
file
(
"."
)
destinationDir
ectory
=
file
(
"."
)
}
publishing
{
...
...
@@ -236,6 +241,30 @@ eclipse {
}
}
spotless
{
// optional: limit format enforcement to just the files changed by this feature branch
ratchetFrom
'LintRatchet'
format
'misc'
,
{
// define the files to apply `misc` to
target
'*.gradle'
,
'*.md'
,
'.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace
()
indentWithSpaces
()
// or spaces. Takes an integer argument if you don't like 4
endWithNewline
()
}
java
{
// don't need to set target, it is inferred from java
// define the steps to apply to those files
trimTrailingWhitespace
()
indentWithSpaces
()
// or spaces. Takes an integer argument if you don't like 4
endWithNewline
()
replaceRegex
(
'Force one space between if/etc. and ( or {'
,
'(?<=\\b(?:if|for|while|switch|try|else|catch|finally|synchronized)) *(?=[\\(\\{])'
,
' '
)
replaceRegex
(
'Force one space between ) and {'
,
'\\) *\\{(?!\\})'
,
') {'
)
}
}
signing
{
if
(!
version
.
endsWith
(
'-dev'
))
{
sign
publishing
.
publications
.
mavenJava
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment