diff --git a/.gitignore b/.gitignore index 5d53c7178..5e4b71362 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ temporaryTestFolder/ Plan.iml PlanPluginBridge.iml .sonar/ +builds/ *.db diff --git a/Plan/build.gradle b/Plan/build.gradle index f4082f1ca..a8cb652d7 100644 --- a/Plan/build.gradle +++ b/Plan/build.gradle @@ -1,27 +1,30 @@ plugins { id "java" - id "com.github.johnrengelman.shadow" version "2.0.4" + id "net.ltgt.apt" version "0.19" + id "com.github.johnrengelman.shadow" version "4.0.2" } allprojects { wrapper.gradleVersion = "5.0" group "com.djrapitops" - version "4.5.0-SNAPSHOT" + version "4.6.0-SNAPSHOT" } subprojects { apply plugin: "java" apply plugin: "maven" + apply plugin: "net.ltgt.apt" apply plugin: "com.github.johnrengelman.shadow" sourceCompatibility = 1.8 targetCompatibility = 1.8 - ext.daggerVersion = "2.9" + ext.daggerVersion = "2.19" + ext.daggerCompilerVersion = "2.19" ext.abstractPluginFrameworkVersion = "3.4.0" - ext.planPluginBridgeVersion = "4.5.1" + ext.planPluginBridgeVersion = "4.6.0" ext.bukkitVersion = "1.12.2-R0.1-SNAPSHOT" ext.spigotVersion = "1.12.2-R0.1-SNAPSHOT" ext.paperVersion = "1.12.2-R0.1-SNAPSHOT" @@ -42,43 +45,62 @@ subprojects { repositories { mavenCentral() - maven { + maven { // Spigot Repository url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" } - maven { + maven { // Paper Repository url = "https://papermc.io/repo/repository/maven-public/" } - maven { + maven { // Sponge Repository url = "https://repo.spongepowered.org/maven" } - maven { + maven { // BungeeCord Repository url = "https://oss.sonatype.org/content/repositories/snapshots" } - maven { + maven { // RedisBungee Repository url = "http://repo.md-5.net/content/repositories/snapshots/" } - maven { + maven { // Velocity Repository url = "https://repo.velocitypowered.com/snapshots/" } - maven { + maven { // bStats Repository url = "http://repo.bstats.org/content/repositories/releases/" } - maven { + maven { // PlanPluginBridge Repository url = "https://dl.bintray.com/rsl1122/Plan-repository" } } dependencies { + // Dependency Injection used accross the project compile "com.google.dagger:dagger:$daggerVersion" + annotationProcessor "com.google.dagger:dagger-compiler:$daggerCompilerVersion" + testAnnotationProcessor "com.google.dagger:dagger-compiler:$daggerCompilerVersion" - annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion" + // Test Tooling Dependencies + testCompile "org.junit.jupiter:junit-jupiter-engine:5.3.2" // JUnit 5 + testCompile "org.junit.platform:junit-platform-runner:1.3.2" // JUnit 4 runner for JUnit 5 tests + testCompile "org.junit.vintage:junit-vintage-engine:5.3.2" // JUnit 4 compatibility for JUnit 5 + testCompile "org.junit.jupiter:junit-jupiter-params:5.3.2" // JUnit 5, parameterized tests + testCompile "org.junit-pioneer:junit-pioneer:0.3.0" // TempDirectory, TODO DEPENDENCY TO BE REMOVED ON JUNIT 5.4 RELEASE + testCompile "org.mockito:mockito-core:2.23.4" // Mockito Core + testCompile "org.mockito:mockito-junit-jupiter:2.23.4" // Mockito JUnit 5 Extension + testCompile "org.seleniumhq.selenium:selenium-java:3.14.0" // Selenium (Browser tests) + testCompile "com.jayway.awaitility:awaitility:1.7.0" // Awaitility (Concurrent wait conditions) + + // Testing dependencies required by Plan + testCompile "org.xerial:sqlite-jdbc:3.25.2" // SQLite + } - // Dependencies for tests - testCompile "org.mockito:mockito-core:2.23.4" - testCompile "org.xerial:sqlite-jdbc:3.25.2" - testCompile "junit:junit:4.12" - testCompile "org.hamcrest:hamcrest-core:1.3" - testCompile "org.seleniumhq.selenium:selenium-java:3.14.0" - testCompile "com.jayway.awaitility:awaitility:1.7.0" + // Test classes available to other modules + configurations { + testArtifacts.extendsFrom testRuntime + } + task testJar(type: Jar) { + classifier "test" + from sourceSets.test.output + } + artifacts { + testArtifacts testJar } } \ No newline at end of file diff --git a/Plan/bukkit/build.gradle b/Plan/bukkit/build.gradle index 67ba0b156..309ecfe66 100644 --- a/Plan/bukkit/build.gradle +++ b/Plan/bukkit/build.gradle @@ -3,15 +3,15 @@ dependencies { compile "com.djrapitops:AbstractPluginFramework-bukkit:$abstractPluginFrameworkVersion" compile "org.bstats:bstats-bukkit:$bstatsVersion" + compileOnly "com.destroystokyo.paper:paper-api:$paperVersion" + compileOnly "org.spigotmc:spigot-api:$spigotVersion" compileOnly "org.bukkit:bukkit:$bukkitVersion" - compileOnly "org.spigotmc:spigot-api:$spigotVersion" - compileOnly "com.destroystokyo.paper:paper-api:$paperVersion" - testCompile "org.bukkit:bukkit:$bukkitVersion" + testCompile "com.destroystokyo.paper:paper-api:$paperVersion" testCompile "org.spigotmc:spigot-api:$spigotVersion" - testCompile "com.destroystokyo.paper:paper-api:$paperVersion" + testCompile "org.bukkit:bukkit:$bukkitVersion" - testCompile project(":common") + testCompile project(path: ":common", configuration: 'testArtifacts') } shadowJar { diff --git a/Plan/bungeecord/build.gradle b/Plan/bungeecord/build.gradle index 0d0c8a2f6..4ac64fce5 100644 --- a/Plan/bungeecord/build.gradle +++ b/Plan/bungeecord/build.gradle @@ -2,11 +2,14 @@ dependencies { compile project(":common") compile "com.djrapitops:AbstractPluginFramework-bungeecord:$abstractPluginFrameworkVersion" - compile "net.md-5:bungeecord-api:$bungeeVersion" - compile "com.imaginarycode.minecraft:RedisBungee:$redisBungeeVersion" compile "org.bstats:bstats-bungeecord:$bstatsVersion" - testCompile project(":common") + compileOnly "net.md-5:bungeecord-api:$bungeeVersion" + compileOnly "com.imaginarycode.minecraft:RedisBungee:$redisBungeeVersion" + testCompile "net.md-5:bungeecord-api:$bungeeVersion" + testCompile "com.imaginarycode.minecraft:RedisBungee:$redisBungeeVersion" + + testCompile project(path: ":common", configuration: 'testArtifacts') } shadowJar { diff --git a/Plan/common/build.gradle b/Plan/common/build.gradle index fb0952c56..78b963ef1 100644 --- a/Plan/common/build.gradle +++ b/Plan/common/build.gradle @@ -20,7 +20,7 @@ dependencies { } shadowJar { - relocate 'org.apache', 'plan.org.apache', { + relocate ('org.apache', 'plan.org.apache') { exclude 'org/apache/logging/**' } diff --git a/Plan/common/src/test/java/utilities/dagger/PluginSuperClassBindingModule.java b/Plan/common/src/test/java/utilities/dagger/PluginSuperClassBindingModule.java index 6605992bc..6d872acc2 100644 --- a/Plan/common/src/test/java/utilities/dagger/PluginSuperClassBindingModule.java +++ b/Plan/common/src/test/java/utilities/dagger/PluginSuperClassBindingModule.java @@ -16,6 +16,7 @@ */ package utilities.dagger; +import com.djrapitops.plan.PlanPlugin; import com.djrapitops.plan.api.exceptions.EnableException; import com.djrapitops.plan.system.database.DBSystem; import com.djrapitops.plan.system.database.databases.sql.H2DB; @@ -87,6 +88,10 @@ public class PluginSuperClassBindingModule { @Override protected void unregisterListeners() { } + + @Override + public void callEnableEvent(PlanPlugin plugin) { + } }; } diff --git a/Plan/plugin/build.gradle b/Plan/plugin/build.gradle index db7ebba53..1be49ff2f 100644 --- a/Plan/plugin/build.gradle +++ b/Plan/plugin/build.gradle @@ -5,11 +5,11 @@ dependencies { compile project(":bungeecord") compile project(":velocity") - testCompile project(":common") - testCompile project(":bukkit") - testCompile project(":sponge") - testCompile project(":bungeecord") - testCompile project(":velocity") + testCompile project(path: ":common", configuration: 'testArtifacts') + testCompile project(path: ":bukkit", configuration: 'testArtifacts') + testCompile project(path: ":sponge", configuration: 'testArtifacts') + testCompile project(path: ":bungeecord", configuration: 'testArtifacts') + testCompile project(path: ":velocity", configuration: 'testArtifacts') } shadowJar { diff --git a/Plan/sponge/build.gradle b/Plan/sponge/build.gradle index 7a3086cd1..650869229 100644 --- a/Plan/sponge/build.gradle +++ b/Plan/sponge/build.gradle @@ -4,11 +4,11 @@ dependencies { compile "org.bstats:bstats-sponge:$bstatsVersion" compileOnly "org.spongepowered:spongeapi:$spongeVersion" + testCompile "org.spongepowered:spongeapi:$spongeVersion" annotationProcessor "org.spongepowered:spongeapi:$spongeVersion" - annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion" - testCompile project(":common") + testCompile project(path: ":common", configuration: 'testArtifacts') } shadowJar { diff --git a/Plan/velocity/build.gradle b/Plan/velocity/build.gradle index 08abe9dbd..70abf1ee3 100644 --- a/Plan/velocity/build.gradle +++ b/Plan/velocity/build.gradle @@ -1,9 +1,11 @@ dependencies { compile project(":common") compile "com.djrapitops:AbstractPluginFramework-velocity:$abstractPluginFrameworkVersion" - compile "com.velocitypowered:velocity-api:$velocityVersion" + + compileOnly "com.velocitypowered:velocity-api:$velocityVersion" + testCompile "com.velocitypowered:velocity-api:$velocityVersion" annotationProcessor "com.velocitypowered:velocity-api:$velocityVersion" - testCompile project(":common") + testCompile project(path: ":common", configuration: 'testArtifacts') } \ No newline at end of file