Skip to content

Commit

Permalink
fix(gradle): only allow certain types of task to be cached (#22559)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed Mar 28, 2024
1 parent 71a0b0d commit b051bbf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/gradle/src/plugin/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { projectGraphCacheDirectory } from 'nx/src/utils/cache-directory';
import { getGradleBinaryPath } from '../utils/exec-gradle';
import { getGradleReport } from '../utils/get-gradle-report';

const cacheableTaskType = new Set(['Build', 'Verification']);
const dependsOnMap = {
build: ['^build', 'classes'],
test: ['classes'],
Expand Down Expand Up @@ -184,7 +185,7 @@ function createGradleTargets(
options: {
cwd: projectRoot,
},
cache: !!outputs,
cache: cacheableTaskType.has(task.type),
inputs: inputsMap[task.name],
outputs: outputs ? [outputs] : undefined,
dependsOn: dependsOnMap[task.name],
Expand Down

0 comments on commit b051bbf

Please sign in to comment.