Relocate kotlin, update OkHTTP, exclude dependencies in bulk

This commit is contained in:
Vankka 2023-07-11 19:50:19 +03:00
parent d4f41c589d
commit 9897f7029d
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0
5 changed files with 52 additions and 27 deletions

View File

@ -8,13 +8,6 @@ dependencies {
// JDA
api(libs.jda) {
// Annotations are suppose to be compile time only
exclude group: 'org.jetbrains', module: 'annotations'
exclude group: 'com.google.code.findbugs', module: 'jsr305'
// Downgrade okhttp (due to kotlin)
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
// We don't use audio
exclude module: 'opus-java'
}

View File

@ -26,6 +26,17 @@ subprojects {
}
configurations {
// Exclude dependencies from being included in jars
runtimeExclude {
// Annotations are suppose to be compile time only
exclude group: 'org.jetbrains', module: 'annotations'
exclude group: 'com.google.code.findbugs', module: 'jsr305'
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
}
runtimeClasspath.extendsFrom runtimeExclude
runtimeDownloadOnly.extendsFrom runtimeExclude
// Create runtimeDownloadApi configuration (compileOnlyApi + runtimeDownloadOnly)
runtimeDownloadApi
compileOnlyApi.extendsFrom runtimeDownloadApi
runtimeDownloadOnly.extendsFrom runtimeDownloadApi

View File

@ -16,6 +16,9 @@
'okhttp3',
'okio',
// Kotlin
'kotlin',
// DependencyDownload
'dev.vankka.dependencydownload',
'dev.vankka.mcdependencydownload',

View File

@ -1,12 +1,27 @@
import dev.vankka.dependencydownload.task.GenerateDependencyDownloadResourceTask
configurations {
hikari
h2Driver
mysqlDriver
mariadbDriver
mcAuthLib
compileOnly.extendsFrom hikari, h2Driver, mysqlDriver, mariadbDriver, mcAuthLib
// Dependencies to exclude from runtime downloaded jars
runtimeDownloadExclude {
extendsFrom runtimeExclude
}
hikariOnly
hikari.extendsFrom hikariOnly, runtimeDownloadExclude
h2DriverOnly
h2Driver.extendsFrom h2DriverOnly, runtimeDownloadExclude
mysqlDriverOnly
mysqlDriver.extendsFrom mysqlDriverOnly, runtimeDownloadExclude
mariadbDriverOnly
mariadbDriver.extendsFrom mariadbDriverOnly, runtimeDownloadExclude
mcAuthLibOnly
mcAuthLib.extendsFrom mcAuthLibOnly, runtimeDownloadExclude
compileOnly.extendsFrom hikariOnly, h2DriverOnly, mysqlDriverOnly, mariadbDriverOnly, mcAuthLibOnly
testRuntimeOnly.extendsFrom runtimeDownloadOnly
}
@ -53,12 +68,13 @@ dependencies {
runtimeDownloadApi(libs.commons.io)
// Caffeine
runtimeDownloadApi(libs.caffeine) {
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
}
runtimeDownloadApi(libs.caffeine)
// DynamicProxy
runtimeDownloadApi(libs.dynamicproxy)
runtimeDownloadApi(libs.dynamicproxy) {
// Not needed at runtime
exclude module: 'javaparser-symbol-solver-core'
}
// Jackson (transitive in :api)
compileOnlyApi(libs.jackson.databind)
@ -79,15 +95,18 @@ dependencies {
runtimeDownloadApi(libs.enhancedlegacytext)
// Database
hikari(libs.hikaricp)
h2Driver(libs.h2)
mysqlDriver(libs.mysql)
mariadbDriver(libs.mariadb)
hikariOnly(libs.hikaricp) {
// Already provided
exclude group: 'org.slf4j'
}
h2DriverOnly(libs.h2)
mysqlDriverOnly(libs.mysql)
mariadbDriverOnly(libs.mariadb)
// MinecraftAuthentication library
mcAuthLib(libs.minecraftauth.lib) {
mcAuthLibOnly(libs.minecraftauth.lib) {
// JUnit is a testing library
exclude group: 'junit', module: 'junit'
exclude group: 'org.jetbrains', module: 'annotations'
}
// Brigadier

View File

@ -57,10 +57,9 @@ dependencyResolutionManagement {
// JDA
library('jda', 'net.dv8tion', 'JDA').version('5.0.0-beta.10.webhooks_2')
library('okhttp', 'com.squareup.okhttp3', 'okhttp').version {
prefer '3.14.9'
reject '[4,)' // Kotlin
}
// OkHTTP
library('okhttp', 'com.squareup.okhttp3', 'okhttp').version('4.11.0')
// Apache commons
library('commons-lang', 'org.apache.commons', 'commons-lang3').version('3.12.0')