diff --git a/build.gradle b/build.gradle index 5cee3c2e..871c65d2 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ plugins { id 'org.jetbrains.intellij' version '0.3.6' apply(false) id 'org.jmailen.kotlinter' version '1.16.0' apply(false) id 'org.sonarqube' version '2.6.2' + id "io.gitlab.arturbosch.detekt" version "1.0.0.RC8" } allprojects { @@ -17,5 +18,6 @@ allprojects { } apply from: 'gradle/properties.gradle' -apply from: 'gradle/quality-gate.gradle' +apply from: 'gradle/code-quality.gradle' +apply from: 'gradle/testing.gradle' apply from: 'gradle/wrapper.gradle' \ No newline at end of file diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index 8768ea0f..00000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -apply plugin: 'groovy' - -repositories { - mavenLocal() - maven { url "https://repo.maven.apache.org/maven2" } -} - -dependencies { - compile gradleApi() -} \ No newline at end of file diff --git a/buildSrc/src/main/groovy/org/apollo/build/plugin/ApolloPlugin.groovy b/buildSrc/src/main/groovy/org/apollo/build/plugin/ApolloPlugin.groovy deleted file mode 100644 index f8f4459b..00000000 --- a/buildSrc/src/main/groovy/org/apollo/build/plugin/ApolloPlugin.groovy +++ /dev/null @@ -1,12 +0,0 @@ -package org.apollo.build.plugin - -import org.gradle.api.Plugin -import org.gradle.api.Project - -class ApolloPlugin implements Plugin { - - @Override - void apply(Project project) { - project.extensions.create('plugin', ApolloPluginExtension, project) - } -} diff --git a/buildSrc/src/main/groovy/org/apollo/build/plugin/ApolloPluginExtension.groovy b/buildSrc/src/main/groovy/org/apollo/build/plugin/ApolloPluginExtension.groovy deleted file mode 100644 index a89ff51d..00000000 --- a/buildSrc/src/main/groovy/org/apollo/build/plugin/ApolloPluginExtension.groovy +++ /dev/null @@ -1,92 +0,0 @@ -package org.apollo.build.plugin - -import org.gradle.api.Project - -class ApolloPluginExtension { - final Project project - - /** - * The name of this plugin (defaults to the project name). - */ - String name - - /** - * An optional description of this plugin. - */ - String description = "Empty description" - - /** - * A list of other {@link ApolloPlugin}s that this plugin depends on. - */ - List dependencies = [] - - /** - * A list of others who contributed to this plugin. - */ - List authors = [] - - /** - * The directory that library files and script files are found under. - */ - final String srcDir = "src/" - - /** - * The directory that tests are found under. - */ - final String testDir = "test/" - - ApolloPluginExtension(Project project) { - this.project = project - this.name = project.name - - init() - } - - /** - * Setup the {@link Project} with the correct dependencies and tasks required to build the plugin - * and its scripts. - */ - def init() { - project.plugins.apply('kotlin') - project.dependencies { - implementation project.findProject(':game') - implementation project.findProject(':cache') - implementation project.findProject(':net') - implementation project.findProject(':util') - testImplementation project.findProject(':game:plugin-testing') - } - - project.sourceSets { - main.kotlin.srcDirs += this.srcDir - test.kotlin.srcDirs += this.testDir - } - } - - def getDependencies() { - return dependencies - } - - def setDependencies(List dependencies) { - dependencies.each { - def project = project.findProject(":game:plugin:$it") - if (project == null) { - throw new MissingPluginDependencyException(name, it) - } - - this.project.dependencies.add('compile', project) - } - - this.dependencies = dependencies - } -} - -/** - * A {@link RuntimeException} thrown when a plugin dependency was missing. - */ -class MissingPluginDependencyException extends RuntimeException { - - MissingPluginDependencyException(String plugin, String dependency) { - super("Missing dependency in the `$plugin` plugin: failed to resolve `$dependency`.") - } - -} \ No newline at end of file diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/apollo-plugin.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/apollo-plugin.properties deleted file mode 100644 index 5b546ceb..00000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/apollo-plugin.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.apollo.build.plugin.ApolloPlugin \ No newline at end of file diff --git a/cache/build.gradle b/cache/build.gradle index 95ef6d6a..af79e12d 100644 --- a/cache/build.gradle +++ b/cache/build.gradle @@ -5,4 +5,10 @@ description = 'Apollo Cache' dependencies { implementation project(':util') implementation group: 'com.google.guava', name: 'guava', version: guavaVersion + + test.useJUnitPlatform() + testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitJupiterVersion + testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitJupiterVersion + testImplementation group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVintageVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: junitPlatformVersion } diff --git a/game/plugin/api/build.gradle b/game/plugin/api/build.gradle index fb25c053..c1c8d477 100644 --- a/game/plugin/api/build.gradle +++ b/game/plugin/api/build.gradle @@ -1,4 +1,16 @@ -plugin { - name = "Apollo Plugin API" - description = "Helpers and API for common plugin usecases" -} \ No newline at end of file +apply plugin: 'org.jetbrains.kotlin.jvm' +apply plugin: 'java' +description = 'Helpers and API for common plugin usecases' + +test { + useJUnitPlatform() +} + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/areas/build.gradle b/game/plugin/areas/build.gradle index 4a0d8ff9..22344bea 100644 --- a/game/plugin/areas/build.gradle +++ b/game/plugin/areas/build.gradle @@ -1,6 +1,12 @@ -plugin { - name = "Area listeners" - description = "Enables plugins to listen on mobs entering, moving inside of, or leaving a rectangular area." - authors = ["Major"] - dependencies = ["api"] -} \ No newline at end of file +apply plugin: 'kotlin' + +description = 'Enables plugins to listen on mobs entering, moving inside of, or leaving a rectangular area.' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:api') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/bank/build.gradle b/game/plugin/bank/build.gradle index a8166f04..3a935139 100644 --- a/game/plugin/bank/build.gradle +++ b/game/plugin/bank/build.gradle @@ -1,6 +1,10 @@ -plugin { - name = "banking" - authors = [ - "Major", - ] -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/build.gradle b/game/plugin/build.gradle index 0fd76d26..24ba2cc8 100644 --- a/game/plugin/build.gradle +++ b/game/plugin/build.gradle @@ -1,8 +1,21 @@ -subprojects { subproj -> - if (subproj.buildFile.exists()) { - apply plugin: 'apollo-plugin' +gradle.projectsEvaluated { + configure(subprojects.findAll { it.buildFile.exists() }) { subproj -> apply from: "$rootDir/gradle/kotlin.gradle" + sourceSets { + main { + kotlin { + srcDirs += "src" + } + } + + test { + kotlin { + srcDirs += "test" + } + } + } + test { useJUnitPlatform() } @@ -14,8 +27,7 @@ subprojects { subproj -> } dependencies { - test.useJUnitPlatform() implementation group: 'com.google.guava', name: 'guava', version: guavaVersion } } -} +} \ No newline at end of file diff --git a/game/plugin/chat/private-messaging/build.gradle b/game/plugin/chat/private-messaging/build.gradle index 4bd4ef67..3a935139 100644 --- a/game/plugin/chat/private-messaging/build.gradle +++ b/game/plugin/chat/private-messaging/build.gradle @@ -1,3 +1,10 @@ -plugin { - name = "private_messaging" -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/cmd/build.gradle b/game/plugin/cmd/build.gradle index 051b171c..4d96c9f5 100644 --- a/game/plugin/cmd/build.gradle +++ b/game/plugin/cmd/build.gradle @@ -1,12 +1,10 @@ -plugin { - name = "chat_commands" - authors = [ - "Graham", - "Major", - "lare96", - "cubeee", - ] - dependencies = [ - "api" - ] -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:api') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/consumables/build.gradle b/game/plugin/consumables/build.gradle index 6f5139fa..3a935139 100644 --- a/game/plugin/consumables/build.gradle +++ b/game/plugin/consumables/build.gradle @@ -1,6 +1,10 @@ -plugin { - name = "consumables" - authors = [ - "Gary Tierney", - ] -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/detekt.yml b/game/plugin/detekt.yml deleted file mode 100644 index 0872ae9d..00000000 --- a/game/plugin/detekt.yml +++ /dev/null @@ -1,325 +0,0 @@ -autoCorrect: true -failFast: false - -build: - warningThreshold: 5 - failThreshold: 10 - weights: - complexity: 2 - formatting: 1 - LongParameterList: 1 - comments: 1 - -processors: - active: true - exclude: - # - 'FunctionCountProcessor' - # - 'PropertyCountProcessor' - # - 'ClassCountProcessor' - # - 'PackageCountProcessor' - # - 'KtFileCountProcessor' - -console-reports: - active: true - exclude: - # - 'ProjectStatisticsReport' - # - 'ComplexityReport' - # - 'NotificationReport' - # - 'FindingsReport' - # - 'BuildFailureReport' - -output-reports: - active: true - exclude: - # - 'PlainOutputReport' - # - 'XmlOutputReport' - -potential-bugs: - active: true - DuplicateCaseInWhenExpression: - active: true - EqualsAlwaysReturnsTrueOrFalse: - active: false - EqualsWithHashCodeExist: - active: true - WrongEqualsTypeParameter: - active: false - ExplicitGarbageCollectionCall: - active: true - UnreachableCode: - active: true - LateinitUsage: - active: false - UnsafeCallOnNullableType: - active: false - UnsafeCast: - active: false - UselessPostfixExpression: - active: false - -performance: - active: true - ForEachOnRange: - active: true - SpreadOperator: - active: true - UnnecessaryTemporaryInstantiation: - active: true - -exceptions: - active: true - ExceptionRaisedInUnexpectedLocation: - active: false - methodNames: 'toString,hashCode,equals,finalize' - SwallowedException: - active: false - TooGenericExceptionCaught: - active: true - exceptions: - - ArrayIndexOutOfBoundsException - - Error - - Exception - - IllegalMonitorStateException - - IndexOutOfBoundsException - - InterruptedException - - NullPointerException - - RuntimeException - TooGenericExceptionThrown: - active: true - exceptions: - - Throwable - - ThrowError - - ThrowException - - ThrowNullPointerException - - ThrowRuntimeException - - ThrowThrowable - InstanceOfCheckForException: - active: false - IteratorNotThrowingNoSuchElementException: - active: false - PrintExceptionStackTrace: - active: false - RethrowCaughtException: - active: false - ReturnFromFinally: - active: false - ThrowingExceptionFromFinally: - active: false - ThrowingExceptionInMain: - active: false - ThrowingNewInstanceOfSameException: - active: false - -empty-blocks: - active: true - EmptyCatchBlock: - active: true - EmptyClassBlock: - active: true - EmptyDefaultConstructor: - active: true - EmptyDoWhileBlock: - active: true - EmptyElseBlock: - active: true - EmptyFinallyBlock: - active: true - EmptyForBlock: - active: true - EmptyFunctionBlock: - active: true - EmptyIfBlock: - active: true - EmptyInitBlock: - active: true - EmptySecondaryConstructor: - active: true - EmptyWhenBlock: - active: true - EmptyWhileBlock: - active: true - -complexity: - active: true - LongMethod: - threshold: 20 - LongParameterList: - threshold: 5 - LargeClass: - threshold: 150 - ComplexMethod: - threshold: 10 - TooManyFunctions: - threshold: 10 - ComplexCondition: - threshold: 3 - LabeledExpression: - active: false - StringLiteralDuplication: - active: false - threshold: 2 - ignoreAnnotation: true - excludeStringsWithLessThan5Characters: true - ignoreStringsRegex: '$^' - -code-smell: - active: true - FeatureEnvy: - threshold: 0.5 - weight: 0.45 - base: 0.5 - -formatting: - active: true - useTabs: true - Indentation: - active: false - indentSize: 4 - ConsecutiveBlankLines: - active: true - autoCorrect: true - MultipleSpaces: - active: true - autoCorrect: true - SpacingAfterComma: - active: true - autoCorrect: true - SpacingAfterKeyword: - active: true - autoCorrect: true - SpacingAroundColon: - active: true - autoCorrect: true - SpacingAroundCurlyBraces: - active: true - autoCorrect: true - SpacingAroundOperator: - active: true - autoCorrect: true - TrailingSpaces: - active: true - autoCorrect: true - UnusedImports: - active: true - autoCorrect: true - OptionalSemicolon: - active: true - autoCorrect: true - OptionalUnit: - active: true - autoCorrect: true - ExpressionBodySyntax: - active: false - autoCorrect: false - ExpressionBodySyntaxLineBreaks: - active: false - autoCorrect: false - OptionalReturnKeyword: - active: true - autoCorrect: false - -style: - active: true - ReturnCount: - active: true - max: 2 - NewLineAtEndOfFile: - active: true - OptionalAbstractKeyword: - active: true - OptionalWhenBraces: - active: false - EqualsNullCall: - active: false - ForbiddenComment: - active: true - values: 'TODO:,FIXME:,STOPSHIP:' - ForbiddenImport: - active: false - imports: '' - PackageDeclarationStyle: - active: false - ModifierOrder: - active: true - MagicNumber: - active: true - ignoreNumbers: '-1,0,1,2' - ignoreHashCodeFunction: false - ignorePropertyDeclaration: false - ignoreAnnotation: false - WildcardImport: - active: true - SafeCast: - active: true - MaxLineLength: - active: true - maxLineLength: 120 - excludePackageStatements: false - excludeImportStatements: false - PackageNaming: - active: true - packagePattern: '^[a-z]+(\.[a-z][a-z0-9]*)*$' - ClassNaming: - active: true - classPattern: '[A-Z$][a-zA-Z$]*' - EnumNaming: - active: true - enumEntryPattern: '^[A-Z$][a-zA-Z_$]*$' - FunctionNaming: - active: true - functionPattern: '^[a-z$][a-zA-Z$0-9]*$' - FunctionMaxLength: - active: false - maximumFunctionNameLength: 30 - FunctionMinLength: - active: false - minimumFunctionNameLength: 3 - VariableNaming: - active: true - variablePattern: '^(_)?[a-z$][a-zA-Z$0-9]*$' - ConstantNaming: - active: true - constantPattern: '^([A-Z_]*|serialVersionUID)$' - VariableMaxLength: - active: false - maximumVariableNameLength: 30 - VariableMinLength: - active: false - minimumVariableNameLength: 3 - ForbiddenClassName: - active: false - forbiddenName: '' - ProtectedMemberInFinalClass: - active: false - UnnecessaryParentheses: - active: false - DataClassContainsFunctions: - active: false - UseDataClass: - active: false - UnnecessaryAbstractClass: - active: false - -comments: - active: true - CommentOverPrivateMethod: - active: true - CommentOverPrivateProperty: - active: true - UndocumentedPublicClass: - active: false - searchInNestedClass: true - searchInInnerClass: true - searchInInnerObject: true - searchInInnerInterface: true - UndocumentedPublicFunction: - active: false - -# *experimental feature* -# Migration rules can be defined in the same config file or a new one -migration: - active: true - imports: - # your.package.Class: new.package.or.Class - # for example: - # io.gitlab.arturbosch.detekt.api.Rule: io.gitlab.arturbosch.detekt.rule.Rule diff --git a/game/plugin/dummy/build.gradle b/game/plugin/dummy/build.gradle index 46f8224a..3a935139 100644 --- a/game/plugin/dummy/build.gradle +++ b/game/plugin/dummy/build.gradle @@ -1,6 +1,10 @@ -plugin { - name = "training_dummy" - authors = [ - "Gary Tierney", - ] -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/emote-tab/build.gradle b/game/plugin/emote-tab/build.gradle index 04160d86..3a935139 100644 --- a/game/plugin/emote-tab/build.gradle +++ b/game/plugin/emote-tab/build.gradle @@ -1,6 +1,10 @@ -plugin { - name = "emote_tab" - authors = [ - "Gary Tierney", - ] -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/entity/following/build.gradle b/game/plugin/entity/following/build.gradle index a252080e..3f43d5f0 100644 --- a/game/plugin/entity/following/build.gradle +++ b/game/plugin/entity/following/build.gradle @@ -1,10 +1,13 @@ -plugin { - name = "following" - authors = [ - "Gary Tierney", - ] - dependencies = [ - "entity:walk-to", - "entity:player-action", - ] -} \ No newline at end of file +apply plugin: 'kotlin' + + + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:entity:walk-to') + implementation project(':game:plugin:entity:player-action') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/entity/player-action/build.gradle b/game/plugin/entity/player-action/build.gradle index 43f394f3..3a935139 100644 --- a/game/plugin/entity/player-action/build.gradle +++ b/game/plugin/entity/player-action/build.gradle @@ -1,6 +1,10 @@ -plugin { - name = "player_action" - authors = [ - "Gary Tierney", - ] -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/entity/spawn/build.gradle b/game/plugin/entity/spawn/build.gradle index e0bb2828..4d96c9f5 100644 --- a/game/plugin/entity/spawn/build.gradle +++ b/game/plugin/entity/spawn/build.gradle @@ -1,9 +1,10 @@ -plugin { - name = "spawning" - authors = [ - "Gary Tierney", - ] - dependencies = [ - "api", - ] -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:api') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/entity/walk-to/build.gradle b/game/plugin/entity/walk-to/build.gradle index 13ca8949..3a935139 100644 --- a/game/plugin/entity/walk-to/build.gradle +++ b/game/plugin/entity/walk-to/build.gradle @@ -1,6 +1,10 @@ -plugin { - name = "walkto" - authors = [ - "Gary Tierney", - ] -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/locations/al-kharid/build.gradle b/game/plugin/locations/al-kharid/build.gradle index 3be3eb4f..7eed7d87 100644 --- a/game/plugin/locations/al-kharid/build.gradle +++ b/game/plugin/locations/al-kharid/build.gradle @@ -1,10 +1,13 @@ -plugin { - name = "al_kharid" - authors = [ - "Jesse W", - "Arham 4" - ] - dependencies = [ - "entity:spawn", "shops" - ] -} \ No newline at end of file +apply plugin: 'kotlin' + + + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:entity:spawn') + implementation project(':game:plugin:shops') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/locations/edgeville/build.gradle b/game/plugin/locations/edgeville/build.gradle index 0f2de321..7eed7d87 100644 --- a/game/plugin/locations/edgeville/build.gradle +++ b/game/plugin/locations/edgeville/build.gradle @@ -1,10 +1,13 @@ -plugin { - name = "edgeville" - authors = [ - "Jesse W", - "Arham 4" - ] - dependencies = [ - "entity:spawn", "shops" - ] -} \ No newline at end of file +apply plugin: 'kotlin' + + + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:entity:spawn') + implementation project(':game:plugin:shops') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/locations/falador/build.gradle b/game/plugin/locations/falador/build.gradle index 9af8dd9e..7eed7d87 100644 --- a/game/plugin/locations/falador/build.gradle +++ b/game/plugin/locations/falador/build.gradle @@ -1,10 +1,13 @@ -plugin { - name = "falador" - authors = [ - "Jesse W", - "Arham 4" - ] - dependencies = [ - "entity:spawn", "shops" - ] -} \ No newline at end of file +apply plugin: 'kotlin' + + + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:entity:spawn') + implementation project(':game:plugin:shops') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/locations/lumbridge/build.gradle b/game/plugin/locations/lumbridge/build.gradle index 97bdf686..7eed7d87 100644 --- a/game/plugin/locations/lumbridge/build.gradle +++ b/game/plugin/locations/lumbridge/build.gradle @@ -1,10 +1,13 @@ -plugin { - name = "lumbridge" - authors = [ - "Gary Tierney", - "Arham 4" - ] - dependencies = [ - "entity:spawn", "shops" - ] -} \ No newline at end of file +apply plugin: 'kotlin' + + + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:entity:spawn') + implementation project(':game:plugin:shops') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/locations/tutorial-island/build.gradle b/game/plugin/locations/tutorial-island/build.gradle index 60631802..24e7bbae 100644 --- a/game/plugin/locations/tutorial-island/build.gradle +++ b/game/plugin/locations/tutorial-island/build.gradle @@ -1,9 +1,10 @@ -plugin { - name = "tutorial_island_npc_spawns" - authors = [ - "Jesse W", - ] - dependencies = [ - "entity:spawn", - ] -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:entity:spawn') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/locations/varrock/build.gradle b/game/plugin/locations/varrock/build.gradle index f094b1bc..6a06d733 100644 --- a/game/plugin/locations/varrock/build.gradle +++ b/game/plugin/locations/varrock/build.gradle @@ -1,11 +1,11 @@ -plugin { - name = "varrock" - authors = [ - "Jesse W", - "Major", - "tlf30", - ] - dependencies = [ - "entity:spawn", "shops" - ] -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:entity:spawn') + implementation project(':game:plugin:shops') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/logout/build.gradle b/game/plugin/logout/build.gradle index ae0395e6..3a935139 100644 --- a/game/plugin/logout/build.gradle +++ b/game/plugin/logout/build.gradle @@ -1,3 +1,10 @@ -plugin { - name = "logout" -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/navigation/door/build.gradle b/game/plugin/navigation/door/build.gradle index 8ac64215..4d96c9f5 100644 --- a/game/plugin/navigation/door/build.gradle +++ b/game/plugin/navigation/door/build.gradle @@ -1,8 +1,10 @@ -plugin { - name = "door" - dependencies = ["api"] - authors = [ - "Shiver", - "Arin" - ] -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:api') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/run/build.gradle b/game/plugin/run/build.gradle index 1e335cc4..3a935139 100644 --- a/game/plugin/run/build.gradle +++ b/game/plugin/run/build.gradle @@ -1,3 +1,10 @@ -plugin { - name = "run" -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/shops/build.gradle b/game/plugin/shops/build.gradle index 369bf235..4d96c9f5 100644 --- a/game/plugin/shops/build.gradle +++ b/game/plugin/shops/build.gradle @@ -1,11 +1,10 @@ -plugin { - name = "shops" - authors = [ - "Stuart", - "Major", - "tlf30" - ] - dependencies = [ - "api", - ] +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:api') + testImplementation project(':game:plugin-testing') } diff --git a/game/plugin/skills/fishing/build.gradle b/game/plugin/skills/fishing/build.gradle index 435281cb..4314d6fd 100644 --- a/game/plugin/skills/fishing/build.gradle +++ b/game/plugin/skills/fishing/build.gradle @@ -1,12 +1,13 @@ -plugin { - name = "fishing_skill" - authors = [ - "Linux", - "Major", - "tlf30" - ] - dependencies = [ - "api", - "entity:spawn", - ] +apply plugin: 'kotlin' + + + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:api') + implementation project(':game:plugin:entity:spawn') + testImplementation project(':game:plugin-testing') } diff --git a/game/plugin/skills/herblore/build.gradle b/game/plugin/skills/herblore/build.gradle index 6dc08aac..4d96c9f5 100644 --- a/game/plugin/skills/herblore/build.gradle +++ b/game/plugin/skills/herblore/build.gradle @@ -1,10 +1,10 @@ -plugin { - name = "herblore_skill" - authors = [ - "Chivvon", - "Chris Fletcher", - "Major" - ] +apply plugin: 'kotlin' - dependencies = ["api"] +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:api') + testImplementation project(':game:plugin-testing') } diff --git a/game/plugin/skills/mining/build.gradle b/game/plugin/skills/mining/build.gradle index 71bc9020..4d96c9f5 100644 --- a/game/plugin/skills/mining/build.gradle +++ b/game/plugin/skills/mining/build.gradle @@ -1,14 +1,10 @@ -plugin { - name = "mining-skill" - authors = [ - "Graham", - "Mikey`", - "Major", - "WH:II:DOW", - "Requa", - "Clifton", - "tlf30" - ] +apply plugin: 'kotlin' - dependencies = ["api"] -} \ No newline at end of file +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:api') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/skills/prayer/build.gradle b/game/plugin/skills/prayer/build.gradle index 5ea5c0b2..4d96c9f5 100644 --- a/game/plugin/skills/prayer/build.gradle +++ b/game/plugin/skills/prayer/build.gradle @@ -1,11 +1,10 @@ -plugin { - name = "prayer_skill" - authors = [ - "Major", - "010253", - "tlf30" - ] - dependencies = [ - "api" - ] +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:api') + testImplementation project(':game:plugin-testing') } diff --git a/game/plugin/skills/runecrafting/build.gradle b/game/plugin/skills/runecrafting/build.gradle index 74ddffb6..4d96c9f5 100644 --- a/game/plugin/skills/runecrafting/build.gradle +++ b/game/plugin/skills/runecrafting/build.gradle @@ -1,12 +1,10 @@ -plugin { - name = "runecrafting-skill" - authors = [ - "Major", - "BugCrusher", - "tlf30" - ] +apply plugin: 'kotlin' - dependencies = [ - "api" - ] -} \ No newline at end of file +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:api') + testImplementation project(':game:plugin-testing') +} diff --git a/game/plugin/skills/woodcutting/build.gradle b/game/plugin/skills/woodcutting/build.gradle index 0da7a40d..4d96c9f5 100644 --- a/game/plugin/skills/woodcutting/build.gradle +++ b/game/plugin/skills/woodcutting/build.gradle @@ -1,7 +1,10 @@ -plugin { - name = "woodcutting_skill" - authors = [ - "tlf30" - ] - dependencies = ["api"] -} \ No newline at end of file +apply plugin: 'kotlin' + +dependencies { + implementation project(':game') + implementation project(':cache') + implementation project(':net') + implementation project(':util') + implementation project(':game:plugin:api') + testImplementation project(':game:plugin-testing') +} diff --git a/gradle/code-quality.gradle b/gradle/code-quality.gradle new file mode 100644 index 00000000..240743c8 --- /dev/null +++ b/gradle/code-quality.gradle @@ -0,0 +1,24 @@ +def detektAggregateReport = "$rootDir/reports/detekt-report.xml" + +detekt { + version = detektVersion + + defaultProfile { + output = file("$buildDir/reports") + outputName = "detekt-report" + config = file("$rootDir/gradle/config/detekt.yml") + parallel = true + } +} + +dependencies { + detekt group: 'io.gitlab.arturbosch.detekt', name: 'detekt-formatting', version: detektVersion +} + +sonarqube { + properties { + property "sonar.kotlin.detekt.reportPaths", detektAggregateReport + } +} + +tasks["sonarqube"].dependsOn(detektCheck) \ No newline at end of file diff --git a/gradle/config/detekt.yml b/gradle/config/detekt.yml new file mode 100644 index 00000000..774cafc7 --- /dev/null +++ b/gradle/config/detekt.yml @@ -0,0 +1,474 @@ +autoCorrect: true +failFast: false + +test-pattern: # Configure exclusions for test sources + active: true + patterns: # Test file regexes + - '.*/test/.*' + - '.*Test.kt' + - '.*Spec.kt' + exclude-rule-sets: + - 'comments' + exclude-rules: + - 'NamingRules' + - 'WildcardImport' + - 'MagicNumber' + - 'MaxLineLength' + - 'LateinitUsage' + - 'StringLiteralDuplication' + - 'SpreadOperator' + - 'TooManyFunctions' + - 'ForEachOnRange' + +build: + maxIssues: -1 + weights: + # complexity: 2 + # LongParameterList: 1 + # style: 1 + # comments: 1 + +processors: + active: true + exclude: + # - 'FunctionCountProcessor' + # - 'PropertyCountProcessor' + # - 'ClassCountProcessor' + # - 'PackageCountProcessor' + # - 'KtFileCountProcessor' + +console-reports: + active: true + exclude: + # - 'ProjectStatisticsReport' + # - 'ComplexityReport' + # - 'NotificationReport' + # - 'FindingsReport' + # - 'BuildFailureReport' + +output-reports: + active: true + exclude: + # - 'HtmlOutputReport' + # - 'PlainOutputReport' + # - 'XmlOutputReport' + +comments: + active: true + CommentOverPrivateFunction: + active: false + CommentOverPrivateProperty: + active: false + EndOfSentenceFormat: + active: false + endOfSentenceFormat: ([.?!][ \t\n\r\f<])|([.?!]$) + UndocumentedPublicClass: + active: false + searchInNestedClass: true + searchInInnerClass: true + searchInInnerObject: true + searchInInnerInterface: true + UndocumentedPublicFunction: + active: false + +complexity: + active: true + ComplexCondition: + active: false + threshold: 4 + ComplexInterface: + active: false + threshold: 10 + includeStaticDeclarations: false + ComplexMethod: + active: false + threshold: 10 + ignoreSingleWhenExpression: false + LabeledExpression: + active: false + LargeClass: + active: true + threshold: 150 + LongMethod: + active: false + threshold: 20 + LongParameterList: + active: false + threshold: 6 + ignoreDefaultParameters: false + MethodOverloading: + active: false + threshold: 6 + NestedBlockDepth: + active: true + threshold: 4 + StringLiteralDuplication: + active: false + threshold: 3 + ignoreAnnotation: true + excludeStringsWithLessThan5Characters: true + ignoreStringsRegex: '$^' + TooManyFunctions: + active: true + thresholdInFiles: 11 + thresholdInClasses: 11 + thresholdInInterfaces: 11 + thresholdInObjects: 11 + thresholdInEnums: 11 + ignoreDeprecated: false + ignorePrivate: false + +empty-blocks: + active: true + EmptyCatchBlock: + active: true + allowedExceptionNameRegex: "^(_|(ignore|expected).*)" + EmptyClassBlock: + active: true + EmptyDefaultConstructor: + active: true + EmptyDoWhileBlock: + active: true + EmptyElseBlock: + active: true + EmptyFinallyBlock: + active: true + EmptyForBlock: + active: true + EmptyFunctionBlock: + active: true + ignoreOverriddenFunctions: false + EmptyIfBlock: + active: true + EmptyInitBlock: + active: true + EmptyKtFile: + active: true + EmptySecondaryConstructor: + active: true + EmptyWhenBlock: + active: true + EmptyWhileBlock: + active: true + +exceptions: + active: true + ExceptionRaisedInUnexpectedLocation: + active: false + methodNames: 'toString,hashCode,equals,finalize' + InstanceOfCheckForException: + active: false + NotImplementedDeclaration: + active: false + PrintStackTrace: + active: false + RethrowCaughtException: + active: false + ReturnFromFinally: + active: false + SwallowedException: + active: false + ThrowingExceptionFromFinally: + active: false + ThrowingExceptionInMain: + active: false + ThrowingExceptionsWithoutMessageOrCause: + active: false + exceptions: 'IllegalArgumentException,IllegalStateException,IOException' + ThrowingNewInstanceOfSameException: + active: false + TooGenericExceptionCaught: + active: true + exceptionNames: + - ArrayIndexOutOfBoundsException + - Error + - Exception + - IllegalMonitorStateException + - NullPointerException + - IndexOutOfBoundsException + - RuntimeException + - Throwable + TooGenericExceptionThrown: + active: true + exceptionNames: + - Error + - Exception + - Throwable + - RuntimeException + +formatting: + active: true + android: false + autoCorrect: true + ChainWrapping: + active: true + autoCorrect: true + CommentSpacing: + active: true + autoCorrect: true + Filename: + active: true + FinalNewline: + active: true + autoCorrect: true + ImportOrdering: + active: true + autoCorrect: true + Indentation: + active: true + autoCorrect: true + indentSize: 4 + continuationIndentSize: 4 + MaximumLineLength: + active: false + ModifierOrdering: + active: true + autoCorrect: true + NoBlankLineBeforeRbrace: + active: true + autoCorrect: true + NoConsecutiveBlankLines: + active: true + autoCorrect: true + NoEmptyClassBody: + active: true + autoCorrect: true + NoItParamInMultilineLambda: + active: false + NoLineBreakAfterElse: + active: true + autoCorrect: true + NoLineBreakBeforeAssignment: + active: true + autoCorrect: true + NoMultipleSpaces: + active: true + autoCorrect: true + NoSemicolons: + active: true + autoCorrect: true + NoTrailingSpaces: + active: true + autoCorrect: true + NoUnitReturn: + active: true + autoCorrect: true + NoUnusedImports: + active: true + autoCorrect: true + NoWildcardImports: + active: true + autoCorrect: true + ParameterListWrapping: + active: true + autoCorrect: true + indentSize: 4 + SpacingAroundColon: + active: true + autoCorrect: true + SpacingAroundComma: + active: true + autoCorrect: true + SpacingAroundCurly: + active: true + autoCorrect: true + SpacingAroundKeyword: + active: true + autoCorrect: true + SpacingAroundOperators: + active: true + autoCorrect: true + SpacingAroundRangeOperator: + active: true + autoCorrect: true + StringTemplate: + active: true + autoCorrect: true + +naming: + active: true + ClassNaming: + active: true + classPattern: '[A-Z$][a-zA-Z0-9$]*' + EnumNaming: + active: true + enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*' + ForbiddenClassName: + active: false + forbiddenName: '' + FunctionMaxLength: + active: false + maximumFunctionNameLength: 30 + FunctionMinLength: + active: false + minimumFunctionNameLength: 3 + FunctionNaming: + active: true + functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$' + excludeClassPattern: '$^' + MatchingDeclarationName: + active: true + MemberNameEqualsClassName: + active: false + ignoreOverriddenFunction: true + ObjectPropertyNaming: + active: true + propertyPattern: '[A-Za-z][_A-Za-z0-9]*' + constantPattern: '[A-Za-z][_A-Za-z0-9]*' + PackageNaming: + active: true + packagePattern: '^[a-z]+(\.[a-z][a-z0-9]*)*$' + TopLevelPropertyNaming: + active: false + constantPattern: '[A-Z][_A-Z0-9]*' + propertyPattern: '[A-Za-z][_A-Za-z0-9]*' + privatePropertyPattern: '(_)?[A-Za-z][A-Za-z0-9]*' + VariableMaxLength: + active: false + maximumVariableNameLength: 64 + VariableMinLength: + active: false + minimumVariableNameLength: 1 + VariableNaming: + active: false + variablePattern: '[a-z][A-Za-z0-9]*' + privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + +performance: + active: true + ForEachOnRange: + active: true + SpreadOperator: + active: true + UnnecessaryTemporaryInstantiation: + active: true + +potential-bugs: + active: true + DuplicateCaseInWhenExpression: + active: true + EqualsAlwaysReturnsTrueOrFalse: + active: false + EqualsWithHashCodeExist: + active: true + ExplicitGarbageCollectionCall: + active: true + InvalidRange: + active: false + IteratorHasNextCallsNextMethod: + active: false + IteratorNotThrowingNoSuchElementException: + active: false + LateinitUsage: + active: false + excludeAnnotatedProperties: "" + ignoreOnClassesPattern: "" + UnconditionalJumpStatementInLoop: + active: false + UnreachableCode: + active: true + UnsafeCallOnNullableType: + active: false + UnsafeCast: + active: false + UselessPostfixExpression: + active: false + WrongEqualsTypeParameter: + active: false + +style: + active: true + CollapsibleIfStatements: + active: false + DataClassContainsFunctions: + active: false + conversionFunctionPrefix: 'to' + EqualsNullCall: + active: false + ExpressionBodySyntax: + active: false + includeLineWrapping: false + ForbiddenComment: + active: true + values: 'TODO:,FIXME:,STOPSHIP:' + ForbiddenImport: + active: false + imports: '' + FunctionOnlyReturningConstant: + active: false + ignoreOverridableFunction: true + excludedFunctions: 'describeContents' + LoopWithTooManyJumpStatements: + active: false + maxJumpCount: 1 + MagicNumber: + active: false + MandatoryBracesIfStatements: + active: false + MaxLineLength: + active: false + maxLineLength: 120 + excludePackageStatements: false + excludeImportStatements: false + excludeCommentStatements: false + MayBeConst: + active: false + ModifierOrder: + active: true + NestedClassesVisibility: + active: false + NewLineAtEndOfFile: + active: false + NoTabs: + active: true + OptionalAbstractKeyword: + active: true + OptionalUnit: + active: false + OptionalWhenBraces: + active: false + PreferToOverPairSyntax: + active: false + ProtectedMemberInFinalClass: + active: false + RedundantVisibilityModifierRule: + active: false + ReturnCount: + active: true + max: 2 + excludedFunctions: "equals" + SafeCast: + active: true + SerialVersionUIDInSerializableClass: + active: false + SpacingBetweenPackageAndImports: + active: false + ThrowsCount: + active: true + max: 2 + TrailingWhitespace: + active: false + UnnecessaryAbstractClass: + active: false + UnnecessaryInheritance: + active: false + UnnecessaryParentheses: + active: false + UntilInsteadOfRangeTo: + active: false + UnusedImports: + active: false + UnusedPrivateMember: + active: false + allowedNames: "(_|ignored|expected)" + UseDataClass: + active: false + excludeAnnotatedClasses: "" + UtilityClassWithPublicConstructor: + active: false + VarCouldBeVal: + active: false + WildcardImport: + active: true + excludeImports: 'java.util.*,kotlinx.android.synthetic.*' diff --git a/gradle/kotlin.gradle b/gradle/kotlin.gradle index 01ae102e..ab84ae13 100644 --- a/gradle/kotlin.gradle +++ b/gradle/kotlin.gradle @@ -1,10 +1 @@ -apply plugin: 'org.jmailen.kotlinter' - -kotlinter { - ignoreFailures = true - indentSize = 4 - continuationIndentSize = 4 - reporters = ['checkstyle', 'plain'] -} - kotlin { experimental { coroutines 'enable' } } diff --git a/gradle/properties.gradle b/gradle/properties.gradle index bf7c2557..03663a88 100644 --- a/gradle/properties.gradle +++ b/gradle/properties.gradle @@ -16,4 +16,5 @@ ext { junitJupiterVersion = '5.1.0' mockkVersion = '1.7.15' assertkVersion = '0.9' + detektVersion = '1.0.0.RC8' } \ No newline at end of file diff --git a/gradle/quality-gate.gradle b/gradle/quality-gate.gradle deleted file mode 100644 index 28a2ddf7..00000000 --- a/gradle/quality-gate.gradle +++ /dev/null @@ -1,72 +0,0 @@ -apply plugin: 'jacoco' - -def testedProjects() { - subprojects.findAll { subproject -> subproject.plugins.hasPlugin('java') || subproject.plugins.hasPlugin('kotlin') } -} - -gradle.projectsEvaluated { - configure(testedProjects()) { - apply plugin: 'jacoco' - - jacoco { - toolVersion = '0.8.1' - } - - jacocoTestReport { - sourceDirectories = files(sourceSets.main.allSource.srcDirs) - classDirectories = files(sourceSets.main.output) - } - - test { - reports { - junitXml.enabled = true - html.enabled = false - } - - jacoco { - append = false - destinationFile = file("$buildDir/jacoco/jacocoTest.exec") - classDumpDir = file("$buildDir/jacoco/classpathdumps") - } - - } - } - - task jacocoTestReport(type: JacocoReport) { - def tests = [] - def sourceDirs = files() - def classDirs = files() - def execData = files() - - reports { - xml.enabled = true - html.enabled = false - } - - testedProjects().each { subproject -> - sourceDirs += files(subproject.sourceSets.main.allSource.srcDirs) - classDirs += files(subproject.sourceSets.main.output) - execData += files(subproject.tasks.jacocoTestReport.executionData.findAll { - it.exists() - }) - - tests += subproject.tasks.test - } - - dependsOn tests - sourceDirectories = sourceDirs - classDirectories = classDirs - executionData = execData - } - - sonarqube { - properties { - property "sonar.organization", "apollo-rsps" - property "sonar.projectKey", "apollo:org.apollo" - property "sonar.projectName", "Apollo RSPS" - property "sonar.kotlin.file.suffixes", ".kt,.kts" - } - } - - project.tasks["sonarqube"].dependsOn(jacocoTestReport) -} \ No newline at end of file diff --git a/gradle/testing.gradle b/gradle/testing.gradle new file mode 100644 index 00000000..6e462b7b --- /dev/null +++ b/gradle/testing.gradle @@ -0,0 +1,51 @@ +apply plugin: 'jacoco' + +def jacocoCoverageAggregate = "$buildDir/jacoco/jacocoTestAll.exec" + +def testedProjects() { + subprojects.findAll { subproject -> subproject.plugins.hasPlugin('java') || subproject.plugins.hasPlugin('kotlin') } +} + +configure(testedProjects()) { + + jacoco { + toolVersion = '0.8.1' + } + + jacocoTestReport { + sourceDirectories = files(sourceSets.main.allSource.srcDirs) + classDirectories = files(sourceSets.main.output) + } + + test { + reports { + junitXml.enabled = true + html.enabled = false + } + + jacoco { + append = false + destinationFile = file("$buildDir/jacoco/jacocoTest.exec") + classDumpDir = file("$buildDir/jacoco/classpathdumps") + } + + } +} + +task jacocoMerge(type: JacocoMerge) { + destinationFile = file(jacocoCoverageAggregate) + executionData = project.fileTree(dir: '.', include: '**/build/jacoco/test.exec') +} + +sonarqube { + properties { + property "sonar.organization", "apollo-rsps" + property "sonar.projectKey", "apollo:org.apollo" + property "sonar.projectName", "Apollo RSPS" + property "sonar.kotlin.file.suffixes", ".kt,.kts" + property "sonar.jacoco.reportPaths", jacocoCoverageAggregate + } +} + +tasks["sonarqube"].dependsOn(jacocoMerge) + diff --git a/buildSrc/settings.gradle b/gradle/wrapper/code-quality.gradle similarity index 100% rename from buildSrc/settings.gradle rename to gradle/wrapper/code-quality.gradle diff --git a/net/build.gradle b/net/build.gradle index adfcb303..939c6ff4 100644 --- a/net/build.gradle +++ b/net/build.gradle @@ -10,5 +10,9 @@ dependencies { implementation group: 'com.google.guava', name: 'guava', version: guavaVersion implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: bouncycastleVersion - testImplementation group: 'junit', name: 'junit', version: junitVersion + test.useJUnitPlatform() + testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitJupiterVersion + testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitJupiterVersion + testImplementation group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVintageVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: junitPlatformVersion } diff --git a/util/build.gradle b/util/build.gradle index 6f0a0d96..99694627 100644 --- a/util/build.gradle +++ b/util/build.gradle @@ -9,7 +9,11 @@ dependencies { implementation group: 'com.google.guava', name: 'guava', version: guavaVersion implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: bouncycastleVersion - testImplementation group: 'junit', name: 'junit', version: junitVersion + test.useJUnitPlatform() + testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitJupiterVersion + testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitJupiterVersion + testImplementation group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVintageVersion + testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: junitPlatformVersion } task(genRsa, dependsOn: classes, type: JavaExec) {