Skip to content

Commit

Permalink
chore: update gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Dec 16, 2024
1 parent f709c6e commit 972f5da
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 56 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 MC Brawls
Copyright (c) 2024 MC Brawls

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
89 changes: 49 additions & 40 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
//file:noinspection All
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id "fabric-loom" version "1.6-SNAPSHOT"
id "fabric-loom" version "1.9-SNAPSHOT"
id "org.jetbrains.kotlin.jvm"
id "maven-publish"
}

def ENV = System.getenv()

version = mod_version
group = maven_group

Expand All @@ -17,13 +15,8 @@ base {

repositories {
maven {
name = "Andante"
url = "https://maven.andante.dev/releases/"
}

maven {
name = "Nucleoid"
url = "https://maven.nucleoid.xyz/"
name = "MC Brawls Maven"
url = "https://maven.mcbrawls.net/releases/"
}
}

Expand All @@ -34,37 +27,42 @@ sourceSets {
}
}

dependencies {
minecraft "com.mojang:minecraft:$minecraft_version"
mappings "net.fabricmc:yarn:$minecraft_version+build.$yarn_build:v2"
modImplementation "net.fabricmc:fabric-loader:$loader_version"

modImplementation "net.fabricmc.fabric-api:fabric-api:$fabric_version"
modImplementation "net.fabricmc:fabric-language-kotlin:$fabric_kotlin_version"

// test
testImplementation sourceSets.main.output
}

loom {
runtimeOnlyLog4j = true

accessWidenerPath = file("src/main/resources/${mod_id}.accesswidener")
splitEnvironmentSourceSets()

mods {
mod_id {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}

runs {
client {
ideConfigGenerated(false)
ideConfigGenerated = false
}

testServer {
server()
inherit(server)
name("Minecraft Server (Test)")
source(sourceSets.test)
runDir("runtest")
}
}
}

dependencies {
minecraft "com.mojang:minecraft:$minecraft_version"
mappings "net.fabricmc:yarn:$minecraft_version+build.$yarn_build:v2"

modImplementation "net.fabricmc:fabric-loader:$loader_version"
modImplementation "net.fabricmc.fabric-api:fabric-api:$fabric_version"

modImplementation "net.fabricmc:fabric-language-kotlin:$fabric_kotlin_version+kotlin.$kotlin_version"

testImplementation sourceSets.main.output
}

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

Expand All @@ -73,26 +71,21 @@ processResources {
}
}

tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 17
it.options.release = 21
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = 17
jvmTarget = 21
}
}

java {
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

jar {
Expand All @@ -104,14 +97,30 @@ jar {
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = mod_id
from components.java

pom {
name = "Pack Manager"
description = "A library for managing resource packs within contexts."
url = "https://mcbrawls.net"

licenses {
license {
name = "MIT"
url = "https://opensource.org/licenses/MIT"
distribution = "repo"
}
}
}
}
}

repositories {
// Andante's Maven
def mavenUsername = ENV["MAVEN_USERNAME_ANDANTE"]
def mavenPassword = ENV["MAVEN_PASSWORD_ANDANTE"]
def env = System.getenv()
def mavenUsername = env["MAVEN_USERNAME_ANDANTE"]
def mavenPassword = env["MAVEN_PASSWORD_ANDANTE"]
if (mavenUsername && mavenPassword) {
maven {
name = "Andante"
Expand Down
22 changes: 11 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Done to increase the memory available to gradle.
# gradle
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21.1
yarn_build=3
loader_version=0.15.11
# minecraft
minecraft_version=1.21.3

# Dependencies
fabric_version=0.102.1+1.21.1
# fabric
yarn_build=2
loader_version=0.16.9
fabric_version=0.112.1+1.21.3

kotlin_version=1.9.24
fabric_kotlin_version=1.10.20+kotlin.1.9.24
# kotlin
kotlin_version=2.0.21
fabric_kotlin_version=1.12.3

# Mod Properties
# mod properties
mod_version=1.3.2
maven_group=net.mcbrawls
mod_id=packmanager
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
9 changes: 6 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
pluginManagement {
mod_id

repositories {
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
url = "https://maven.fabricmc.net/"
}
mavenCentral()

gradlePluginPortal()
mavenCentral()
}

plugins {
id "org.jetbrains.kotlin.jvm" version kotlin_version
}
}

rootProject.name = "packmanager"
rootProject.name = mod_id

0 comments on commit 972f5da

Please sign in to comment.