-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6455975
commit 8116de2
Showing
3 changed files
with
185 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<p>A changelog can be found at: <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: <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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters