update viaversion, 0.2.11, try to make maven work

This commit is contained in:
creeper123123321 2020-09-14 19:58:08 -03:00
parent 3a39c4cf7f
commit 9b1051b6d6

View File

@ -6,6 +6,7 @@ plugins {
id("fabric-loom") version "0.4-SNAPSHOT" id("fabric-loom") version "0.4-SNAPSHOT"
id("com.palantir.git-version") version "0.12.0-rc2" id("com.palantir.git-version") version "0.12.0-rc2"
id("com.matthewprenger.cursegradle") version "1.4.0" id("com.matthewprenger.cursegradle") version "1.4.0"
id("maven-publish")
} }
group = "com.github.creeper123123321.viafabric" group = "com.github.creeper123123321.viafabric"
@ -19,7 +20,7 @@ val branch = if (!travisBranch.isNullOrBlank()) travisBranch else try {
"unknown" "unknown"
} }
version = "0.2.10-SNAPSHOT+" + try { version = "0.2.11-SNAPSHOT+" + try {
gitVersion() + "-" + branch gitVersion() + "-" + branch
} catch (e: Exception) { } catch (e: Exception) {
"unknown" "unknown"
@ -58,8 +59,8 @@ tasks.named<ProcessResources>("processResources") {
dependencies { dependencies {
// transitive = false because Guava is conflicting on runClient // transitive = false because Guava is conflicting on runClient
implementation("us.myles:viaversion:3.1.0") { isTransitive = false } implementation("us.myles:viaversion:3.1.1") { isTransitive = false }
include("us.myles:viaversion:3.1.0") include("us.myles:viaversion:3.1.1")
include("org.yaml:snakeyaml:1.26") include("org.yaml:snakeyaml:1.26")
// Use 1.16 snapshot, probably intermediary will make it work on further versions // Use 1.16 snapshot, probably intermediary will make it work on further versions
@ -108,6 +109,7 @@ curseforge {
addGameVersion("1.16") addGameVersion("1.16")
addGameVersion("1.16.1") addGameVersion("1.16.1")
addGameVersion("1.16.2") addGameVersion("1.16.2")
addGameVersion("1.16.3")
} }
} }
addGameVersion("Fabric") addGameVersion("Fabric")
@ -138,3 +140,38 @@ minecraft {
license { license {
include("**/*.java") include("**/*.java")
} }
tasks.jar {
from("LICENSE")
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
tasks.register("sourcesJar", type = Jar::class) {
dependsOn(tasks.getByName("classes"))
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
// configure the maven publication
publishing {
publications {
create<MavenPublication>("maven") {
// add all the jars that should be included when publishing to maven
artifact(tasks.getByName("remapJar")) {
builtBy(tasks.getByName("remapJar"))
}
artifact(tasks.getByName("sourcesJar")) {
builtBy(tasks.getByName("remapSourcesJar"))
}
}
}
// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}