2023-02-19 23:17:33 +01:00
|
|
|
plugins {
|
2024-08-08 01:30:24 +02:00
|
|
|
id "fabric-loom" version "1.7-SNAPSHOT"
|
2023-06-01 16:13:57 +02:00
|
|
|
id "maven-publish"
|
2023-02-19 23:17:33 +01:00
|
|
|
}
|
|
|
|
|
2023-10-24 03:24:58 +02:00
|
|
|
base {
|
|
|
|
group = project.maven_group
|
2024-08-05 17:26:18 +02:00
|
|
|
archivesName = project.maven_name
|
|
|
|
version = project.maven_version
|
|
|
|
description = project.maven_description
|
2023-10-24 03:24:58 +02:00
|
|
|
}
|
2023-02-19 23:17:33 +01:00
|
|
|
|
2023-02-21 04:24:49 +01:00
|
|
|
configurations {
|
2023-11-25 22:30:16 +01:00
|
|
|
jij // jar in jar configuration
|
2023-12-09 14:24:39 +01:00
|
|
|
modJij // jar in jar configuration for mods
|
|
|
|
|
|
|
|
include.extendsFrom modJij
|
|
|
|
modImplementation.extendsFrom modJij
|
|
|
|
modCompileOnlyApi.extendsFrom modJij
|
2023-02-21 04:24:49 +01:00
|
|
|
}
|
|
|
|
|
2023-10-24 03:24:58 +02:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven {
|
|
|
|
name = "ViaVersion"
|
|
|
|
url = "https://repo.viaversion.com"
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = "Lenni0451"
|
|
|
|
url = "https://maven.lenni0451.net/everything"
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
name = "OpenCollab Snapshots"
|
|
|
|
url = "https://repo.opencollab.dev/maven-snapshots/"
|
2023-02-19 23:17:33 +01:00
|
|
|
}
|
2024-06-21 13:26:14 +02:00
|
|
|
maven {
|
|
|
|
name = "TerraformersMC"
|
|
|
|
url = "https://maven.terraformersmc.com/releases"
|
|
|
|
}
|
2024-09-05 00:51:04 +02:00
|
|
|
maven {
|
|
|
|
name = "Jitpack"
|
|
|
|
url = "https://jitpack.io"
|
|
|
|
|
|
|
|
content {
|
|
|
|
includeGroup "com.github.Oryxel"
|
|
|
|
}
|
|
|
|
}
|
2023-02-19 23:17:33 +01:00
|
|
|
}
|
|
|
|
|
2023-02-20 01:04:09 +01:00
|
|
|
loom {
|
|
|
|
accessWidenerPath = file("src/main/resources/viafabricplus.accesswidener")
|
|
|
|
}
|
|
|
|
|
2023-02-19 23:17:33 +01:00
|
|
|
dependencies {
|
|
|
|
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
2024-08-05 17:26:18 +02:00
|
|
|
mappings "net.fabricmc:yarn:${project.yarn_version}:v2"
|
2023-02-19 23:17:33 +01:00
|
|
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
|
|
|
|
2023-12-09 14:24:39 +01:00
|
|
|
modJij(fabricApi.module("fabric-api-base", project.fabric_api_version))
|
|
|
|
modJij(fabricApi.module("fabric-resource-loader-v0", project.fabric_api_version))
|
|
|
|
modJij(fabricApi.module("fabric-networking-api-v1", project.fabric_api_version))
|
|
|
|
modJij(fabricApi.module("fabric-command-api-v2", project.fabric_api_version))
|
|
|
|
modJij(fabricApi.module("fabric-lifecycle-events-v1", project.fabric_api_version))
|
2024-01-02 01:28:22 +01:00
|
|
|
modJij(fabricApi.module("fabric-particles-v1", project.fabric_api_version))
|
|
|
|
modJij(fabricApi.module("fabric-registry-sync-v0", project.fabric_api_version))
|
2023-12-09 14:24:39 +01:00
|
|
|
|
2024-10-14 17:09:30 +02:00
|
|
|
modCompileOnly "com.terraformersmc:modmenu:11.0.3"
|
2024-08-05 17:00:14 +02:00
|
|
|
|
2024-11-01 19:53:42 +01:00
|
|
|
jij "com.viaversion:viaversion-common:5.1.1"
|
|
|
|
jij "com.viaversion:viabackwards-common:5.1.1"
|
2024-11-01 20:10:41 +01:00
|
|
|
jij "net.raphimc:viaaprilfools-common:3.0.5-SNAPSHOT"
|
|
|
|
jij "net.raphimc:ViaLegacy:3.0.6-SNAPSHOT"
|
|
|
|
jij ("net.raphimc:ViaBedrock:0.0.13-SNAPSHOT") {
|
2023-11-06 16:43:43 +01:00
|
|
|
exclude group: "io.jsonwebtoken"
|
2023-10-01 19:29:29 +02:00
|
|
|
exclude group: "com.mojang", module: "brigadier"
|
2023-03-16 21:46:33 +01:00
|
|
|
}
|
2024-11-01 20:10:41 +01:00
|
|
|
jij ("net.raphimc:ViaLoader:3.0.5-SNAPSHOT") {
|
2023-11-06 16:43:43 +01:00
|
|
|
exclude group: "com.google.guava", module: "guava"
|
2023-03-16 21:46:33 +01:00
|
|
|
exclude group: "org.slf4j", module: "slf4j-api"
|
|
|
|
}
|
2023-02-20 01:04:09 +01:00
|
|
|
|
2024-09-26 00:50:23 +02:00
|
|
|
jij ("net.raphimc:MinecraftAuth:4.1.1") {
|
2023-10-24 03:24:58 +02:00
|
|
|
exclude group: "com.google.code.gson", module: "gson"
|
|
|
|
exclude group: "org.slf4j", module: "slf4j-api"
|
|
|
|
}
|
2024-11-04 15:25:43 +01:00
|
|
|
jij "net.lenni0451:Reflect:1.4.0"
|
2024-10-07 17:04:52 +02:00
|
|
|
jij("net.lenni0451:MCPing:1.4.2") {
|
2023-11-26 21:11:41 +01:00
|
|
|
exclude group: "com.google.code.gson", module: "gson"
|
|
|
|
}
|
2023-03-15 00:47:06 +01:00
|
|
|
|
2024-08-05 17:00:14 +02:00
|
|
|
jij("org.cloudburstmc.netty:netty-transport-raknet:1.0.0.CR3-SNAPSHOT") {
|
2023-11-25 22:30:16 +01:00
|
|
|
exclude group: "io.netty"
|
|
|
|
}
|
2024-09-25 20:44:27 +02:00
|
|
|
jij "de.florianmichael:Classic4J:2.1.1-SNAPSHOT"
|
2023-11-25 00:47:17 +01:00
|
|
|
|
2023-11-25 22:30:16 +01:00
|
|
|
// Fabric's jar in jar system doesn't support transitive dependencies, so we have to manually add them
|
2023-11-25 00:47:17 +01:00
|
|
|
afterEvaluate {
|
2024-06-10 17:28:52 +02:00
|
|
|
configurations.jij.incoming.resolutionResult.allDependencies.each {
|
|
|
|
dependencies.include(dependencies.implementation(dependencies.compileOnlyApi(it.requested.toString()) {
|
|
|
|
transitive = false
|
|
|
|
}))
|
2023-11-25 00:47:17 +01:00
|
|
|
}
|
|
|
|
}
|
2023-02-19 23:17:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
filesMatching("fabric.mod.json") {
|
2024-03-30 14:14:19 +01:00
|
|
|
expand(
|
|
|
|
"version": project.version,
|
2024-08-05 17:26:18 +02:00
|
|
|
"description": project.description,
|
2024-08-08 17:59:40 +02:00
|
|
|
"implVersion": "git-${project.name}-${project.version}:${latestCommitHash()}",
|
|
|
|
"mcVersion": mcVersion()
|
2024-03-30 14:14:19 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-08-08 17:59:40 +02:00
|
|
|
String mcVersion() {
|
|
|
|
if (project.supported_versions.isEmpty()) {
|
|
|
|
return project.minecraft_version
|
|
|
|
} else {
|
|
|
|
return project.supported_versions
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-30 14:14:19 +01:00
|
|
|
String latestCommitHash() {
|
|
|
|
def stdout = new ByteArrayOutputStream()
|
|
|
|
exec {
|
|
|
|
commandLine "git", "rev-parse", "--short", "HEAD"
|
|
|
|
standardOutput = stdout
|
2023-02-19 23:17:33 +01:00
|
|
|
}
|
2024-03-30 14:14:19 +01:00
|
|
|
return stdout.toString().trim()
|
2023-02-19 23:17:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
java {
|
|
|
|
withSourcesJar()
|
2023-04-11 18:35:23 +02:00
|
|
|
|
2024-04-17 23:13:28 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_21
|
|
|
|
targetCompatibility = JavaVersion.VERSION_21
|
2023-02-19 23:17:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
2023-10-24 03:24:58 +02:00
|
|
|
// Rename the project's license file to LICENSE_<project_name> to avoid conflicts
|
|
|
|
from("LICENSE") {
|
|
|
|
rename {
|
|
|
|
"${it}_${project.archivesBaseName}"
|
|
|
|
}
|
|
|
|
}
|
2023-02-19 23:17:33 +01:00
|
|
|
}
|
2023-06-01 16:13:57 +02:00
|
|
|
|
|
|
|
publishing {
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
name = "Via"
|
|
|
|
url = "https://repo.viaversion.com/"
|
|
|
|
credentials(PasswordCredentials)
|
|
|
|
authentication {
|
|
|
|
basic(BasicAuthentication)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
publications {
|
|
|
|
maven(MavenPublication) {
|
|
|
|
groupId = project.maven_group
|
2024-08-05 17:26:18 +02:00
|
|
|
artifactId = project.maven_name
|
|
|
|
version = project.maven_version
|
2023-06-01 16:13:57 +02:00
|
|
|
|
|
|
|
from components.java
|
2024-08-05 17:26:18 +02:00
|
|
|
|
|
|
|
pom {
|
|
|
|
name = artifactId
|
|
|
|
description = project.description
|
|
|
|
url = "https://github.com/ViaVersion/ViaFabricPlus"
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name = "GPL-3.0 License"
|
|
|
|
url = "https://github.com/ViaVersion/ViaFabricPlus/blob/main/LICENSE"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id = "FlorianMichael"
|
|
|
|
name = "EnZaXD"
|
|
|
|
email = "florian.michael07@gmail.com"
|
|
|
|
}
|
|
|
|
developer {
|
|
|
|
id = "RK_01"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scm {
|
|
|
|
connection = "scm:git:git://github.com/ViaVersion/ViaFabricPlus.git"
|
|
|
|
developerConnection = "scm:git:ssh://github.com/ViaVersion/ViaFabricPlus.git"
|
|
|
|
url = "github.com/ViaVersion/ViaFabricPlus"
|
|
|
|
}
|
|
|
|
}
|
2023-06-01 16:13:57 +02:00
|
|
|
}
|
|
|
|
}
|
2023-06-16 19:14:18 +02:00
|
|
|
}
|
2023-12-25 20:30:50 +01:00
|
|
|
|
|
|
|
idea {
|
|
|
|
module {
|
|
|
|
["run"].each {
|
|
|
|
excludeDirs << file("$it")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|