Skip to content

Commit

Permalink
[Wurst-Bot] Update to 23w51b
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Dec 18, 2023
1 parent 6455975 commit 8116de2
Show file tree
Hide file tree
Showing 3 changed files with 185 additions and 185 deletions.
356 changes: 178 additions & 178 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,178 +1,178 @@
buildscript {
dependencies {
classpath 'org.kohsuke:github-api:1.135'
}
}

plugins {
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'maven-publish'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id "com.modrinth.minotaur" version "2.+"
id 'com.diffplug.spotless' version '6.23.3'
}

def ENV = System.getenv()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

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

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
}

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

filesMatching("fabric.mod.json") {
expand "version": project.version
}
}

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

java {
// 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 {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}

spotless {
java {
removeUnusedImports()
indentWithTabs()
trimTrailingWhitespace()
eclipse().configFile(file("codestyle/formatter.xml"))
lineEndings('WINDOWS')
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
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.
}
}

curseforge {
if (ENV.CURSEFORGE_API_KEY) {
apiKey = ENV.CURSEFORGE_API_KEY
}

project {
id = "349630"
changelogType = "html"
changelog = file("changelog.txt")
releaseType = "release"
addGameVersion "1.20.4"
addGameVersion "Fabric"

mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"))
addArtifact file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources.jar")
addArtifact file("${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar")
addArtifact file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources-dev.jar")

relations {
requiredDependency "fabric-api"
}
}

options {
forgeGradleIntegration = false
}
}

modrinth {
if (ENV.MODRINTH_TOKEN) {
token = ENV.MODRINTH_TOKEN
}
projectId = "wi-zoom"
versionName = "WI Zoom ${version}"
versionType = "release"
uploadFile = remapJar
additionalFiles = [
file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources.jar"),
file("${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar"),
file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources-dev.jar")
]
changelog = "A changelog can be found at: [https://www.wimods.net/wi-zoom/wi-zoom-1-5/](https://www.wimods.net/wi-zoom/wi-zoom-1-5/?mc=${project.minecraft_version}&utm_source=Modrinth&utm_medium=WI+Zoom&utm_campaign=Changelog&utm_content=Modrinth+WI+Zoom+MC${project.minecraft_version})"
dependencies {
required.version "fabric-api", project.fabric_version
}
}

afterEvaluate {
tasks.curseforge349630.dependsOn moveDevLibs
tasks.modrinth.dependsOn moveDevLibs
}

task moveDevLibs(dependsOn: [remapJar, remapSourcesJar]) {
doLast {
ant.move(file:"${project.buildDir}/devlibs/${archivesBaseName}-${version}-dev.jar", tofile:"${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar")
ant.move(file:"${project.buildDir}/devlibs/${archivesBaseName}-${version}-sources.jar", tofile:"${project.buildDir}/libs/${archivesBaseName}-${version}-sources-dev.jar")
}
}

import org.kohsuke.github.GHReleaseBuilder
import org.kohsuke.github.GitHub

task github(dependsOn: moveDevLibs) {
onlyIf {
ENV.GITHUB_TOKEN
}

doLast {
def github = GitHub.connectUsingOAuth(ENV.GITHUB_TOKEN as String)
def repository = github.getRepository("Wurst-Imperium-MCX/WI-Zoom")
def ghVersion = "v" + version.substring(0, version.indexOf("-"))

def ghRelease = repository.getReleaseByTagName(ghVersion as String);
if(ghRelease == null) {
def releaseBuilder = new GHReleaseBuilder(repository, ghVersion as String)
ghRelease = releaseBuilder.create()
}

ghRelease.uploadAsset(remapJar.archiveFile.get().getAsFile(), "application/java-archive");
ghRelease.uploadAsset(remapSourcesJar.archiveFile.get().getAsFile(), "application/java-archive")
ghRelease.uploadAsset(new File("${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar"), "application/java-archive")
ghRelease.uploadAsset(new File("${project.buildDir}/libs/${archivesBaseName}-${version}-sources-dev.jar"), "application/java-archive")
}
}
buildscript {
dependencies {
classpath 'org.kohsuke:github-api:1.135'
}
}

plugins {
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'maven-publish'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id "com.modrinth.minotaur" version "2.+"
id 'com.diffplug.spotless' version '6.23.3'
}

def ENV = System.getenv()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

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

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
}

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

filesMatching("fabric.mod.json") {
expand "version": project.version
}
}

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

