tutorial:minotaur
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tutorial:minotaur [2020/12/20 00:07] – Created Page - Began Work calum6541 | tutorial:minotaur [2022/10/22 23:48] (current) – More appropriate heading changes budavissza | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Publishing your mod on Modrinth using Minotaur. (unfinished) | + | ====== Publishing your mod on Modrinth using Minotaur ====== |
- | Minotaur is a gradle | + | Minotaur is a Gradle |
- | This page only goes through the basics of Minotaur, | + | This page only goes through the basics of Minotaur, |
+ | ===== Basic Implementation ===== | ||
- | Rest of page TBD ((Its late and I'll complete | + | First of all, add the Minotaur plugin to your plugins list in your '' |
+ | |||
+ | <code groovy> | ||
+ | plugins { | ||
+ | id " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Minotaur registers a '' | ||
+ | |||
+ | Here is a basic example. | ||
+ | |||
+ | <code groovy> | ||
+ | import com.modrinth.minotaur.dependencies.ModDependency | ||
+ | |||
+ | modrinth { | ||
+ | token = ' | ||
+ | projectId = ' | ||
+ | versionNumber = ' | ||
+ | versionName = 'My awesome release' | ||
+ | uploadFile = remapJar // Tells Minotaur to use the remapped jar | ||
+ | gameVersions = [' | ||
+ | loaders = [' | ||
+ | dependencies = [ | ||
+ | new ModDependency(' | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Get your Modrinth [[https:// | ||
+ | |||
+ | Now, when you run '' | ||
+ | |||
+ | {{https:// | ||
+ | |||
+ | However, this can be limiting and sometimes repetitive to upload, as you would need to edit the values every time you want to release a version. | ||
+ | This is where Java '' | ||
+ | |||
+ | ===== Dynamic Implementation ===== | ||
+ | |||
+ | So, you have a basic implementation. Let's make it dynamic, allowing you to input values through the command line when the task is ran. Typically this is not done for Gradle tasks, and an environment variable or similar static source can be used for these values, but the tutorial is kept for posterity: | ||
+ | |||
+ | First of all, we would need to create a '' | ||
+ | |||
+ | Add a new '' | ||
+ | <code Java> | ||
+ | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ||
+ | </ | ||
+ | |||
+ | Now you can collect user input by simply calling the method: '' | ||
+ | |||
+ | Let's add this to our task, shall we? We'll also add some more data, such as a Markdown changelog and make the version name different from the semantic versioning number. | ||
+ | |||
+ | <code groovy> | ||
+ | modrinth { | ||
+ | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ||
+ | System.out.println(" | ||
+ | token = br.readLine(); | ||
+ | projectId = "" | ||
+ | System.out.println(" | ||
+ | versionNumber = br.readLine(); | ||
+ | System.out.println(" | ||
+ | versionName = br.readLine(); | ||
+ | uploadFile = remapJar | ||
+ | System.out.println(" | ||
+ | gameVersions = [br.readLine()]; | ||
+ | System.out.println(" | ||
+ | changelog = br.readLine(); | ||
+ | loaders = [" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Now, when '' | ||
+ | |||
+ | Minotaur is great alongside CurseGradle. You can merge both of the tasks together. Creating a new task to run both Minotaur and CurseGradle publishing tasks in one: | ||
+ | |||
+ | <code groovy> | ||
+ | task publishToModSites { | ||
+ | publishToModSites.dependsOn modrinth | ||
+ | publishToModSites.dependsOn curseforge | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Updating from Minotaur 1.x to 2.x ===== | ||
+ | |||
+ | Minotaur 2.x introduced a few breaking changes to how your buildscript is formatted. | ||
+ | |||
+ | First, instead of registering your own '' | ||
+ | |||
+ | To declare supported Minecraft versions and mod loaders, the '' | ||
+ | |||
+ | Instead of using '' | ||
+ | |||
+ | Finally, dependencies are also an array which take '' |
tutorial/minotaur.1608422847.txt.gz · Last modified: 2020/12/20 00:07 by calum6541