Skip to content

Commit

Permalink
Merge pull request #32 from KyoriPowered/build-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
zml2008 authored Aug 11, 2021
2 parents e3bacef + f0ad988 commit 4f01587
Show file tree
Hide file tree
Showing 18 changed files with 393 additions and 241 deletions.
25 changes: 18 additions & 7 deletions .checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<property name="eachLine" value="true"/>
</module>

<!-- https://checkstyle.org/config_javadoc.html#JavadocPackage -->
<module name="JavadocPackage"/>

<!-- https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile"/>

Expand Down Expand Up @@ -52,6 +55,13 @@
<!-- https://checkstyle.org/config_misc.html#CommentsIndentation -->
<module name="CommentsIndentation"/>

<!-- https://checkstyle.org/config_imports.html#CustomImportOrder -->
<module name="CustomImportOrder">
<property name="customImportOrderRules" value="THIRD_PARTY_PACKAGE###STATIC"/>
<property name="standardPackageRegExp" value="^$"/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
</module>

<!-- https://checkstyle.org/config_whitespace.html#EmptyForInitializerPad -->
<module name="EmptyForInitializerPad"/>

Expand Down Expand Up @@ -239,8 +249,14 @@
<module name="UnusedImports"/>

<!-- https://checkstyle.org/config_whitespace.html#WhitespaceAfter -->
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA, SEMI, TYPECAST"/>
<module name="WhitespaceAfter"/>

<!-- https://checkstyle.org/config_whitespace.html#WhitespaceAround -->
<module name="WhitespaceAround">
<property name="ignoreEnhancedForColon" value="false"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="tokens" value="ASSIGN, COLON, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
</module>

<!--
Expand All @@ -258,10 +274,5 @@
<property name="minimumScope" value="public"/>
<property name="tokens" value="INTERFACE_DEF, CLASS_DEF, ENUM_DEF, ANNOTATION_DEF, RECORD_DEF, METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, RECORD_DEF, COMPACT_CTOR_DEF"/>
</module>

<!-- https://gitlab.com/stellardrift/stylecheck/-/blob/dev/src/main/java/ca/stellardrift/stylecheck/StatementNoWhitespaceAfter.java -->
<module name="StatementNoWhitespaceAfter">
<property name="tokens" value="LITERAL_CATCH, LITERAL_FOR, LITERAL_IF, LITERAL_TRY, LITERAL_WHILE"/>
</module>
</module>
</module>
1 change: 1 addition & 0 deletions .checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<suppressions>
<!-- no javadoc on test classes -->
<suppress files="src[\\/]test[\\/]java[\\/].*" checks="FilteringWriteTag"/>
<suppress files="src[\\/]test[\\/]java[\\/].*" checks="JavadocPackage"/>
<suppress files="src[\\/]test[\\/]java[\\/].*" checks="MissingJavadoc.*"/>
</suppressions>
25 changes: 21 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,31 @@ jobs:
- name: "checkout repository"
uses: "actions/checkout@v2"
- name: "setup jdk 11"
uses: "actions/setup-java@v1"
uses: "actions/setup-java@v2"
with:
distribution: "adopt"
java-version: "11"
- name: "build"
run: "./gradlew build"
- name: "archive test results"
if: "${{ always() }}"
uses: "actions/upload-artifact@v2"
with:
name: "test-results"
path: |
build/reports/
*/build/reports/
- name: "determine status"
if: "${{ runner.os == 'Linux' }}"
run: |
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
echo "STATUS=snapshot" >> $GITHUB_ENV
else
echo "STATUS=release" >> $GITHUB_ENV
fi
- name: "publish"
if: ${{ runner.os == 'Linux' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
if: "${{ runner.os == 'Linux' && env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}"
run: "./gradlew publish"
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}"
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}"
13 changes: 8 additions & 5 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
jar {
manifest.attributes(
"Automatic-Module-Name": "net.kyori.examination.api"
)
sourceSets {
main {
multirelease {
alternateVersions(9)
moduleName("net.kyori.examination.api")
}
}
}

dependencies {
compileOnlyApi("org.checkerframework:checker-qual:3.10.0")
compileOnlyApi("org.jetbrains:annotations:21.0.1")
}
Loading

0 comments on commit 4f01587

Please sign in to comment.