mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-24 19:15:32 +01:00
Don't publish extra modules (#3901)
This commit is contained in:
parent
8a826b88fb
commit
3f72e9ea47
@ -34,5 +34,3 @@ dependencies {
|
||||
java {
|
||||
withJavadocJar()
|
||||
}
|
||||
|
||||
publishShadowJar()
|
||||
|
@ -1,34 +1,8 @@
|
||||
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.jvm.toolchain.JavaLanguageVersion
|
||||
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 {
|
||||
return runGitCommand(listOf("rev-parse", "--short", "HEAD"))
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
tasks {
|
||||
@ -27,19 +26,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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ import org.gradle.jvm.tasks.Jar
|
||||
|
||||
plugins {
|
||||
id("via.base-conventions")
|
||||
id("maven-publish")
|
||||
id("com.github.johnrengelman.shadow")
|
||||
}
|
||||
|
||||
@ -21,6 +22,25 @@ tasks {
|
||||
}
|
||||
}
|
||||
|
||||
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")
|
||||
relocate("it.unimi.dsi.fastutil", "com.viaversion.viaversion.libs.fastutil")
|
||||
|
@ -1,5 +0,0 @@
|
||||
plugins {
|
||||
id("via.base-conventions")
|
||||
}
|
||||
|
||||
publishJavaComponents()
|
@ -18,12 +18,9 @@ val main = setOf(
|
||||
projects.viaversionFabric
|
||||
).map { it.dependencyProject }
|
||||
|
||||
// val special = setOf().map { it.dependencyProject }
|
||||
|
||||
subprojects {
|
||||
when (this) {
|
||||
in main -> plugins.apply("via.shadow-conventions")
|
||||
// in special -> plugins.apply("via.base-conventions")
|
||||
else -> plugins.apply("via.standard-conventions")
|
||||
else -> plugins.apply("via.base-conventions")
|
||||
}
|
||||
}
|
||||
|
@ -7,5 +7,3 @@ dependencies {
|
||||
exclude("javax.persistence", "persistence-api")
|
||||
}
|
||||
}
|
||||
|
||||
publishShadowJar()
|
||||
|
@ -20,5 +20,3 @@ java {
|
||||
tasks.named<Jar>("sourcesJar") {
|
||||
from(project(":viaversion-api").sourceSets.main.get().allSource)
|
||||
}
|
||||
|
||||
publishShadowJar()
|
@ -30,8 +30,6 @@ tasks {
|
||||
}
|
||||
}
|
||||
|
||||
publishShadowJar()
|
||||
|
||||
val branch = rootProject.branchName()
|
||||
val baseVersion = project.version as String
|
||||
val isRelease = !baseVersion.contains('-')
|
||||
|
@ -6,5 +6,3 @@ dependencies {
|
||||
}
|
||||
annotationProcessor(libs.velocity)
|
||||
}
|
||||
|
||||
publishShadowJar()
|
||||
|
Loading…
Reference in New Issue
Block a user