Skip to content

Commit

Permalink
Correct use UntrackedTask. Also fix #1254
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Jan 26, 2025
1 parent 362fc98 commit cb8ba8f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.OutputFile;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.UntrackedTask;
import org.gradle.api.tasks.options.Option;
import org.gradle.internal.logging.progress.ProgressLoggerFactory;
import org.gradle.process.ExecOperations;
import org.gradle.process.ExecResult;
import org.gradle.work.DisableCachingByDefault;
import org.gradle.workers.WorkAction;
import org.gradle.workers.WorkParameters;
import org.gradle.workers.WorkQueue;
Expand Down Expand Up @@ -104,7 +104,7 @@
import net.fabricmc.loom.util.service.ScopedServiceFactory;
import net.fabricmc.mappingio.tree.MemoryMappingTree;

@DisableCachingByDefault
@UntrackedTask(because = "Manually invoked, has internal caching")
public abstract class GenerateSourcesTask extends AbstractLoomTask {
private static final String CACHE_VERSION = "v1";
private final DecompilerOptions decompilerOptions;
Expand Down Expand Up @@ -237,7 +237,6 @@ public GenerateSourcesTask(DecompilerOptions decompilerOptions) {
throw new IllegalStateException("Input minecraft jar not found: " + getInputJarName().get());
}));

getOutputs().upToDateWhen((o) -> false);
getClasspath().from(decompilerOptions.getClasspath()).finalizeValueOnRead();
dependsOn(decompilerOptions.getClasspath().getBuiltBy());

Expand Down
1 change: 0 additions & 1 deletion src/main/java/net/fabricmc/loom/task/LoomTasks.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public abstract class LoomTasks implements Runnable {
public void run() {
getTasks().register("migrateMappings", MigrateMappingsTask.class, t -> {
t.setDescription("Migrates mappings to a new version.");
t.getOutputs().upToDateWhen(o -> false);
});

var generateLog4jConfig = getTasks().register("generateLog4jConfig", GenerateLog4jConfigTask.class, t -> {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/fabricmc/loom/task/MigrateMappingsTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
import org.gradle.api.tasks.Nested;
import org.gradle.api.tasks.OutputDirectory;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.UntrackedTask;
import org.gradle.api.tasks.options.Option;
import org.gradle.work.DisableCachingByDefault;

import net.fabricmc.loom.task.service.MigrateMappingsService;
import net.fabricmc.loom.util.service.ScopedServiceFactory;

@DisableCachingByDefault(because = "Always rerun this task.")
@UntrackedTask(because = "Always rerun this task.")
public abstract class MigrateMappingsTask extends AbstractLoomTask {
@Input
@Option(option = "mappings", description = "Target mappings")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.gradle.api.tasks.Nested;
import org.gradle.api.tasks.OutputDirectory;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.UntrackedTask;
import org.gradle.jvm.toolchain.JavaLauncher;
import org.gradle.jvm.toolchain.JavaToolchainService;
import org.gradle.jvm.toolchain.JavaToolchainSpec;
Expand All @@ -68,6 +69,7 @@
* <p>Do not use this task directly, use {@link ClientProductionRunTask} or {@link ServerProductionRunTask} instead.
*/
@ApiStatus.Experimental
@UntrackedTask(because = "Always rerun this task.")
public abstract sealed class AbstractProductionRunTask extends AbstractLoomTask permits ClientProductionRunTask, ServerProductionRunTask {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractProductionRunTask.class);

Expand Down

0 comments on commit cb8ba8f

Please sign in to comment.