User Tools

Site Tools


tutorial:minotaur

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:minotaur [2021/07/22 21:36] – bump Minotaur version, minor grammar/spelling corrections emmaffletutorial:minotaur [2022/03/02 00:11] – Update to minotaur v2.0.0 emmaffle
Line 6: Line 6:
 ===== Basic ===== ===== Basic =====
  
-First of all, add the minotaur plugin to your plugins list in your ''build.gradle'' file as so:+First of all, add the Minotaur plugin to your plugins list in your ''build.gradle'' file as so:
  
 <code groovy> <code groovy>
 plugins { plugins {
-    id "com.modrinth.minotaur" version "1.2.1"+    id "com.modrinth.minotaur" version "2.+"
 } }
 </code> </code>
  
-Now you can create new Gradle task for uploading to Modrinth.+Minotaur registers ''modrinth'' task for you. Configuration is done through the ''modrinth {...}'' block.
  
 Here is a basic example. Here is a basic example.
  
 <code groovy> <code groovy>
-import com.modrinth.minotaur.TaskModrinthUpload+import com.modrinth.minotaur.dependencies.ModDependency
  
-task publishModrinth (type: TaskModrinthUpload) +modrinth 
-    token = 'mySecretToken' // Use an environment property if releasing your source code on GitHub+    token = 'mySecretToken' // Please use an environment variable for thisThe default is `$MODRINTH_TOKEN`. 
-    projectId = 'modrinthModID' // The ID of your modrinth project, slugs will not work. +    projectId = 'AABBCCDD' // The ID of your Modrinth project. Slugs will not work. 
-    versionNumber = '1.0.0' // The version of the mod to upload+    versionNumber = '1.0.0' // The (preferably SemVer) version of the mod. If not specified, it'll use the `version` declaration 
-    uploadFile = remapJar // This links to a task that builds your mod jar and sets "uploadFile" to the mod jar. +    versionName = 'My awesome release' // The version title. If not specified, it'll use the version number 
-    addGameVersion('1.16.2'// Any minecraft version. +    uploadFile = remapJar // Tells Minotaur to use the remapped jar 
-    addLoader('fabric') // Can be fabric or forge. Modrinth will support liteloader and rift at later date.+    gameVersions = ['1.18', '1.18.1', '1.18.2'// An array of game versions the version supports 
 +    loaders = ['fabric'] // Self-explanatory
 +    dependencies = [ 
 +            new ModDependency('P7dR8mSH', 'required') // Creates new required dependency on Fabric API 
 +    ]
 } }
 </code> </code>
Line 33: Line 37:
 Get your Modrinth [[https://modrinth.com/dashboard/settings|token from here.]] You can use this token to access the Modrinth API alongside Minotaur. Get your Modrinth [[https://modrinth.com/dashboard/settings|token from here.]] You can use this token to access the Modrinth API alongside Minotaur.
  
-Now, when you run ''gradle publishModrinth'', you should see that your mod has been compiled and uploaded to Modrinth, like so:+Now, when you run ''gradle modrinth'', you should see that your mod has been compiled and uploaded to Modrinth, like so:
  
 {{https://iili.io/KYUDq7.png}} {{https://iili.io/KYUDq7.png}}
Line 53: Line 57:
 Now you can collect user input by simply calling the method: ''br.readLine()''. Now you can collect user input by simply calling the method: ''br.readLine()''.
  
-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.+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> <code groovy>
-import com.modrinth.minotaur.TaskModrinthUpload +modrinth {
- +
-task publishModrinth (type: TaskModrinthUpload) {+
     BufferedReader br = new BufferedReader(new InputStreamReader(System.in));     BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
-    System.out.println("Enter a Github Access Token: "); +    System.out.println("Enter a Modrinth token: "); 
-    token = br.readLine(); // Get the GitHub Access Token you got from the basics part of this tutorial. +    token = br.readLine(); // Enter the token you got from the basics part of this tutorial. 
-    projectId = "" // Enter your modrinth mod ID here.+    projectId = "" // Enter your Modrinth project ID here.
     System.out.println("Enter the version number:");     System.out.println("Enter the version number:");
     versionNumber = br.readLine();     versionNumber = br.readLine();
     System.out.println("Enter the version name:");     System.out.println("Enter the version name:");
     versionName = br.readLine();     versionName = br.readLine();
-    uploadFile = remapJar // This links to a task that builds your mod jar and sets "uploadFile" to the mod jar.+    uploadFile = remapJar
     System.out.println("Enter the game version number: (See minotaur docs for valids)");     System.out.println("Enter the game version number: (See minotaur docs for valids)");
-    addGameVersion(br.readLine());+    gameVersions = [br.readLine()];
     System.out.println("Enter changelog:");     System.out.println("Enter changelog:");
     changelog = br.readLine();     changelog = br.readLine();
-    addLoader("fabric")+    loaders = ["fabric"]
 } }
 </code> </code>
  
-Now, when ''gradle publishModrinth'' is ran, it asks you for some sweet user input. Hell, you could even go as far as using Swing or JavaFX to make a GUI!+Now, when ''gradle modrinth'' is ran, it asks you for some sweet user input. Hell, you could even go as far as using Swing or JavaFX to make a GUI!
  
-Minotaur is great alongside CurseGradle. You can merge both of the tasks together. Calling your CurseGradle task after the Modrinth one is complete:+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> <code groovy>
-task publishModrinth (type: TaskModrinthUpload) +task publishToModSites 
-    // ... Modrinth Upload Stuff +    publishToModSites.dependsOn modrinth 
-    curseforge<id> // Begin the cursegradle task. Replacing ID with the id you set on the cursegradle config.+    publishToModSites.dependsOn curseforge
 } }
 </code> </code>
  
 +===== 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 ''publishModrinth'' task, Minotaur now automatically creates a ''modrinth'' task. As such, you can replace the ''task publishModrinth(type: TaskModrinthUpload) {'' line with just ''modrinth {''.
  
 +To declare supported Minecraft versions and mod loaders, the ''gameVersions'' and ''loaders'' arrays must now be used. The syntax for these are pretty self-explanatory.
  
 +Finally, dependencies are also an array which take `ModDependency` and/or `VersionDependency`. The first parameter is the project or version ID as a string, and the second parameter is the dependency type: one of ''required'', ''optional'', or ''unsupported''.
tutorial/minotaur.txt · Last modified: 2022/10/22 23:48 by budavissza