Ascension/build.gradle

138 lines
4.0 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
2022-03-20 12:46:06 +01:00
id 'org.cadixdev.licenser' version '0.6.1' apply false
2021-07-29 03:14:29 +02:00
id 'net.kyori.blossom' version '1.2.0' apply false
2022-03-27 18:48:09 +02:00
id 'net.kyori.indra.git' version '2.1.1' apply false
2022-01-17 15:54:12 +01:00
id 'dev.vankka.dependencydownload.plugin' version '1.1.5-SNAPSHOT' apply false
2021-07-29 03:14:29 +02:00
}
version '2.0.0-SNAPSHOT'
ext {
// DependencyDownload (change plugin version above)
2022-02-19 21:47:39 +01:00
ddVersion = '1.2.2-SNAPSHOT'
2021-07-29 03:14:29 +02:00
// 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
2022-03-20 12:46:06 +01:00
adventureVersion = '4.10.0'
adventurePlatformVersion = '4.1.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'
2022-03-27 18:48:09 +02:00
apply plugin: 'net.kyori.indra.git'
2021-07-29 03:14:29 +02:00
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/' }
2021-07-29 03:14:29 +02:00
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
//mavenLocal()
2021-07-29 03:14:29 +02:00
maven {
url 'https://nexus.scarsz.me/content/groups/public/'
content {
includeGroup 'github.scarsz'
includeGroup 'me.scarsz'
}
}
2022-03-20 12:46:06 +01:00
maven {
url 'https://libraries.minecraft.net'
content {
includeGroup 'com.mojang'
}
}
2021-07-29 03:14:29 +02:00
// Get dependencies from central last, everything else should be filtered
2021-07-29 03:14:29 +02:00
mavenCentral()
}
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
2022-03-27 18:48:09 +02:00
if (indraGit.isPresent()) {
indraGit.applyVcsInformationToManifest(manifest)
}
2021-07-29 03:14:29 +02:00
}
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'
2022-01-13 18:05:36 +01:00
var currentYear = String.valueOf(Calendar.getInstance().get(Calendar.YEAR))
2021-07-29 03:14:29 +02:00
year = inception == currentYear ? currentYear : inception + '-' + currentYear
}
include '**/*.java' // only java files
}
}