Skip to content

Commit

Permalink
And back to the old ways.
Browse files Browse the repository at this point in the history
  • Loading branch information
marchermans committed Jul 28, 2024
1 parent 4766436 commit e649903
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,10 @@ private Function<ICacheableJob<?,?>, CacheStatus> shouldExecuteCachedFor(Task ta
if (!cache.restoreTo(stage.output())) {
//No cache restore was needed, we can skip the stage
logger.onCacheEquals(stage);
GradleInternalUtils.setTaskUpToDate(targetTask, "NeoGradle Cache: Output already exists");
} else {
GradleInternalUtils.setTaskFromCache(targetTask, "NeoGradle Cache: Restored from cache");
}

targetTask.setDidWork(false);

//The cache was restored successfully, we do not need to execute the stage
return CacheStatus.cachedWithLock(lock);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,6 @@ public static ProgressLoggerWrapper getProgressLogger(final Logger logger, final
}
}

public static void setTaskUpToDate(Task targetTask, final String reason) {
((TaskStateInternal) targetTask.getState()).setOutcome(TaskExecutionOutcome.UP_TO_DATE);
((TaskStateInternal) targetTask.getState()).setSkipReasonMessage(reason);
((TaskStateInternal) targetTask.getState()).setDidWork(false);

}

public static void setTaskFromCache(Task targetTask, String reason) {
((TaskStateInternal) targetTask.getState()).setOutcome(TaskExecutionOutcome.FROM_CACHE);
((TaskStateInternal) targetTask.getState()).setSkipReasonMessage(reason);
((TaskStateInternal) targetTask.getState()).setDidWork(false);
}

/**
* A wrapper for a progress logger.
* The usage of this logger varies between gradle versions a tiny bit, so we use reflection to handle it.
Expand Down

0 comments on commit e649903

Please sign in to comment.