Ascension/api/build.gradle

71 lines
1.7 KiB
Groovy
Raw Normal View History

2021-07-29 03:14:29 +02:00
apply from: rootProject.file('buildscript/relocations.gradle')
apply plugin: 'maven-publish'
2021-07-29 03:14:29 +02:00
dependencies {
// Annotations
2022-04-22 19:56:11 +02:00
compileOnlyApi(libs.jetbrains.annotations)
compileOnlyApi(libs.findbugs.annotations)
2021-07-29 03:14:29 +02:00
// JDA
2022-04-22 19:56:11 +02:00
api(libs.jda) {
2021-07-29 03:14:29 +02:00
// Annotations are suppose to be compile time only
exclude group: 'org.jetbrains', module: 'annotations'
exclude group: 'com.google.code.findbugs', module: 'jsr305'
2021-07-29 03:14:29 +02:00
2022-04-25 14:47:24 +02:00
// Downgrade okhttp (due to kotlin)
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
2021-07-29 03:14:29 +02:00
// We don't use audio
exclude module: 'opus-java'
}
2022-04-25 14:47:24 +02:00
api(libs.okhttp)
2021-07-29 03:14:29 +02:00
}
// Relocations are in buildscript/api.gradle
sourceSets {
ap {
java {
compileClasspath += sourceSets.main.compileClasspath + sourceSets.main.output
}
}
}
java {
withSourcesJar()
withJavadocJar()
}
// Fix template source set not being depended on/other tasks not depending on template source set
sourcesJar { dependsOn compileTemplateJava }
2021-07-29 03:14:29 +02:00
jar {
from sourceSets.ap.output
}
license {
// Overwrite the default
header = rootProject.file('buildscript/license/API_LICENSE_HEADER')
}
publishing {
publications {
maven(MavenPublication) {
// Shaded & relocated jar...
artifact source: shadowJar, classifier: null
artifact sourcesJar
artifact javadocJar
// ...and a pom with no dependencies
pom {
licenses {
license {
name = 'The MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
}
}
}
}