Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: modrinth/minotaur
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.6.0
Choose a base ref
...
head repository: modrinth/minotaur
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jan 20, 2023

  1. 2
    Copy the full SHA
    7eb2a26 View commit details
  2. Copy the full SHA
    6925e5b View commit details
  3. Fix wrong env var name

    triphora committed Jan 20, 2023
    4
    Copy the full SHA
    6b12c94 View commit details

Commits on Feb 10, 2023

  1. Copy the full SHA
    ea1660b View commit details
  2. Convert everything to tabs

    triphora committed Feb 10, 2023
    Copy the full SHA
    a3b3fe2 View commit details
  3. Copy the full SHA
    5f7b0a4 View commit details

Commits on Feb 11, 2023

  1. Copy the full SHA
    b0a8623 View commit details
  2. Fix #42

    triphora committed Feb 11, 2023
    Copy the full SHA
    f1be52e View commit details

Commits on Feb 15, 2023

  1. Copy the full SHA
    c9dc1f2 View commit details

Commits on Mar 4, 2023

  1. Copy the full SHA
    1876a6b View commit details
  2. Fix #24 (#46)

    jpenilla authored Mar 4, 2023
    Copy the full SHA
    e2e9532 View commit details
  3. Copy the full SHA
    3d5a1cc View commit details

Commits on Mar 6, 2023

  1. Copy the full SHA
    43faee0 View commit details

Commits on Mar 14, 2023

  1. Copy the full SHA
    8ad8d01 View commit details
  2. Fix incorrect logic

    triphora committed Mar 14, 2023
    Copy the full SHA
    b9ff03a View commit details

Commits on Jun 7, 2023

  1. Copy the full SHA
    69189d0 View commit details

Commits on Jun 13, 2023

  1. Copy the full SHA
    f56b9cd View commit details

Commits on Jun 21, 2023

  1. Copy the full SHA
    ae086af View commit details

Commits on Jun 24, 2023

  1. Copy the full SHA
    dbd652e View commit details

Commits on Jul 16, 2023

  1. Fix #55

    triphora committed Jul 16, 2023
    Copy the full SHA
    d88762f View commit details
  2. Simplify code

    triphora committed Jul 16, 2023
    Copy the full SHA
    8d4468b View commit details
  3. Fix plugin publish

    triphora committed Jul 16, 2023
    Copy the full SHA
    9fb247f View commit details

Commits on Jul 23, 2023

  1. Add NeoForge support

    triphora committed Jul 23, 2023
    Copy the full SHA
    e5d93d6 View commit details

Commits on Aug 6, 2023

  1. Copy the full SHA
    5e29523 View commit details

Commits on Sep 10, 2023

  1. Copy the full SHA
    ca56a4a View commit details
  2. Copy the full SHA
    baf4b4b View commit details

Commits on Nov 14, 2023

  1. Support NeoForge userdev plugin

    Closes #59
    triphora committed Nov 14, 2023
    Copy the full SHA
    41d19e6 View commit details

Commits on Nov 17, 2023

  1. Copy the full SHA
    814aff2 View commit details
  2. Bump version v2.8.6

    triphora committed Nov 17, 2023
    Copy the full SHA
    cc8a42a View commit details

Commits on Dec 3, 2023

  1. Copy the full SHA
    db76ec2 View commit details
  2. Copy the full SHA
    a151c42 View commit details
