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"
|
2020-06-01 08:03:50 +02:00
|
|
|
id "org.sonarqube" version "3.0"
|
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-06-16 07:31:27 +02:00
|
|
|
id "com.github.johnrengelman.shadow" version "6.0.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"
|
2020-03-20 09:41:22 +01:00
|
|
|
version "5.1-SNAPSHOT"
|
2019-12-07 19:12:45 +01:00
|
|
|
|
|
|
|
ext.majorVersion = '5'
|
2020-03-20 09:41:22 +01:00
|
|
|
ext.minorVersion = '1'
|
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
|
|
|
|
2020-06-23 07:38:10 +02:00
|
|
|
ext.daggerVersion = "2.28.1"
|
2020-06-23 07:45:55 +02:00
|
|
|
ext.daggerCompilerVersion = "2.28.1"
|
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"
|
|
|
|
ext.paperVersion = "1.13.2-R0.1-SNAPSHOT"
|
2018-12-18 20:13:05 +01:00
|
|
|
ext.spongeVersion = "7.1.0"
|
2019-12-08 09:26:24 +01:00
|
|
|
ext.nukkitVersion = "1.0-SNAPSHOT"
|
2020-06-25 07:35:41 +02:00
|
|
|
ext.bungeeVersion = "1.16-R0.1"
|
2018-12-18 20:13:05 +01:00
|
|
|
ext.velocityVersion = "1.0-SNAPSHOT"
|
|
|
|
ext.redisBungeeVersion = "0.3.8-SNAPSHOT"
|
2019-01-08 12:25:23 +01:00
|
|
|
|
2020-03-09 06:45:03 +01:00
|
|
|
ext.httpClientVersion = "4.5.12"
|
2019-09-03 07:19:11 +02:00
|
|
|
ext.commonsTextVersion = "1.8"
|
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"
|
2020-04-27 07:57:55 +02:00
|
|
|
ext.mysqlVersion = "8.0.20"
|
2020-05-11 07:52:57 +02:00
|
|
|
ext.hikariVersion = "3.4.5"
|
2019-12-17 08:07:01 +01:00
|
|
|
ext.slf4jVersion = "1.7.30"
|
2020-06-16 07:31:03 +02:00
|
|
|
ext.geoIpVersion = "2.14.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"
|
2019-04-30 18:12:41 +02:00
|
|
|
ext.bstatsVersion = "1.4"
|
2019-09-29 12:00:55 +02:00
|
|
|
ext.placeholderapiVersion = "2.9.2"
|
2020-04-23 09:35:15 +02:00
|
|
|
ext.nkPlaceholderapiVersion = "1.3-SNAPSHOT"
|
2018-12-18 20:13:05 +01:00
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
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
|
2018-12-18 20:13:05 +01:00
|
|
|
url = "https://repo.spongepowered.org/maven"
|
|
|
|
}
|
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-05-01 07:52:12 +02:00
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
|
2020-05-01 07:44:24 +02:00
|
|
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.6.2" // JUnit 5
|
2020-05-01 07:36:49 +02:00
|
|
|
testCompile "org.junit.jupiter:junit-jupiter-params:5.6.2" // JUnit 5, parameterized tests
|
2020-03-14 11:43:40 +01:00
|
|
|
testCompile "org.mockito:mockito-core:3.3.3" // Mockito Core
|
2020-03-14 11:51:16 +01:00
|
|
|
testCompile "org.mockito:mockito-junit-jupiter:3.3.3" // 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
|
2020-06-22 07:59:58 +02:00
|
|
|
testCompile "org.xerial:sqlite-jdbc:3.32.3" // 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-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
|
|
|
}
|