From fd3933df2598a2a6066714436c5a2f78931d03dd Mon Sep 17 00:00:00 2001 From: tueem Date: Wed, 13 Nov 2024 10:22:25 +0100 Subject: [PATCH] add publications --- build.gradle.kts | 50 ++++++++++++++++++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 0 settings.gradle.kts | 6 ++- 4 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 build.gradle.kts mode change 100644 => 100755 gradlew diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..ef41a19 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,50 @@ +import java.io.ByteArrayOutputStream + +plugins { + `maven-publish` +} + +allprojects { + group = "net.tomatentum.Marinara" + version = "1.0.0-RC1" + (if (!project.hasProperty("release")) ("-" + getGitHash()) else "") + description = "A simple but powerful, library-agnostic Discord Interaction Wrapper." +} + +subprojects { + apply(plugin = "maven-publish") + apply(plugin = "java-library") + + plugins.withType { + publishing { + publications { + create("maven") { + from(components["java"]) + } + } + + repositories { + maven { + name = "Gitea" + url = uri("https://git.tomatentum.net/api/packages/tueem/maven/") + + credentials(HttpHeaderCredentials::class) { + name = "Authorization" + value = "token " + System.getenv("GITEA_TOKEN") + } + authentication { + create("header") + } + } + } + } + } +} + +fun getGitHash(): String { + val output = ByteArrayOutputStream() + project.exec { + commandLine("git", "rev-parse", "--short", "HEAD") + standardOutput = output + } + return output.toString().trim() +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..94113f2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/settings.gradle.kts b/settings.gradle.kts index 7ccb161..06c8680 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -11,5 +11,7 @@ plugins { } rootProject.name = "Marinara" -include("lib") -include("wrapper:javacord") +include(":lib") +include(":wrapper-javacord") + +project(":wrapper-javacord").projectDir = file("wrapper/javacord")