Showing with 1,880 additions and 1,749 deletions.
  1. +2 −1 .editorconfig
  2. +2 −0 .git-blame-ignore-revs
  3. +33 −0 .github/ISSUE_TEMPLATE/bug_report.yml
  4. +16 −0 .github/ISSUE_TEMPLATE/config.yml
  5. +28 −0 .github/ISSUE_TEMPLATE/enhancement.yml
  6. +1 −1 .github/workflows/build.yml
  7. +8 −4 README.md
  8. +38 −41 build.gradle
  9. +28 −28 fg/build.gradle
  10. +1 −1 gradle/wrapper/gradle-wrapper.properties
  11. +23 −22 loom/build.gradle
  12. +4 −4 loom/src/main/resources/fabric.mod.json
  13. +10 −10 settings.gradle
  14. +49 −53 src/main/java/com/modrinth/minotaur/Minotaur.java
  15. +189 −175 src/main/java/com/modrinth/minotaur/ModrinthExtension.java
  16. +48 −85 src/main/java/com/modrinth/minotaur/TaskModrinthSyncBody.java
  17. +257 −292 src/main/java/com/modrinth/minotaur/TaskModrinthUpload.java
  18. +116 −165 src/main/java/com/modrinth/minotaur/Util.java
  19. +79 −34 src/main/java/com/modrinth/minotaur/dependencies/Dependency.java
  20. +35 −48 src/main/java/com/modrinth/minotaur/dependencies/DependencyType.java
  21. +32 −32 src/main/java/com/modrinth/minotaur/dependencies/ModDependency.java
  22. +70 −72 src/main/java/com/modrinth/minotaur/dependencies/VersionDependency.java
  23. +62 −62 src/main/java/com/modrinth/minotaur/dependencies/container/DependencyDSL.java
  24. +52 −52 src/main/java/com/modrinth/minotaur/dependencies/container/NamedDependency.java
  25. +98 −94 src/main/java/com/modrinth/minotaur/dependencies/container/NamedDependencyContainer.java
  26. +0 −158 src/main/java/com/modrinth/minotaur/request/VersionData.java
  27. +18 −16 src/main/java/com/modrinth/minotaur/request/VersionType.java
  28. +0 −37 src/main/java/com/modrinth/minotaur/responses/ResponseError.java
  29. +306 −262 src/main/java/com/modrinth/minotaur/responses/ResponseUpload.java
  30. +275 −0 src/main/java/com/modrinth/minotaur/scanner/JarInfectionScanner.java
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -4,8 +4,9 @@ root = true
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_style = tab
indent_size = 4

[*.yml]
indent_size = 2
indent_style = space
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Reformatting from spaces -> tabs
a3b3fe2edef2ab049339efd8e1209a84e1c33dcc
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Bug report
description: Create a report to help us improve Modrinth
labels: [bug]
body:
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: false
- type: textarea
attributes:
label: Steps to reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error
validations:
required: false
- type: textarea
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem here.
validations:
required: false
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
blank_issues_enabled: true
contact_links:
- name: Discord
about: Ask questions on our Discord Server.
url: https://discord.modrinth.com
- name: Roadmap
about: View our Roadmap. Please do not open issues for items on our roadmap.
url: https://roadmap.modrinth.com
- name: Discussions (Feature requests)
about: |
Please use Issues for reporting bugs and suggesting enhancements to existing features.
Suggestions for new features should be made as a Discussion.
url: https://github.com/orgs/modrinth/discussions/categories/feature-requests
- name: Documentation
about: Useful documentation about Modrinth, its API, and how you can contribute.
url: https://docs.modrinth.com
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Enhancement
description: Suggest an enhancement for an existing Modrinth feature
labels: [enhancement]
body:
- type: textarea
attributes:
label: Is your suggested enhancement related to a problem? Please describe.
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: false
- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: false
- type: textarea
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Add any other context or screenshots about the suggested enhancement here.
validations:
required: false
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -41,4 +41,4 @@ jobs:
run: ./gradlew fg:modrinth loom:modrinth
if: ${{ !contains(github.event.head_commit.message, 'skip test') }}
env:
MODRINTH_TOKEN: dummy_token_does_not_matter_because_debugMode
MODRINTH_TOKEN: dummy_token_for_CI
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -4,12 +4,16 @@ A Gradle plugin for interfacing directly with Modrinth, through uploading build

