Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 33 additions & 57 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
plugins {
id 'fabric-loom' version "${loom_version}"
id 'maven-publish'
alias(libs.plugins.quilt.loom)
alias(libs.plugins.minotaur)
}

archivesBaseName = project.archives_base_name
version = project.version
version = project.mod_version
group = project.maven_group

base {
archivesName = project.archives_base_name
}

repositories {
exclusiveContent {
forRepository {
Expand All @@ -20,67 +22,59 @@ repositories {
includeGroup "maven.modrinth"
}
}


maven {
url = "https://maven.quiltmc.org/repository/release"
}
}

// All the dependencies are declared at gradle/libs.version.toml and referenced with "libs.<id>"
// See https://docs.gradle.org/current/userguide/platforms.html for information on how version catalogs work.
dependencies {
minecraft libs.minecraft
mappings variantOf(libs.quilt.mappings) { classifier 'intermediary-v2' }
// Replace the above line with the block below if you want to use Mojang mappings as your primary mappings, falling back on QM for parameters and Javadocs
/*
mappings loom.layered {
mappings "org.quiltmc:quilt-mappings:${libs.versions.quilt.mappings.get()}:intermediary-v2"
officialMojangMappings()
}
*/
modImplementation libs.quilt.loader
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "org.quiltmc:quilt-mappings:${project.quilt_mappings}:intermediary-v2"

// QSL is not a complete API; You will need Quilted Fabric API to fill in the gaps.
// Quilted Fabric API will automatically pull in the correct QSL version.
modImplementation libs.quilted.fabric.api
// modImplementation libs.bundles.quilted.fabric.api // If you wish to use Fabric API's deprecated modules, you can replace the above line with this one
// Fabric
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

}

processResources {
inputs.property 'version', version
inputs.property "version", project.version

filesMatching('quilt.mod.json') {
expand 'version': version
filesMatching("fabric.mod.json") {
expand "version": inputs.properties.version
}
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
it.options.release = 21
}

java {
// Still required by IDEs such as Eclipse and Visual Studio Code
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task if it is present.
// 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()

// If this mod is going to be a library, then it should also generate Javadocs in order to aid with developement.
// Uncomment this line to generate them.
// withJavadocJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

// If you plan to use a different file for the license, don't forget to change the file name here!
jar {
inputs.property "archivesName", project.base.archivesName

from("LICENSE") {
rename { "${it}_${archivesBaseName}" }
rename { "${it}_${inputs.properties.archivesName}"}
}
}

// Configure the maven publication
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
from components.java
}
}
Expand All @@ -92,22 +86,4 @@ publishing {
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}

modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "block-ex"
uploadFile = remapJar
additionalFiles = [sourcesJar]
gameVersions = [libs.versions.minecraft.get()]
loaders = ["quilt"]
def ref = System.getenv("GITHUB_REF")
changelog = System.getenv("CHANGELOG") ?:
(ref != null && ref.startsWith("refs/tags/")) ?
"You may view the changelog at https://github.com/DebuggyTeam/block-extensions/releases/tag/${URLEncoder.encode(ref.substring(10), StandardCharsets.UTF_8)}" :
"No changelog is available. Perhaps poke at https://github.com/DebuggyTeam/block-extensions for a changelog?"

dependencies {
required.project "qsl"
}
}
}
22 changes: 15 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# Gradle Properties
org.gradle.jvmargs = -Xmx1G
org.gradle.parallel = true
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21.1
quilt_mappings=1.21.1+build.9
loader_version=0.17.2
loom_version=1.11-SNAPSHOT

# Mod Properties
version = 1.0.0.beta1+1.20.1
maven_group = gay.debuggy
archives_base_name = block_extensions
mod_version=1.0.0
maven_group=gay.debuggy
archives_base_name=block_extensions

# Dependencies are managed at gradle/libs.versions.toml
# Dependencies
fabric_version=0.116.6+1.21.1
17 changes: 0 additions & 17 deletions gradle/libs.versions.toml

This file was deleted.

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading