diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c032502..2cb857e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,3 +28,11 @@ jobs: - name: Run Tests run: ./gradlew test + + - name: Run Pre-PluginHub-Checks + run: | + longestLine=$(cat build.gradle | wc -L) + if (( longestLine > 120 )); then + echo "Malformed gradle - longest line: ${longestLine}" + exit 1 + fi diff --git a/build.gradle b/build.gradle index d8a2744..d530a37 100644 --- a/build.gradle +++ b/build.gradle @@ -6,12 +6,14 @@ plugins { } repositories { - // mavenLocal() seems to always break on my PC (looking for linux binaries even though I'm on windows): + // mavenLocal() seems to always break on my PC + // (looking for linux binaries even though I'm on windows): // Execution failed for task ':test'. // > Could not resolve all files for configuration ':testRuntimeClasspath'. - // > Could not find lwjgl-opengl-3.3.2-natives-linux-arm64.jar (org.lwjgl:lwjgl-opengl:3.3.2). + // > Could not find lwjgl-opengl-3.3.2-natives-linux-arm64.jar + // (org.lwjgl:lwjgl-opengl:3.3.2). // Searched in the following locations: - // file:/C:/Users/Lexer/.m2/repository/org/lwjgl/lwjgl-opengl/3.3.2/lwjgl-opengl-3.3.2-natives-linux-arm64.jar + // file:/C:/Users/Lexer/.../lwjgl-opengl-3.3.2-natives-linux-arm64.jar maven { url = 'https://repo.runelite.net' } @@ -46,7 +48,8 @@ tasks.withType(JavaCompile) { options.release.set(11) } -// Code based on https://gist.github.com/lwasyl/6ae0b8a66903729033e18ffc7a503597#file-fancy_logging_original-gradle +// Code based on +// https://gist.github.com/lwasyl/6ae0b8a66903729033e18ffc7a503597#file-fancy_logging_original-gradle tasks.withType(Test) { // if no `-Pupdate=all` is passed to gradle then we assume none def update=project.properties['update'] ?: "none" @@ -80,10 +83,25 @@ tasks.withType(Test) { afterSuite { desc, result -> if (!desc.parent) { // will match the outermost suite - def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)" + def output = "Results: ${result.resultType}"+ + " (${result.testCount} tests"+ + ", ${result.successfulTestCount} successes"+ + ", ${result.failedTestCount} failures"+ + ", ${result.skippedTestCount} skipped)" def startItem = '| ', endItem = ' |' - def repeatLength = startItem.length() + output.length() + endItem.length() - println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength)) + def repeatLength = startItem.length() + + output.length() + + endItem.length() + println( + '\n' + + ('-' * repeatLength) + + '\n' + + startItem + + output + + endItem + + '\n' + + ('-' * repeatLength) + ) } } }