diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 9d48c11..197a0dc 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -1,46 +1,9 @@ -name: Build and deploy master +name: Build master on: push: branches: - master - tags: - - '*' - jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Set up JDK 1.17 - uses: actions/setup-java@v1 - with: - java-version: 1.17 - - - name: git config - run: | - git config --global user.name "Monumenta CI" - git config --global user.email "Monumenta.CI@NotARealEmail.com" - - - name: Cache maven dependencies - uses: actions/cache@v2 - env: - cache-name: cache-maven-dependencies - with: - # maven files are stored in `~/.m2/repository` - path: | - ~/.m2/repository - ~/.gradle/caches - ~/.gradle/wrapper - # Create the key based on runner os, cache name, and a hash of all the pom.xml files - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Build and deploy to Github Package Registry - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - ./gradlew publish + call-build-common: + uses: TeamMonumenta/monumenta-automation/.github/workflows/plugin_build_common.yml@master diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 85ced77..c8b66ca 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -1,53 +1,5 @@ -name: Pull request CI - +name: Reviewdog checks on: [pull_request] - jobs: - reviewdog: - name: reviewdog - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - distribution: 'zulu' # See 'Supported distributions' for available options - java-version: '17' - - - name: Setup reviewdog - uses: reviewdog/action-setup@v1 - with: - reviewdog_version: latest - - - name: git config - run: | - git config --global user.name "Monumenta CI" - git config --global user.email "Monumenta.CI@NotARealEmail.com" - - - name: Cache maven dependencies - uses: actions/cache@v2 - env: - cache-name: cache-maven-dependencies - with: - # maven files are stored in `~/.m2/repository` - path: | - ~/.m2/repository - ~/.gradle/caches - ~/.gradle/wrapper - # Create the key based on runner os, cache name, and a hash of all the pom.xml files - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Build and report style/pmd/warnings - env: - REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -o pipefail - ./gradlew build --console=plain 2>&1 | tee compile.log - set +o pipefail - cat compile.log | reviewdog -efm="%f:%l: warning:%m" -name="compiler-warnings" -level=error -fail-on-error -reporter=github-pr-check - cat build/reports/pmd/main.xml | reviewdog -efm='%+P' -efm='%W by extra -version = gitVersion() -description = "libraryofsouls" -java.sourceCompatibility = JavaVersion.VERSION_17 -java.targetCompatibility = JavaVersion.VERSION_17 - -// Configure plugin.yml generation -bukkit { - load = BukkitPluginDescription.PluginLoadOrder.POSTWORLD - main = "com.playmonumenta.libraryofsouls.LibraryOfSouls" - apiVersion = "1.18" - name = "LibraryOfSouls" - authors = listOf("The Monumenta Team") - depend = listOf("CommandAPI", "NBTEditor") - softDepend = listOf("MonumentaRedisSync") -} - -pmd { - isConsoleOutput = true - toolVersion = "6.41.0" - ruleSets = listOf("$rootDir/pmd-ruleset.xml") - setIgnoreFailures(true) -} - -java { - withJavadocJar() - withSourcesJar() -} - -publishing { - publications { - create("maven") { - from(components["java"]) + compileOnly(libs.commandapi) + compileOnly(libs.nbtapi) + compileOnly(libs.redissync) { + artifact { + classifier = "all" } } - repositories { - maven { - name = "MonumentaMaven" - url = when (version.toString().endsWith("SNAPSHOT")) { - true -> uri("https://maven.playmonumenta.com/snapshots") - false -> uri("https://maven.playmonumenta.com/releases") - } - - credentials { - username = System.getenv("USERNAME") - password = System.getenv("TOKEN") - } + compileOnly(libs.nbteditor) { + artifact { + classifier = "all" } } + compileOnly(libs.gson) } -tasks.withType().configureEach { - options.encoding = "UTF-8" - options.compilerArgs.add("-Xmaxwarns") - options.compilerArgs.add("10000") - options.compilerArgs.add("-Xlint:deprecation") - - options.errorprone { - option("NullAway:AnnotatedPackages", "com.playmonumenta") - - allErrorsAsWarnings.set(true) - - /*** Disabled checks ***/ - // These we almost certainly don't want - check( - "InlineMeSuggester", - CheckSeverity.OFF - ) // We won't keep deprecated stuff around long enough for this to matter - check("CatchAndPrintStackTrace", CheckSeverity.OFF) // This is the primary way a lot of exceptions are handled - check( - "FutureReturnValueIgnored", - CheckSeverity.OFF - ) // This one is dumb and doesn't let you check return values with .whenComplete() - check( - "ImmutableEnumChecker", - CheckSeverity.OFF - ) // Would like to turn this on but we'd have to annotate a bunch of base classes - check( - "LockNotBeforeTry", - CheckSeverity.OFF - ) // Very few locks in our code, those that we have are simple and refactoring like this would be ugly - check("StaticAssignmentInConstructor", CheckSeverity.OFF) // We have tons of these on purpose - check("StringSplitter", CheckSeverity.OFF) // We have a lot of string splits too which are fine for this use - check( - "MutablePublicArray", - CheckSeverity.OFF - ) // These are bad practice but annoying to refactor and low risk of actual bugs - } +monumenta { + name("LibraryOfSouls") + paper( + "com.playmonumenta.libraryofsouls.LibraryOfSouls", BukkitPluginDescription.PluginLoadOrder.POSTWORLD, "1.18", + depends = listOf("CommandAPI", "NBTEditor"), + softDepends = listOf("MonumentaRedisSync"), + apiJarVersion = "1.20-R0.1-SNAPSHOT" + ) } - -ssh.easySetup(tasks.named("shadowJar").get(), "LibraryOfSouls") diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml deleted file mode 100644 index 5681df9..0000000 --- a/config/checkstyle/checkstyle.xml +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/config/checkstyle/suppressions.xml b/config/checkstyle/suppressions.xml deleted file mode 100644 index af01377..0000000 --- a/config/checkstyle/suppressions.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..6b53af4 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,13 @@ +[versions] +commandapi = "9.4.1" +nbtapi = "2.12.0-SNAPSHOT" +redissync = "4.1" +nbteditor = "4.1" +gson = "2.8.5" + +[libraries] +commandapi = { module = "dev.jorel:commandapi-bukkit-core", version.ref = "commandapi" } +nbtapi = { module = "de.tr7zw:item-nbt-api-plugin", version.ref = "nbtapi" } +redissync = { module = "com.playmonumenta:redissync", version.ref = "redissync" } +nbteditor = { module = "com.playmonumenta:nbteditor", version.ref = "nbteditor" } +gson = { module = "com.google.code.gson:gson", version.ref = "gson" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e6e589..e1adfb4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/pmd-ruleset.xml b/pmd-ruleset.xml deleted file mode 100644 index 4444f8f..0000000 --- a/pmd-ruleset.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - The default ruleset used by the Maven PMD Plugin, when no other ruleset is specified. - It contains the rules of the old (pre PMD 6.0.0) rulesets java-basic, java-empty, java-imports, - java-unnecessary, java-unusedcode. - - This ruleset might be used as a starting point for an own customized ruleset [0]. - - [0] https://pmd.github.io/latest/pmd_userdocs_making_rulesets.html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -