mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-01 08:39:31 +01:00
140 lines
4.0 KiB
Groovy
140 lines
4.0 KiB
Groovy
plugins {
|
|
alias(libs.plugins.shadow) apply false
|
|
alias(libs.plugins.licenser) apply false
|
|
alias(libs.plugins.blossom) apply false
|
|
alias(libs.plugins.indra.git) apply false
|
|
alias(libs.plugins.dependencydownload.plugin) apply false
|
|
}
|
|
|
|
version '2.0.0-SNAPSHOT'
|
|
|
|
allprojects {
|
|
apply plugin: 'java'
|
|
apply plugin: 'java-library'
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
apply plugin: 'org.cadixdev.licenser'
|
|
apply plugin: 'net.kyori.indra.git'
|
|
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
|
|
|
|
all {
|
|
resolutionStrategy.failOnDynamicVersions()
|
|
}
|
|
}
|
|
|
|
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()
|
|
|
|
maven {
|
|
url 'https://nexus.scarsz.me/content/groups/public/'
|
|
content {
|
|
includeGroup 'github.scarsz'
|
|
includeGroup 'me.scarsz'
|
|
}
|
|
}
|
|
maven {
|
|
url 'https://libraries.minecraft.net'
|
|
content {
|
|
includeGroup 'com.mojang'
|
|
}
|
|
}
|
|
|
|
// Get dependencies from central last, everything else should be filtered
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
// Test dependencies
|
|
testImplementation(libs.jupiter.api)
|
|
testRuntimeOnly(libs.jupiter.engine)
|
|
}
|
|
|
|
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
|
|
|
|
manifest.attributes(
|
|
'Specification-Title': 'DiscordSRV',
|
|
'Specification-Vendor': 'DiscordSRV',
|
|
'Specification-Version': project.version
|
|
)
|
|
if (project.name != "api") {
|
|
manifest.attributes(
|
|
'Implementation-Title': 'DiscordSRV',
|
|
'Implementation-Vendor': 'DiscordSRV',
|
|
'Implementation-Version': project.version
|
|
)
|
|
}
|
|
if (indraGit.isPresent()) {
|
|
indraGit.applyVcsInformationToManifest(manifest)
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|