2019-08-05 09:24:50 +02:00
|
|
|
// Aggregate Javadocs
|
|
|
|
buildscript {
|
2021-03-15 17:26:57 +01:00
|
|
|
repositories { mavenCentral() }
|
2019-08-05 09:24:50 +02:00
|
|
|
dependencies {
|
2021-04-22 07:23:48 +02:00
|
|
|
classpath 'com.netflix.nebula:gradle-aggregate-javadocs-plugin:3.0.+'
|
2019-08-05 09:24:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-18 20:13:05 +01:00
|
|
|
plugins {
|
2021-10-07 16:16:12 +02:00
|
|
|
id "com.github.johnrengelman.shadow" version "7.1.0" apply false
|
2021-10-27 17:43:14 +02:00
|
|
|
// id "io.github.slimjar" version "1.3.0" apply false
|
2018-12-18 20:13:05 +01:00
|
|
|
id "java"
|
2018-12-19 18:24:33 +01:00
|
|
|
id "jacoco"
|
2019-01-03 11:52:01 +01:00
|
|
|
id "checkstyle"
|
2021-06-11 07:15:15 +02:00
|
|
|
id "org.sonarqube" version "3.3"
|
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 {
|
|
|
|
|
|
|
|
group "com.djrapitops"
|
2021-06-12 09:21:38 +02:00
|
|
|
version "5.4-SNAPSHOT"
|
2019-12-07 19:12:45 +01:00
|
|
|
|
|
|
|
ext.majorVersion = '5'
|
2021-06-12 09:21:38 +02:00
|
|
|
ext.minorVersion = '4'
|
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
|
|
|
}
|
|
|
|
|
2021-06-12 07:24:24 +02:00
|
|
|
logger.lifecycle("Building artifact for version $fullVersion")
|
2020-01-13 21:40:04 +01:00
|
|
|
|
2018-12-18 20:13:05 +01:00
|
|
|
subprojects {
|
2019-01-08 12:25:23 +01:00
|
|
|
// Build plugins
|
2021-06-12 07:24:24 +02:00
|
|
|
apply plugin: "com.github.johnrengelman.shadow"
|
2021-10-27 17:43:14 +02:00
|
|
|
// apply plugin: "io.github.slimjar"
|
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
|
|
|
|
|
|
|
// 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
|
|
|
|
2021-07-23 15:49:34 +02:00
|
|
|
compileJava {
|
|
|
|
options.release = 8
|
|
|
|
}
|
2018-12-18 20:13:05 +01:00
|
|
|
|
2021-06-12 07:24:24 +02:00
|
|
|
ext {
|
2021-10-04 14:50:51 +02:00
|
|
|
daggerVersion = "2.39.1"
|
2021-10-04 14:50:11 +02:00
|
|
|
daggerCompilerVersion = "2.39.1"
|
2021-06-12 07:24:24 +02:00
|
|
|
|
2021-06-12 09:21:38 +02:00
|
|
|
palVersion = "5.0.0"
|
2021-06-12 07:24:24 +02:00
|
|
|
|
|
|
|
bukkitVersion = "1.13.2-R0.1-SNAPSHOT"
|
|
|
|
spigotVersion = "1.13.2-R0.1-SNAPSHOT"
|
2021-06-12 09:21:38 +02:00
|
|
|
paperVersion = "1.13.2-R0.1-SNAPSHOT"
|
2021-06-12 07:24:24 +02:00
|
|
|
spongeVersion = "7.3.0"
|
|
|
|
nukkitVersion = "1.0-SNAPSHOT"
|
|
|
|
bungeeVersion = "1.16-R0.4"
|
2021-06-29 22:29:59 +02:00
|
|
|
velocityVersion = "3.0.0-SNAPSHOT"
|
2021-07-18 09:43:38 +02:00
|
|
|
redisBungeeVersion = "0.3.8-SNAPSHOT"
|
2021-06-12 07:24:24 +02:00
|
|
|
|
|
|
|
commonsTextVersion = "1.9"
|
2021-07-13 07:04:20 +02:00
|
|
|
commonsCompressVersion = "1.21"
|
2021-07-07 06:39:44 +02:00
|
|
|
caffeineVersion = "2.9.2"
|
2021-10-27 17:44:07 +02:00
|
|
|
mysqlVersion = "8.0.27"
|
2021-08-31 06:12:48 +02:00
|
|
|
sqliteVersion = "3.36.0.3"
|
2021-06-12 07:24:24 +02:00
|
|
|
hikariVersion = "4.0.3"
|
2021-07-21 08:38:13 +02:00
|
|
|
slf4jVersion = "1.7.32"
|
2021-06-12 07:24:24 +02:00
|
|
|
geoIpVersion = "2.15.0"
|
2021-08-23 06:29:36 +02:00
|
|
|
gsonVersion = "2.8.8"
|
2021-06-12 07:24:24 +02:00
|
|
|
bstatsVersion = "2.2.1"
|
2021-07-10 11:09:34 +02:00
|
|
|
placeholderapiVersion = "2.10.10"
|
2021-06-12 07:24:24 +02:00
|
|
|
nkPlaceholderapiVersion = "1.4-SNAPSHOT"
|
|
|
|
}
|
2018-12-18 20:13:05 +01:00
|
|
|
|
|
|
|
repositories {
|
2021-03-05 13:27:30 +01:00
|
|
|
mavenCentral()
|
2021-07-23 15:49:34 +02:00
|
|
|
google()
|
2021-06-12 07:24:24 +02:00
|
|
|
maven { url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" } // Spigot
|
|
|
|
maven { url = "https://papermc.io/repo/repository/maven-public/" } // Paper
|
|
|
|
maven { url = "https://repo.spongepowered.org/repository/maven-public/" } // Sponge
|
|
|
|
maven { url = "https://oss.sonatype.org/content/repositories/snapshots" } // BungeeCord
|
|
|
|
maven { url = "https://repo.md-5.net/content/repositories/snapshots/" } // RedisBungee
|
|
|
|
maven { url = "https://repo.velocitypowered.com/snapshots/" } // Velocity
|
|
|
|
maven { url = "https://repo.playeranalytics.net/releases" } // Plan
|
2018-12-18 20:13:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2019-01-08 12:25:23 +01:00
|
|
|
// Dependency Injection used across the project
|
2021-10-27 17:43:14 +02:00
|
|
|
// implementation "io.github.slimjar:slimjar:1.2.6" // Runtime dependency injection
|
2021-06-12 07:24:24 +02:00
|
|
|
implementation "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
|
2021-09-23 20:34:53 +02:00
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' // JUnit 5
|
2021-08-26 15:04:59 +02:00
|
|
|
testImplementation "org.mockito:mockito-core:3.12.4" // Mockito Core
|
2021-10-27 17:44:41 +02:00
|
|
|
testImplementation "org.mockito:mockito-junit-jupiter:4.0.0" // Mockito JUnit 5 Extension
|
2021-10-13 17:06:09 +02:00
|
|
|
testImplementation "org.seleniumhq.selenium:selenium-java:4.0.0" // Selenium (Browser tests)
|
2021-06-12 07:24:24 +02:00
|
|
|
testImplementation "com.jayway.awaitility:awaitility:1.7.0" // Awaitility (Concurrent wait conditions)
|
2019-01-08 12:25:23 +01:00
|
|
|
|
|
|
|
// Testing dependencies required by Plan
|
2021-06-12 09:21:38 +02:00
|
|
|
testImplementation "org.xerial:sqlite-jdbc:$sqliteVersion" // SQLite
|
2021-06-12 07:24:24 +02:00
|
|
|
testImplementation "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 {
|
2021-06-12 07:24:24 +02:00
|
|
|
testArtifacts.extendsFrom testRuntimeOnly
|
2018-12-18 22:06:47 +01:00
|
|
|
}
|
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) {
|
2021-06-12 07:24:24 +02:00
|
|
|
archiveClassifier.set("test")
|
2018-12-18 22:06:47 +01:00
|
|
|
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 {
|
2021-07-24 13:10:48 +02:00
|
|
|
toolVersion "8.44"
|
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 {
|
2021-07-23 15:49:34 +02:00
|
|
|
xml.required = 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
|
|
|
}
|