mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-12-19 16:28:13 +01:00
Don't publish extra modules (#772)
This commit is contained in:
parent
8a675923d1
commit
6058763489
@ -1,34 +1,8 @@
|
|||||||
import org.gradle.api.JavaVersion
|
import org.gradle.api.JavaVersion
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.plugins.JavaPluginExtension
|
import org.gradle.api.plugins.JavaPluginExtension
|
||||||
import org.gradle.api.publish.PublishingExtension
|
|
||||||
import org.gradle.api.publish.maven.MavenPublication
|
|
||||||
import org.gradle.kotlin.dsl.configure
|
|
||||||
import org.gradle.kotlin.dsl.get
|
|
||||||
import org.gradle.kotlin.dsl.named
|
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
|
|
||||||
fun Project.publishShadowJar() {
|
|
||||||
configurePublication {
|
|
||||||
artifact(tasks["shadowJar"])
|
|
||||||
artifact(tasks["sourcesJar"])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Project.publishJavaComponents() {
|
|
||||||
configurePublication {
|
|
||||||
from(components["java"])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun Project.configurePublication(configurer: MavenPublication.() -> Unit) {
|
|
||||||
extensions.configure<PublishingExtension> {
|
|
||||||
publications.named<MavenPublication>("mavenJava") {
|
|
||||||
apply(configurer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Project.latestCommitHash(): String {
|
fun Project.latestCommitHash(): String {
|
||||||
val byteOut = ByteArrayOutputStream()
|
val byteOut = ByteArrayOutputStream()
|
||||||
exec {
|
exec {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
`java-library`
|
`java-library`
|
||||||
`maven-publish`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@ -23,20 +22,4 @@ tasks {
|
|||||||
java {
|
java {
|
||||||
javaTarget(17)
|
javaTarget(17)
|
||||||
withSourcesJar()
|
withSourcesJar()
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications.create<MavenPublication>("mavenJava") {
|
|
||||||
groupId = rootProject.group as String
|
|
||||||
artifactId = project.name
|
|
||||||
version = rootProject.version as String
|
|
||||||
}
|
|
||||||
repositories.maven {
|
|
||||||
name = "Via"
|
|
||||||
url = uri("https://repo.viaversion.com/")
|
|
||||||
credentials(PasswordCredentials::class)
|
|
||||||
authentication {
|
|
||||||
create<BasicAuthentication>("basic")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -4,6 +4,7 @@ import org.gradle.kotlin.dsl.named
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("vb.base-conventions")
|
id("vb.base-conventions")
|
||||||
|
id("maven-publish")
|
||||||
id("com.github.johnrengelman.shadow")
|
id("com.github.johnrengelman.shadow")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,7 +22,24 @@ tasks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
publishShadowJar()
|
publishing {
|
||||||
|
publications.create<MavenPublication>("mavenJava") {
|
||||||
|
groupId = rootProject.group as String
|
||||||
|
artifactId = project.name
|
||||||
|
version = rootProject.version as String
|
||||||
|
|
||||||
|
artifact(tasks["shadowJar"])
|
||||||
|
artifact(tasks["sourcesJar"])
|
||||||
|
}
|
||||||
|
repositories.maven {
|
||||||
|
name = "Via"
|
||||||
|
url = uri("https://repo.viaversion.com/")
|
||||||
|
credentials(PasswordCredentials::class)
|
||||||
|
authentication {
|
||||||
|
create<BasicAuthentication>("basic")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun ShadowJar.configureRelocations() {
|
fun ShadowJar.configureRelocations() {
|
||||||
relocate("com.google.gson", "com.viaversion.viaversion.libs.gson")
|
relocate("com.google.gson", "com.viaversion.viaversion.libs.gson")
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id("vb.base-conventions")
|
|
||||||
}
|
|
||||||
|
|
||||||
publishJavaComponents()
|
|
@ -20,6 +20,6 @@ val main = setOf(
|
|||||||
subprojects {
|
subprojects {
|
||||||
when (this) {
|
when (this) {
|
||||||
in main -> plugins.apply("vb.shadow-conventions")
|
in main -> plugins.apply("vb.shadow-conventions")
|
||||||
else -> plugins.apply("vb.standard-conventions")
|
else -> plugins.apply("vb.base-conventions")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user