Skip to content

Commit

Permalink
Update Gradle configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdAurora committed Nov 11, 2023
1 parent 9ba955b commit 2b91155
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 81 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/gradle_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ name: Gradle Build

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
build:
strategy:
matrix:
java: [ 17, 20 ]
java: [ 17, 21 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ jobs:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}

- name: Synchronize Mod description
uses: gradle/gradle-build-action@v2
with:
arguments: modrinthSyncBody --stacktrace
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}

- uses: actions/upload-artifact@v3
with:
name: Artifacts
Expand Down
5 changes: 2 additions & 3 deletions HEADER
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) ${YEAR} LambdAurora <[email protected]>
Copyright (c) ${CREATION_YEAR} LambdAurora <[email protected]>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -13,5 +13,4 @@ GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

;;year_selection: file
;;year_display: creation_only
#year_selection file
82 changes: 30 additions & 52 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
plugins {
id 'fabric-loom' version '1.2.+'
id 'io.github.juuxel.loom-vineflower' version '1.11.+'
id 'org.quiltmc.gradle.licenser' version '2.0.+'
id 'fabric-loom' version '1.4.+'
id 'dev.yumi.gradle.licenser' version '1.0.+'
id 'java-library'
id 'maven-publish'
id 'com.modrinth.minotaur' version '2.+'
id 'com.matthewprenger.cursegradle' version '1.4.+'
id 'net.darkhax.curseforgegradle' version '1.1.+'
}

import com.modrinth.minotaur.dependencies.ModDependency
import net.darkhax.curseforgegradle.TaskPublishCurseForge

group = project.maven_group
version = "${project.mod_version}+${project.minecraft_version}"
archivesBaseName = project.archives_base_name
base.archivesName = project.archives_base_name

// This field defines the Java version your mod target.
def targetJavaVersion = 17
Expand Down Expand Up @@ -123,7 +123,6 @@ jar {

license {
rule file('HEADER')
include '**/*.java'
}

modrinth {
Expand Down Expand Up @@ -151,57 +150,36 @@ modrinth {
}
tasks.modrinth.dependsOn(tasks.modrinthSyncBody)

curseforge {
tasks.register('curseforge', TaskPublishCurseForge) {
setGroup("publishing")

if (System.getenv("CURSEFORGE_TOKEN")) {
apiKey = System.getenv("CURSEFORGE_TOKEN")
apiToken = System.getenv("CURSEFORGE_TOKEN")
} else {
setEnabled(false)
return
}

project {
id = project.curseforge_id
releaseType = this.getVersionType()
addGameVersion project.minecraft_version
addGameVersion "Fabric"
addGameVersion "Quilt"
addGameVersion "Java 17"
addGameVersion "Java 18"

// Changelog fetching
def changelogContent = fetchChangelog()

if (changelogContent) {
changelogType = "markdown"
changelog = "Changelog:\n\n${changelogContent}"
} else {
afterEvaluate {
uploadTask.setEnabled(false)
}
}

mainArtifact(remapJar) {
displayName = "Lovely Snails ${project.mod_version} (${project.minecraft_version})"

relations {
requiredDependency "fabric-api"
optionalDependency "modmenu"
}
}
// Changelog fetching
def changelogContent = fetchChangelog()

afterEvaluate {
uploadTask.setGroup("publishing")
uploadTask.dependsOn("remapJar")
}
if (changelogContent) {
changelogContent = "Changelog:\n\n${changelogContent}"
} else {
setEnabled(false)
return
}
}
tasks.curseforge.setGroup("publishing")

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
}
}
def mainFile = upload(project.curseforge_id, tasks.remapJar)
mainFile.releaseType = this.getVersionType()
mainFile.addGameVersion(project.minecraft_version)
mainFile.addModLoader("Fabric", "Quilt")
mainFile.addJavaVersion("Java 17", "Java 18")

repositories {
}
mainFile.displayName = "Lovely Snails ${project.mod_version} (${project.minecraft_version})"
mainFile.addRequirement("fabric-api")
mainFile.addOptional("modmenu")

mainFile.changelogType = "markdown"
mainFile.changelog = changelogContent
}
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.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
13 changes: 0 additions & 13 deletions settings.gradle

This file was deleted.

11 changes: 11 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pluginManagement {
repositories {
maven {
name = "Fabric"
url = uri("https://maven.fabricmc.net/")
}
gradlePluginPortal()
}
}

rootProject.name = "Lovely Snails"

0 comments on commit 2b91155

Please sign in to comment.