Want to use a GitHub Action instead of a Gradle plugin? Check out [Kir-Antipov/mc-publish](https://github.com/Kir-Antipov/mc-publish), but note that Modrinth does not give support for `mc-publish` where we do for Minotaur.

Still using Minotaur v1? You should switch as soon as possible, because it uses the deprecated API v1. Migration instructions can be found [on the Modrinth documentation page](https://docs.modrinth.com/docs/migrations/v1-to-v2/#minotaur-v1-to-v2).

## Usage Guide

To use this plugin you must add it to your Gradle build script. After that, you can use the `modrinth` task to upload the version to Modrinth.

Minotaur requires a personal access token with the following scopes:
- `CREATE_VERSION` (if running the `modrinth` task)
- `PROJECT_WRITE` (if running the `modrinthSyncBody` task)

You can generate a token on [the account settings page](https://modrinth.com/settings/account). If your provided token does not have all required scopes, you will get an error saying `Invalid Authentication Credentials`.

### Groovy

<details open="open"><summary>Groovy DSL</summary>
@@ -36,7 +40,7 @@ The next step is to configure the task for uploading to Modrinth. This allows yo
```groovy
// build.gradle
modrinth {
token = System.getenv("MODRINTH_TOKEN") // This is the default. Remember to have the MODRINTH_TOKEN environment variable set or else this will fail, or set it to whatever you want - just make sure it stays private!
token = System.getenv("MODRINTH_TOKEN") // Remember to have the MODRINTH_TOKEN environment variable set or else this will fail - just make sure it stays private!
projectId = "my-project" // This can be the project ID or the slug. Either will work!
versionNumber = "1.0.0" // You don't need to set this manually. Will fail if Modrinth has this version already
versionType = "release" // This is the default -- can also be `beta` or `alpha`
@@ -82,7 +86,7 @@ The next step is to configure the task for uploading to Modrinth. This allows yo
```kotlin
// build.gradle.kts
modrinth {
token.set(System.getenv("MODRINTH_TOKEN")) // This is the default. Remember to have the MODRINTH_TOKEN environment variable set or else this will fail, or set it to whatever you want - just make sure it stays private!
token.set(System.getenv("MODRINTH_TOKEN")) // Remember to have the MODRINTH_TOKEN environment variable set or else this will fail - just make sure it stays private!
projectId.set("my-project") // This can be the project ID or the slug. Either will work!
versionNumber.set("1.0.0") // You don't need to set this manually. Will fail if Modrinth has this version already
versionType.set("release") // This is the default -- can also be `beta` or `alpha`
79 changes: 38 additions & 41 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'com.gradle.plugin-publish' version '1.1.0'
id 'com.gradle.plugin-publish' version '1.2.0'
}

version = '2.6.0'
version = '2.8.7'
group = 'com.modrinth.minotaur'
archivesBaseName = 'Minotaur'
description = 'Modrinth plugin for publishing builds to the website!'
@@ -13,58 +13,55 @@ sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

repositories {
mavenCentral()
mavenCentral()
gradlePluginPortal()
}

dependencies {
compileOnly gradleApi()

implementation group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.14'
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.14'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10'

compileOnly group: 'org.jetbrains', name: 'annotations', version: '+'
compileOnly gradleApi()
compileOnly group: 'org.jetbrains', name: 'annotations', version: '+'
api group: 'dev.masecla', name: 'Modrinth4J', version: '2.1.0'
api group: 'org.ow2.asm', name: 'asm', version: '9.5'
api group: 'org.ow2.asm', name: 'asm-tree', version: '9.5'
compileOnly group: 'io.papermc.paperweight', name: 'paperweight-userdev', version: '1.5.2'
}

gradlePlugin {
plugins {
minotaur {
id = 'com.modrinth.minotaur'
implementationClass = 'com.modrinth.minotaur.Minotaur'
displayName = 'Minotaur'
}
}
}

pluginBundle {
website = 'https://modrinth.com'
vcsUrl = 'https://github.com/modrinth/minotaur'
description = 'Modrinth plugin for publishing builds to the website!'
tags = ['modrinth', 'publish', 'mods', 'minecraft']
website = 'https://modrinth.com'
vcsUrl = 'https://github.com/modrinth/minotaur'
plugins {
minotaur {
id = 'com.modrinth.minotaur'
implementationClass = 'com.modrinth.minotaur.Minotaur'
displayName = 'Minotaur'
description = 'Modrinth plugin for publishing builds to the website!'
tags.addAll('modrinth', 'publish', 'mods', 'minecraft')
}
}
}

jar {
manifest {
attributes([
'Timestamp' : System.currentTimeMillis(),
'Specification-Title' : project.archivesBaseName,
'Specification-Vendor' : vendor,
'Specification-Version' : project.version,
'Implementation-Title' : project.archivesBaseName,
'Implementation-Version' : project.version,
'Implementation-Vendor' : vendor,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})"
])
}
manifest {
attributes([
'Timestamp' : System.currentTimeMillis(),
'Specification-Title' : project.archivesBaseName,
'Specification-Vendor' : vendor,
'Specification-Version' : project.version,
'Implementation-Title' : project.archivesBaseName,
'Implementation-Version' : project.version,
'Implementation-Vendor' : vendor,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})"
])
}
}

java {
withSourcesJar()
withJavadocJar()
withSourcesJar()
withJavadocJar()
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release.set(8)
it.options.encoding = "UTF-8"
it.options.release.set(8)
}
56 changes: 28 additions & 28 deletions fg/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.+', changing: true
}
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '6.+', changing: true
}
}

