diff --git a/build.gradle b/build.gradle index f0b8d25..dac0f75 100644 --- a/build.gradle +++ b/build.gradle @@ -1,17 +1,24 @@ plugins { id 'java' + id 'maven-publish' + id 'com.github.johnrengelman.shadow' version '8.0.0' } group = 'com.hypherionmc.nightbloom' version = '1.0.0' +configurations { + shadeMe + implementation.extendsFrom shadeMe +} + repositories { mavenCentral() } dependencies { - implementation("com.google.code.gson:gson:2.10.1") - implementation("com.squareup.okhttp3:okhttp:4.12.0") + shadeMe("com.google.code.gson:gson:2.10.1") + shadeMe("com.squareup.okhttp3:okhttp:4.12.0") compileOnly("org.projectlombok:lombok:1.18.30") annotationProcessor("org.projectlombok:lombok:1.18.30") @@ -25,4 +32,30 @@ dependencies { test { useJUnitPlatform() +} + +shadowJar { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + configurations = [project.configurations.shadeMe] + archiveClassifier.set(null) +} + +jar.finalizedBy(shadowJar) + +publishing { + publications { + mavenJava(MavenPublication) { + artifact shadowJar + } + } + + repositories { + maven { + url System.getenv('MAVEN_URL') + credentials { + username System.getenv('MAVEN_USER') + password System.getenv('MAVEN_PASS') + } + } + } } \ No newline at end of file