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.Project
|
||||
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
|
||||
|
||||
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 {
|
||||
val byteOut = ByteArrayOutputStream()
|
||||
exec {
|
||||
|
@ -1,6 +1,5 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
tasks {
|
||||
@ -24,19 +23,3 @@ java {
|
||||
javaTarget(17)
|
||||
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 {
|
||||
id("vb.base-conventions")
|
||||
id("maven-publish")
|
||||
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() {
|
||||
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 {
|
||||
when (this) {
|
||||
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