Skip to content

Commit

Permalink
Move publishing to a convention plugin, publish fabric too (Noxcrew#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucyydotp authored Aug 11, 2023
1 parent 0a9c961 commit 6f0c621
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 23 deletions.
28 changes: 5 additions & 23 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
plugins {
id("java-library")
id("maven-publish")
id("noxesium.publishing")
}

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}

repositories {
Expand All @@ -10,25 +14,3 @@ repositories {
dependencies {
implementation("org.jetbrains:annotations:24.0.0")
}

publishing {
repositories {
maven {
name = "noxcrew-public"
url = uri("https://maven.noxcrew.com/public")
credentials {
username = System.getenv("NOXCREW_MAVEN_PUBLIC_USERNAME")
password = System.getenv("NOXCREW_MAVEN_PUBLIC_PASSWORD")
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
publications {
create<MavenPublication>("maven") {
version = "${property("mod_version")}"
from(components["java"])
}
}
}
7 changes: 7 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
}
25 changes: 25 additions & 0 deletions buildSrc/src/main/kotlin/noxesium.publishing.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
plugins {
`maven-publish`
}

publishing {
repositories {
maven {
name = "noxcrew-public"
url = uri("https://maven.noxcrew.com/public")
credentials {
username = System.getenv("NOXCREW_MAVEN_PUBLIC_USERNAME")
password = System.getenv("NOXCREW_MAVEN_PUBLIC_PASSWORD")
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
publications {
create<MavenPublication>("maven") {
version = "${property("mod_version")}"
from(components["java"])
}
}
}
1 change: 1 addition & 0 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("fabric-loom") version "1.3-SNAPSHOT"
id("noxesium.publishing")
}

repositories {
Expand Down

0 comments on commit 6f0c621

Please sign in to comment.