Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redownload Assets if the referenced asset files have gone missing #233

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

shartte
Copy link
Collaborator

@shartte shartte commented Feb 5, 2025

When the gradle cache is deleted (or whereever the assets are); but the project directory is not, MDG will not re-download the assets since it doesn't know they've gone missing.
This code adds an up-to-date check to the DownloadAssets task that validates if the assets directory still exists.

@shartte shartte marked this pull request as ready for review February 5, 2025 00:06
@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Feb 5, 2025

  • Publish PR to GitHub Packages

Last commit published: cf197703d43c5c2364bbd2eae4d2ed708bbfe044.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #233' // https://github.com/neoforged/ModDevGradle/pull/233
        url 'https://prmaven.neoforged.net/ModDevGradle/pr233'
        content {
            includeModule('net.neoforged.moddev.legacyforge', 'net.neoforged.moddev.legacyforge.gradle.plugin')
            includeModule('net.neoforged.moddev', 'net.neoforged.moddev.gradle.plugin')
            includeModule('net.neoforged.moddev.repositories', 'net.neoforged.moddev.repositories.gradle.plugin')
            includeModule('net.neoforged', 'moddev-gradle')
        }
    }
}

import java.io.UncheckedIOException;
import java.util.Properties;

public record DownloadedAssetReference(String assetIndex, String assetsRoot) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call it DownloadedAssetsReference maybe. Singular refers to a single asset. Or maybe simply AssetProperties. Note that this record is now being made public API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also a JSON format which is why I did t go for it. But Yeah it belongs to the NFRT tasks and MDG need to use it so Api it is

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I just think DownloadedAssetReference is a bad name.)

@shartte
Copy link
Collaborator Author

shartte commented Feb 5, 2025 via email

@shartte shartte requested a review from Technici4n February 5, 2025 19:03
@shartte shartte merged commit 46c7224 into main Feb 5, 2025
6 checks passed
@shartte shartte deleted the redownload-assets branch February 5, 2025 21:28
@neoforged-releases
Copy link

🚀 This PR has been released as ModDevGradle version 2.0.78.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants