2019-08-05 09:24:50 +02:00
|
|
|
// Aggregate Javadocs
|
|
|
|
buildscript {
|
|
|
|
repositories { jcenter() }
|
|
|
|
dependencies {
|
|
|
|
classpath 'com.netflix.nebula:gradle-aggregate-javadocs-plugin:2.2.+'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-18 20:13:05 +01:00
|
|
|
plugins {
|
|
|
|
id "java"
|
2018-12-19 18:24:33 +01:00
|
|
|
id "jacoco"
|
2019-01-03 11:52:01 +01:00
|
|
|
id "checkstyle"
|
2021-01-26 06:20:43 +01:00
|
|
|
id "org.sonarqube" version "3.1.1"
|
2019-05-01 10:16:51 +02:00
|
|
|
id "net.ltgt.apt" version "0.21"
|
2019-05-01 09:58:35 +02:00
|
|
|
id "net.ltgt.apt-idea" version "0.21"
|
2020-10-07 07:18:02 +02:00
|
|
|
id "com.github.johnrengelman.shadow" version "6.1.0"
|
2018-12-18 20:13:05 +01:00
|
|
|
}
|
|
|
|
|
2019-08-05 09:24:50 +02:00
|
|
|
apply plugin: 'nebula-aggregate-javadocs'
|
|
|
|
|
2019-12-08 10:30:53 +01:00
|
|
|
def determineBuildVersion = {
|
|
|
|
def buildInfo = new ByteArrayOutputStream()
|
|
|
|
exec {
|
|
|
|
commandLine 'git', 'rev-list', '--count', 'HEAD'
|
|
|
|
standardOutput = buildInfo
|
|
|
|
}
|
|
|
|
// Magic number: git rev-list --count cdb13e3b663b18e3938ad5efc60d165fa9301f6e
|
|
|
|
return Integer.parseInt(buildInfo.toString().replaceAll("[^0-9]", "")) - 3529
|
|
|
|
}
|
|
|
|
def buildVersion = determineBuildVersion()
|
|
|
|
|
2018-12-18 20:13:05 +01:00
|
|
|
allprojects {
|
2020-03-10 21:56:44 +01:00
|
|
|
wrapper.gradleVersion = "6.2.1"
|
2018-12-18 20:13:05 +01:00
|
|
|
|
|
|
|
group "com.djrapitops"
|
2021-01-01 09:24:10 +01:00
|
|
|
version "5.2-SNAPSHOT"
|
2019-12-07 19:12:45 +01:00
|
|
|
|
|
|
|
ext.majorVersion = '5'
|
2021-01-01 09:24:10 +01:00
|
|
|
ext.minorVersion = '2'
|
2019-12-08 10:30:53 +01:00
|
|
|
ext.buildVersion = buildVersion
|
|
|
|
ext.fullVersion = project.ext.majorVersion + '.' + project.ext.minorVersion + ' build ' + project.ext.buildVersion
|
2018-12-26 20:44:59 +01:00
|
|
|
|
2019-01-12 12:00:30 +01:00
|
|
|
// Fix for UTF-8 files showing with wrong encoding when compiled on Windows machines.
|
2020-01-24 11:22:41 +01:00
|
|
|
compileJava { options.encoding = "UTF-8" }
|
|
|
|
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
|
|
|
|
javadoc { options.encoding = 'UTF-8' }
|
2018-12-18 20:13:05 +01:00
|
|
|
}
|
|
|
|
|
2020-01-13 21:40:04 +01:00
|
|
|
println "Building artifact for version $fullVersion"
|
|
|
|
|
2018-12-18 20:13:05 +01:00
|
|
|
subprojects {
|
2019-01-08 12:25:23 +01:00
|
|
|
// Build plugins
|
2018-12-18 20:13:05 +01:00
|
|
|
apply plugin: "java"
|
2019-02-02 09:42:29 +01:00
|
|
|
apply plugin: "maven-publish"
|
2019-01-08 12:25:23 +01:00
|
|
|
apply plugin: "net.ltgt.apt" // Annotation processing plugin
|
|
|
|
apply plugin: "net.ltgt.apt-idea" // Annotation processing IntelliJ IDEA configuration plugin
|
2018-12-18 20:13:05 +01:00
|
|
|
apply plugin: "com.github.johnrengelman.shadow"
|
2019-01-08 12:25:23 +01:00
|
|
|
|
|
|
|
// Report plugins
|
2019-01-03 11:52:01 +01:00
|
|
|
apply plugin: "checkstyle"
|
2018-12-19 18:24:33 +01:00
|
|
|
apply plugin: "jacoco"
|
2018-12-18 20:13:05 +01:00
|
|
|
|
2020-03-10 21:56:44 +01:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
2018-12-18 20:13:05 +01:00
|
|
|
|
2021-01-22 06:29:25 +01:00
|
|
|
ext.daggerVersion = "2.31.2"
|
2021-01-22 06:20:46 +01:00
|
|
|
ext.daggerCompilerVersion = "2.31.2"
|
2018-12-18 20:13:05 +01:00
|
|
|
|
2019-08-08 10:42:33 +02:00
|
|
|
ext.abstractPluginFrameworkVersion = "3.4.2"
|
2019-01-08 12:25:23 +01:00
|
|
|
|
2019-08-09 08:42:33 +02:00
|
|
|
ext.bukkitVersion = "1.13.2-R0.1-SNAPSHOT"
|
|
|
|
ext.spigotVersion = "1.13.2-R0.1-SNAPSHOT"
|
2021-01-20 15:49:18 +01:00
|
|
|
ext.paperVersion = "1.16.5-R0.1-SNAPSHOT"
|
2020-10-06 14:29:03 +02:00
|
|
|
ext.spongeVersion = "7.3.0"
|
2019-12-08 09:26:24 +01:00
|
|
|
ext.nukkitVersion = "1.0-SNAPSHOT"
|
2021-01-15 06:19:25 +01:00
|
|
|
ext.bungeeVersion = "1.16-R0.4"
|
2020-09-06 10:30:15 +02:00
|
|
|
ext.velocityVersion = "1.0.0-SNAPSHOT"
|
2021-01-22 06:21:21 +01:00
|
|
|
ext.redisBungeeVersion = "0.6-SNAPSHOT"
|
2019-01-08 12:25:23 +01:00
|
|
|
|
2020-10-07 07:17:45 +02:00
|
|
|
ext.httpClientVersion = "4.5.13"
|
2020-07-27 07:50:36 +02:00
|
|
|
ext.commonsTextVersion = "1.9"
|
2020-02-10 06:30:28 +01:00
|
|
|
ext.commonsCompressVersion = "1.20"
|
2018-12-18 20:13:05 +01:00
|
|
|
ext.htmlCompressorVersion = "1.5.2"
|
2019-08-07 07:34:39 +02:00
|
|
|
ext.caffeineVersion = "2.8.0"
|
2019-04-30 10:07:52 +02:00
|
|
|
ext.h2Version = "1.4.199"
|
2021-01-18 06:38:04 +01:00
|
|
|
ext.mysqlVersion = "8.0.23"
|
2021-01-01 09:22:50 +01:00
|
|
|
ext.sqliteVersion = "3.34.0"
|
2021-01-26 06:19:09 +01:00
|
|
|
ext.hikariVersion = "4.0.1"
|
2019-12-17 08:07:01 +01:00
|
|
|
ext.slf4jVersion = "1.7.30"
|
2020-10-15 07:17:06 +02:00
|
|
|
ext.geoIpVersion = "2.15.0"
|
2019-10-07 07:54:18 +02:00
|
|
|
ext.gsonVersion = "2.8.6"
|
2019-06-12 10:03:54 +02:00
|
|
|
ext.guavaVersion = "28.0-jre"
|
2021-01-25 11:09:36 +01:00
|
|
|
ext.bstatsVersion = "2.1.0"
|
2021-01-20 06:51:32 +01:00
|
|
|
ext.placeholderapiVersion = "2.10.9"
|
2020-04-23 09:35:15 +02:00
|
|
|
ext.nkPlaceholderapiVersion = "1.3-SNAPSHOT"
|
2018-12-18 20:13:05 +01:00
|
|
|
|
|
|
|
repositories {
|
2021-01-20 09:00:07 +01:00
|
|
|
jcenter()
|
2018-12-18 22:06:47 +01:00
|
|
|
maven { // Spigot Repository
|
2018-12-18 20:13:05 +01:00
|
|
|
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
|
|
|
|
}
|
2018-12-18 22:06:47 +01:00
|
|
|
maven { // Paper Repository
|
2018-12-18 20:13:05 +01:00
|
|
|
url = "https://papermc.io/repo/repository/maven-public/"
|
|
|
|
}
|
2018-12-18 22:06:47 +01:00
|
|
|
maven { // Sponge Repository
|
2021-02-01 07:18:19 +01:00
|
|
|
url = "https://repo.spongepowered.org/repository/maven-public/"
|
2018-12-18 20:13:05 +01:00
|
|
|
}
|
2018-12-18 22:06:47 +01:00
|
|
|
maven { // BungeeCord Repository
|
2018-12-18 20:13:05 +01:00
|
|
|
url = "https://oss.sonatype.org/content/repositories/snapshots"
|
|
|
|
}
|
2018-12-18 22:06:47 +01:00
|
|
|
maven { // RedisBungee Repository
|
2020-01-10 11:29:55 +01:00
|
|
|
url = "https://repo.md-5.net/content/repositories/snapshots/"
|
2018-12-18 20:13:05 +01:00
|
|
|
}
|
2018-12-18 22:06:47 +01:00
|
|
|
maven { // Velocity Repository
|
2018-12-18 20:13:05 +01:00
|
|
|
url = "https://repo.velocitypowered.com/snapshots/"
|
|
|
|
}
|
2019-12-08 10:30:53 +01:00
|
|
|
maven { // Nukkit Repository
|
2020-01-10 11:29:55 +01:00
|
|
|
url = "https://repo.nukkitx.com/main"
|
2019-12-08 10:30:53 +01:00
|
|
|
}
|
2018-12-18 22:06:47 +01:00
|
|
|
maven { // bStats Repository
|
2019-04-30 18:12:41 +02:00
|
|
|
url = "https://repo.codemc.org/repository/maven-public"
|
2018-12-18 20:13:05 +01:00
|
|
|
}
|
2019-08-28 17:32:44 +02:00
|
|
|
maven { // Plan Repository
|
2018-12-18 20:13:05 +01:00
|
|
|
url = "https://dl.bintray.com/rsl1122/Plan-repository"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2019-01-08 12:25:23 +01:00
|
|
|
// Dependency Injection used across the project
|
2018-12-18 20:13:05 +01:00
|
|
|
compile "com.google.dagger:dagger:$daggerVersion"
|
2018-12-18 22:06:47 +01:00
|
|
|
annotationProcessor "com.google.dagger:dagger-compiler:$daggerCompilerVersion"
|
|
|
|
testAnnotationProcessor "com.google.dagger:dagger-compiler:$daggerCompilerVersion"
|
2018-12-18 20:13:05 +01:00
|
|
|
|
2018-12-18 22:06:47 +01:00
|
|
|
// Test Tooling Dependencies
|
2020-09-21 13:26:18 +02:00
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
|
2021-02-05 06:20:36 +01:00
|
|
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.1" // JUnit 5
|
2020-09-21 13:18:25 +02:00
|
|
|
testCompile "org.junit.jupiter:junit-jupiter-params:5.7.0" // JUnit 5, parameterized tests
|
2021-01-18 06:38:24 +01:00
|
|
|
testCompile "org.mockito:mockito-core:3.7.7" // Mockito Core
|
2021-01-22 06:18:40 +01:00
|
|
|
testCompile "org.mockito:mockito-junit-jupiter:3.7.7" // Mockito JUnit 5 Extension
|
2019-01-08 12:25:23 +01:00
|
|
|
testCompile "org.seleniumhq.selenium:selenium-java:3.141.59" // Selenium (Browser tests)
|
|
|
|
testCompile "com.jayway.awaitility:awaitility:1.7.0" // Awaitility (Concurrent wait conditions)
|
|
|
|
|
|
|
|
// Testing dependencies required by Plan
|
2021-01-01 09:22:50 +01:00
|
|
|
testCompile "org.xerial:sqlite-jdbc:$sqliteVersion" // SQLite
|
2019-07-08 11:16:06 +02:00
|
|
|
testCompile "mysql:mysql-connector-java:$mysqlVersion" // MySQL
|
2018-12-18 22:06:47 +01:00
|
|
|
}
|
2019-08-08 20:01:48 +02:00
|
|
|
|
2018-12-18 22:06:47 +01:00
|
|
|
configurations {
|
|
|
|
testArtifacts.extendsFrom testRuntime
|
|
|
|
}
|
2018-12-19 18:08:07 +01:00
|
|
|
// Test classes available to other modules
|
2018-12-18 22:06:47 +01:00
|
|
|
task testJar(type: Jar) {
|
|
|
|
classifier "test"
|
|
|
|
from sourceSets.test.output
|
|
|
|
}
|
|
|
|
artifacts {
|
|
|
|
testArtifacts testJar
|
2018-12-18 20:13:05 +01:00
|
|
|
}
|
2019-01-04 16:44:59 +01:00
|
|
|
|
2020-03-10 21:56:44 +01:00
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
testLogging {
|
|
|
|
events "passed", "failed", "skipped"
|
|
|
|
exceptionFormat "full"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-04 16:44:59 +01:00
|
|
|
checkstyle {
|
2020-06-20 20:51:12 +02:00
|
|
|
toolVersion "8.33"
|
2020-03-10 21:56:44 +01:00
|
|
|
getConfigDirectory().set file("$rootProject.projectDir/config/checkstyle")
|
2019-01-04 16:44:59 +01:00
|
|
|
}
|
2019-08-08 20:01:48 +02:00
|
|
|
|
|
|
|
jacocoTestReport {
|
|
|
|
reports {
|
|
|
|
xml.enabled true
|
2019-12-17 09:00:38 +01:00
|
|
|
// xml.destination file("${buildDir}/jacoco/report.xml")
|
2019-08-08 20:01:48 +02:00
|
|
|
}
|
|
|
|
}
|
2020-05-30 09:27:56 +02:00
|
|
|
|
|
|
|
plugins.withType(JacocoPlugin) {
|
|
|
|
tasks["test"].finalizedBy 'jacocoTestReport'
|
|
|
|
}
|
2018-12-19 18:24:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
sonarqube {
|
|
|
|
properties {
|
2018-12-19 18:29:43 +01:00
|
|
|
property "sonar.projectName", "Player Analytics"
|
|
|
|
property "sonar.projectKey", "com.djrapitops:Plan"
|
2020-05-30 09:27:56 +02:00
|
|
|
property "sonar.coverage.jacoco.xmlReportPaths", "**/build/report/jacoco/test/jacocoTestReport.xml"
|
2018-12-19 18:24:33 +01:00
|
|
|
}
|
2020-01-10 11:29:55 +01:00
|
|
|
}
|