Ascension/build.gradle

119 lines
3.4 KiB
Groovy
Raw Normal View History

2021-07-29 03:14:29 +02:00
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.1' apply false
2021-07-29 03:14:29 +02:00
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'
2021-07-29 03:14:29 +02:00
// Configurate
configurateVersion = '4.1.2'
2021-07-29 03:14:29 +02:00
// Adventure & Adventure Platform
adventureVersion = '4.9.1'
adventurePlatformVersion = '4.0.0'
2021-07-29 03:14:29 +02:00
}
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
2021-10-19 22:17:30 +02:00
runtimeDownloadOnly.extendsFrom runtimeDownloadApi
2021-07-29 03:14:29 +02:00
}
generateRuntimeDownloadResourceForRuntimeDownloadOnly {
file = 'dependencies/runtimeDownload-' + project.name + '.txt'
2021-07-29 03:14:29 +02:00
}
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'
2021-07-29 03:14:29 +02:00
}
test {
useJUnitPlatform()
}
task deleteJarsDir(type: Delete) {
delete rootProject.file('jars')
}
clean.dependsOn deleteJarsDir
defaultTasks 'build'
2021-07-29 03:14:29 +02:00
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 {
2021-10-19 22:17:30 +02:00
// Merge META-INF/services files where needed
mergeServiceFiles()
2021-07-29 03:14:29 +02:00
// 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
2021-10-19 22:17:30 +02:00
options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
2021-07-29 03:14:29 +02:00
}
}
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)-1)
2021-07-29 03:14:29 +02:00
year = inception == currentYear ? currentYear : inception + '-' + currentYear
}
include '**/*.java' // only java files
}
}