mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-10-31 08:32:18 +01:00
119 lines
3.4 KiB
Groovy
119 lines
3.4 KiB
Groovy
plugins {
|
|
id 'com.github.johnrengelman.shadow' version '7.1.1' apply false
|
|
id 'org.cadixdev.licenser' version '0.6.0' apply false
|
|
id 'net.kyori.blossom' version '1.2.0' apply false
|
|
id 'dev.vankka.dependencydownload.plugin' version '1.0.3-SNAPSHOT' apply false
|
|
}
|
|
|
|
version '2.0.0-SNAPSHOT'
|
|
|
|
ext {
|
|
// DependencyDownload (change plugin version above)
|
|
ddVersion = '1.0.3-SNAPSHOT'
|
|
// MinecraftDependencyDownload
|
|
mddVersion = '1.0.0-SNAPSHOT'
|
|
// JDA
|
|
jdaVersion = '5.0.0-alpha.2'
|
|
// Configurate
|
|
configurateVersion = '4.1.2'
|
|
// Adventure & Adventure Platform
|
|
adventureVersion = '4.9.1'
|
|
adventurePlatformVersion = '4.0.0'
|
|
}
|
|
|
|
allprojects {
|
|
apply plugin: 'java'
|
|
apply plugin: 'java-library'
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
apply plugin: 'org.cadixdev.licenser'
|
|
apply plugin: 'dev.vankka.dependencydownload.plugin'
|
|
|
|
group 'com.discordsrv'
|
|
version = rootProject.version
|
|
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
configurations {
|
|
runtimeDownloadApi
|
|
compileOnlyApi.extendsFrom runtimeDownloadApi
|
|
runtimeDownloadOnly.extendsFrom runtimeDownloadApi
|
|
}
|
|
|
|
generateRuntimeDownloadResourceForRuntimeDownloadOnly {
|
|
file = 'dependencies/runtimeDownload-' + project.name + '.txt'
|
|
}
|
|
|
|
repositories {
|
|
// Snapshot repositories
|
|
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
|
|
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
|
|
|
|
mavenLocal()
|
|
|
|
mavenCentral()
|
|
maven { url 'https://nexus.scarsz.me/content/groups/public/' }
|
|
}
|
|
|
|
dependencies {
|
|
// Test dependencies
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
|
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
task deleteJarsDir(type: Delete) {
|
|
delete rootProject.file('jars')
|
|
}
|
|
clean.dependsOn deleteJarsDir
|
|
|
|
defaultTasks 'build'
|
|
jar {
|
|
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
|
|
|
// If CI then check that licenses are correct, otherwise automatically apply licenses on build
|
|
dependsOn (System.getenv('CI') === 'true' ? licenseCheck : licenseFormat)
|
|
// Always run shadowJar
|
|
finalizedBy shadowJar
|
|
}
|
|
|
|
shadowJar {
|
|
// Merge META-INF/services files where needed
|
|
mergeServiceFiles()
|
|
|
|
// Exclude signatures, maven/ and proguard/ from META-INF
|
|
exclude 'META-INF/*.SF'
|
|
exclude 'META-INF/*.DSA'
|
|
exclude 'META-INF/*.RSA'
|
|
exclude 'META-INF/maven/**'
|
|
exclude 'META-INF/proguard/**'
|
|
}
|
|
|
|
gradle.projectsEvaluated {
|
|
tasks.withType(JavaCompile) {
|
|
// Enable compiler warnings for unchecked & deprecation
|
|
options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
}
|
|
|
|
license {
|
|
header = rootProject.file('buildscript/license/LICENSE_HEADER')
|
|
properties {
|
|
var inception = '2016'
|
|
var currentYear = String.valueOf(Calendar.getInstance().get(Calendar.YEAR))
|
|
|
|
year = inception == currentYear ? currentYear : inception + '-' + currentYear
|
|
}
|
|
include '**/*.java' // only java files
|
|
}
|
|
}
|