java {
// 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 {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}

spotless {
java {
removeUnusedImports()
indentWithTabs()
trimTrailingWhitespace()
eclipse().configFile(file("codestyle/formatter.xml"))
lineEndings('WINDOWS')
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
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.
}
}

curseforge {
if (ENV.CURSEFORGE_API_KEY) {
apiKey = ENV.CURSEFORGE_API_KEY
}

project {
id = "349630"
changelogType = "html"
changelog = file("changelog.txt")
releaseType = "release"
addGameVersion "1.20.5-Snapshot"
addGameVersion "Fabric"

mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"))
addArtifact file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources.jar")
addArtifact file("${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar")
addArtifact file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources-dev.jar")

relations {
requiredDependency "fabric-api"
}
}

options {
forgeGradleIntegration = false
}
}

modrinth {
if (ENV.MODRINTH_TOKEN) {
token = ENV.MODRINTH_TOKEN
}
projectId = "wi-zoom"
versionName = "WI Zoom ${version}"
versionType = "release"
uploadFile = remapJar
additionalFiles = [
file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources.jar"),
file("${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar"),
file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources-dev.jar")
]
changelog = "A changelog can be found at: [https://www.wimods.net/wi-zoom/wi-zoom-1-5/](https://www.wimods.net/wi-zoom/wi-zoom-1-5/?mc=${project.minecraft_version}&utm_source=Modrinth&utm_medium=WI+Zoom&utm_campaign=Changelog&utm_content=Modrinth+WI+Zoom+MC${project.minecraft_version})"
dependencies {
required.version "fabric-api", project.fabric_version
}
}

afterEvaluate {
tasks.curseforge349630.dependsOn moveDevLibs
tasks.modrinth.dependsOn moveDevLibs
}

task moveDevLibs(dependsOn: [remapJar, remapSourcesJar]) {
doLast {
ant.move(file:"${project.buildDir}/devlibs/${archivesBaseName}-${version}-dev.jar", tofile:"${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar")
ant.move(file:"${project.buildDir}/devlibs/${archivesBaseName}-${version}-sources.jar", tofile:"${project.buildDir}/libs/${archivesBaseName}-${version}-sources-dev.jar")
}
}

import org.kohsuke.github.GHReleaseBuilder
import org.kohsuke.github.GitHub

task github(dependsOn: moveDevLibs) {
onlyIf {
ENV.GITHUB_TOKEN
}

doLast {
def github = GitHub.connectUsingOAuth(ENV.GITHUB_TOKEN as String)
def repository = github.getRepository("Wurst-Imperium-MCX/WI-Zoom")
def ghVersion = "v" + version.substring(0, version.indexOf("-"))

def ghRelease = repository.getReleaseByTagName(ghVersion as String);
if(ghRelease == null) {
def releaseBuilder = new GHReleaseBuilder(repository, ghVersion as String)
ghRelease = releaseBuilder.create()
}

ghRelease.uploadAsset(remapJar.archiveFile.get().getAsFile(), "application/java-archive");
ghRelease.uploadAsset(remapSourcesJar.archiveFile.get().getAsFile(), "application/java-archive")
ghRelease.uploadAsset(new File("${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar"), "application/java-archive")
ghRelease.uploadAsset(new File("${project.buildDir}/libs/${archivesBaseName}-${version}-sources-dev.jar"), "application/java-archive")
}
}
4 changes: 2 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<p>A changelog can be found at:&nbsp;<a href="https://www.wimods.net/wi-zoom/wi-zoom-1-5/?mc=1.20.4&utm_source=CurseForge&utm_medium=WI+Zoom&utm_campaign=Changelog&utm_content=WI+Zoom+MC1.20.4">https://www.wimods.net/wi-zoom/wi-zoom-1-5/</a></p>
<p><strong>Note:</strong> This mod requires <a href="https://www.curseforge.com/minecraft/mc-mods/fabric-api/files/4933446" target="_blank" rel="noopener noreferrer">Fabric API for Minecraft 1.20.4</a>.</p>
<p>A changelog can be found at:&nbsp;<a href="https://www.wimods.net/wi-zoom/wi-zoom-1-5/?mc=23w51b&utm_source=CurseForge&utm_medium=WI+Zoom&utm_campaign=Changelog&utm_content=WI+Zoom+MC23w51b">https://www.wimods.net/wi-zoom/wi-zoom-1-5/</a></p>
<p><strong>Note:</strong> This mod requires <a href="https://www.curseforge.com/minecraft/mc-mods/fabric-api/files/4966929" target="_blank" rel="noopener noreferrer">Fabric API for Minecraft 23w51b</a>.</p>
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ org.gradle.parallel=true
# Fabric Properties
# check these at https://fabricmc.net/develop/ and
# https://www.curseforge.com/minecraft/mc-mods/fabric-api
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.1
minecraft_version=23w51b
yarn_mappings=23w51b+build.1
loader_version=0.15.3

#Fabric api
fabric_version=0.91.2+1.20.4
fabric_version=0.91.4+1.20.5

# Mod Properties
mod_version = 1.5-MC1.20.4
mod_version = 1.5-MC23w51b
maven_group = net.wurstclient.zoom
archives_base_name = WI-Zoom

Expand Down

0 comments on commit 8116de2

Please sign in to comment.