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