plugins {
id "com.modrinth.minotaur" version "2.+"
id "java"
id "idea"
id "com.modrinth.minotaur" version "2.+"
id "java"
id "idea"
}

apply plugin: 'net.minecraftforge.gradle'
@@ -19,11 +19,11 @@ version = "1.0.371"
group = "com.modrinth.minotaur"

minecraft {
mappings channel: "official", version: "1.18.1"
mappings channel: "official", version: "1.18.1"
}

dependencies {
minecraft "net.minecraftforge:forge:1.18.1-39.0.9"
minecraft "net.minecraftforge:forge:1.18.1-39.0.9"
}

java.withSourcesJar()
@@ -33,24 +33,24 @@ import com.modrinth.minotaur.dependencies.ModDependency
import com.modrinth.minotaur.dependencies.VersionDependency

modrinth {
apiUrl = STAGING_API_URL
projectId = "fred-3"
uploadFile = jar
additionalFiles = [project.file("build/libs/fg-$version-sources.jar")]
versionType = "beta"
dependencies = [
new ModDependency("test-project", "optional"),
new VersionDependency("CE5sWFeF", DependencyType.INCOMPATIBLE)
]
dependencies {
required.project "corrupted"
optional.version "UakHulqw"
incompatible.version "kdIr8lsr", "b1.2+mod"
embedded.project "sbbGxWge"
}
debugMode = true
apiUrl = STAGING_API_URL
projectId = "fred-3"
uploadFile = jar
additionalFiles = [project.file("build/libs/fg-$version-sources.jar")]
versionType = "beta"
dependencies = [
new ModDependency("test-project", "optional"),
new VersionDependency("CE5sWFeF", DependencyType.INCOMPATIBLE)
]
dependencies {
required.project "corrupted"
optional.version "UakHulqw"
incompatible.version "kdIr8lsr", "b1.2+mod"
embedded.project "sbbGxWge"
}
debugMode = true
}

tasks.modrinth.doLast {
if (!modrinth.debugMode && tasks.modrinth.wasUploadSuccessful()) println tasks.modrinth.uploadInfo.id
if (!modrinth.debugMode && tasks.modrinth.wasUploadSuccessful()) println tasks.modrinth.uploadInfo.id
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
45 changes: 23 additions & 22 deletions loom/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
plugins {
id "fabric-loom" version "1.0.+"
id "com.modrinth.minotaur" version "2.+"
id "fabric-loom" version "1.3.+"
id "com.modrinth.minotaur" version "2.+"
}

version = "1.0.370"
version = "2.7.0.3"
group = "com.modrinth.minotaur"

dependencies {
minecraft "com.mojang:minecraft:1.17.1"
mappings "net.fabricmc:yarn:1.17.1+build.65:v2"
modImplementation "net.fabricmc:fabric-loader:0.12.12"
minecraft "com.mojang:minecraft:1.17.1"
mappings "net.fabricmc:yarn:1.17.1+build.65:v2"
modImplementation "net.fabricmc:fabric-loader:0.12.12"
}

java.withSourcesJar()
@@ -19,20 +19,21 @@ import com.modrinth.minotaur.dependencies.ModDependency
import com.modrinth.minotaur.dependencies.VersionDependency

modrinth {
apiUrl = STAGING_API_URL
projectId = "fred-3"
uploadFile = remapJar
additionalFiles = [project.file("build/libs/loom-$version-sources.jar")]
versionType = "beta"
dependencies = [
new ModDependency("test-project", "optional"),
new VersionDependency("CE5sWFeF", DependencyType.INCOMPATIBLE)
]
dependencies {
required.project "corrupted"
optional.version "UakHulqw"
incompatible.version "kdIr8lsr", "b1.2+mod"
embedded.project "sbbGxWge"
}
debugMode = true
apiUrl = STAGING_API_URL
projectId = "fred-3"
uploadFile = remapJar
additionalFiles = [project.file("build/libs/loom-$version-sources.jar")]
versionType = "alpha"
dependencies = [
new ModDependency("test-project", "optional"),
new VersionDependency("CE5sWFeF", DependencyType.INCOMPATIBLE)
]
dependencies {
required.project "corrupted"
optional.version "UakHulqw"
incompatible.version "kdIr8lsr", "b1.2+mod"
embedded.project "sbbGxWge"
required.version "test-project", "1.19.4-SNAPSHOT"
}
debugMode = true
}
Loading