Update gradle configuration
This commit is contained in:
parent
019bce1c4b
commit
8346570549
64
build.gradle
64
build.gradle
@ -1,15 +1,17 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '1.7-SNAPSHOT'
|
alias libs.plugins.fabric.loom
|
||||||
|
id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
version = "${project.mod_version}-${project.minecraft_version}"
|
|
||||||
group = project.maven_group
|
|
||||||
|
|
||||||
base {
|
base {
|
||||||
archivesName = project.archives_base_name
|
archivesName = project.archives_base_name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String buildNumber = System.getenv("RUN_NUMBER")
|
||||||
|
version = "${mod_version}+${libs.versions.minecraft.get()}" + (buildNumber != null ? "-${buildNumber}" : "")
|
||||||
|
group = project.maven_group
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
splitEnvironmentSourceSets()
|
splitEnvironmentSourceSets()
|
||||||
|
|
||||||
@ -35,12 +37,13 @@ configurations {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// To change the versions see the gradle.properties file
|
// To change the versions see the gradle.properties file
|
||||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
minecraft libs.minecraft
|
||||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
mappings variantOf(libs.yarn.mappings) { classifier 'v2' }
|
||||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
|
||||||
|
modImplementation libs.fabric.loader
|
||||||
|
|
||||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
// Fabric API. This is technically optional, but you probably want it anyway.
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
modImplementation libs.fabric.version
|
||||||
|
|
||||||
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.3'
|
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.3'
|
||||||
includedJars group: 'org.yaml', name: 'snakeyaml', version: '2.3'
|
includedJars group: 'org.yaml', name: 'snakeyaml', version: '2.3'
|
||||||
@ -50,38 +53,22 @@ dependencies {
|
|||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
inputs.property "version", project.version
|
inputs.property "version", project.version
|
||||||
inputs.property "minecraft_version", project.minecraft_version
|
|
||||||
inputs.property "loader_version", project.loader_version
|
|
||||||
filteringCharset "UTF-8"
|
|
||||||
|
|
||||||
filesMatching("fabric.mod.json") {
|
filesMatching("fabric.mod.json") {
|
||||||
expand "version": project.version,
|
expand "version": project.version
|
||||||
"minecraft_version": project.minecraft_version,
|
|
||||||
"loader_version": project.loader_version
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def targetJavaVersion = 21
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
tasks.withType(JavaCompile).configureEach {
|
||||||
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
|
||||||
// this fixes some edge cases with special characters not displaying correctly
|
|
||||||
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
|
||||||
// If Javadoc is generated, this must be specified in that task too.
|
|
||||||
it.options.encoding = "UTF-8"
|
it.options.encoding = "UTF-8"
|
||||||
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
|
it.options.release = 21
|
||||||
it.options.release.set(targetJavaVersion)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
|
sourceCompatibility = JavaVersion.VERSION_21
|
||||||
if (JavaVersion.current() < javaVersion) {
|
targetCompatibility = JavaVersion.VERSION_21
|
||||||
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
|
|
||||||
}
|
// withSourcesJar()
|
||||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
|
||||||
// if it is present.
|
|
||||||
// If you remove this line, sources will not be generated.
|
|
||||||
withSourcesJar()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
@ -95,20 +82,3 @@ jar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// configure the maven publication
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
create("mavenJava", MavenPublication) {
|
|
||||||
artifactId = project.archives_base_name
|
|
||||||
from components.java
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
|
||||||
repositories {
|
|
||||||
// Add repositories to publish to here.
|
|
||||||
// Notice: This block does NOT have the same function as the block in the top level.
|
|
||||||
// The repositories here will be used for publishing your artifact, not for
|
|
||||||
// retrieving dependencies.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
# Done to increase the memory available to gradle.
|
# Done to increase the memory available to gradle.
|
||||||
org.gradle.jvmargs=-Xmx1G
|
org.gradle.jvmargs=-Xmx1G
|
||||||
# Fabric Properties
|
|
||||||
# check these on https://modmuss50.me/fabric.html
|
|
||||||
minecraft_version=1.21.1
|
|
||||||
yarn_mappings=1.21.1+build.3
|
|
||||||
loader_version=0.16.5
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=1.0.1
|
mod_version=1.0
|
||||||
maven_group=ru.bitheaven
|
maven_group=ru.bitheaven
|
||||||
archives_base_name=donpayinteg
|
archives_base_name=donpayinteg
|
||||||
# Dependencies
|
|
||||||
# check this on https://modmuss50.me/fabric.html
|
# Dependencies are managed at gradle/libs.versions.toml
|
||||||
fabric_version=0.105.0+1.21.1
|
|
23
gradle/libs.versions.toml
Normal file
23
gradle/libs.versions.toml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# The latest versions are available at https://quiltmc.org/en/usage/latest-versions
|
||||||
|
[versions]
|
||||||
|
minecraft = "1.21.4"
|
||||||
|
yarn_mappings="1.21.4+build.8"
|
||||||
|
|
||||||
|
fabric_loom = "1.9-SNAPSHOT"
|
||||||
|
# check these on https://modmuss50.me/fabric.html
|
||||||
|
fabric_loader = "0.16.10"
|
||||||
|
fabric_version="0.115.0+1.21.4"
|
||||||
|
|
||||||
|
[libraries]
|
||||||
|
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
|
||||||
|
|
||||||
|
fabric_loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric_loader" }
|
||||||
|
fabric_version = { module = "net.fabricmc.fabric-api:fabric-api", version.ref = "fabric_version" }
|
||||||
|
yarn_mappings = { module = "net.fabricmc:yarn", version.ref = "yarn_mappings" }
|
||||||
|
|
||||||
|
|
||||||
|
# If you have multiple similar dependencies, you can declare a dependency bundle and reference it on the build script with "libs.bundles.example".
|
||||||
|
[bundles]
|
||||||
|
|
||||||
|
[plugins]
|
||||||
|
fabric_loom = { id = "fabric-loom", version.ref = "fabric_loom" }
|
8
gradle/wrapper/gradle-wrapper.properties
vendored
8
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1 +1,7 @@
|
|||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
@ -4,6 +4,7 @@ pluginManagement {
|
|||||||
name = 'Fabric'
|
name = 'Fabric'
|
||||||
url = 'https://maven.fabricmc.net/'
|
url = 'https://maven.fabricmc.net/'
|
||||||
}
|
}
|
||||||
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user