Skip to content

Commit

Permalink
feat(nx-flutter): make all build executors results cacheable
Browse files Browse the repository at this point in the history
This allows leveraring Nx's computation cache and distributed caching
  • Loading branch information
tinesoft committed Aug 5, 2022
1 parent 9d35de1 commit a08dbb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/nx-flutter/src/generators/project/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ describe('application generator', () => {
commands.forEach(e => {
expect(project.targets[e.key].executor).toBe('@nrwl/workspace:run-commands');
expect(project.targets[e.key].options.command).toBe(`flutter ${e.value}`);
if(e.key.startsWith('build-')) {
expect(project.targets[e.key].outputs).toEqual([`${project.root}/build`]);
}
});
});

Expand Down
4 changes: 3 additions & 1 deletion packages/nx-flutter/src/generators/project/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export async function projectGenerator(tree:Tree, options: ProjectGeneratorOptio
options: {
command: `flutter ${command.value}`,
cwd: normalizedOptions.projectRoot
}
},
...( command.key.startsWith('build-') ? {outputs: [`${normalizedOptions.projectRoot}/build`]}: {})

};
}
addProjectConfiguration(tree, normalizedOptions.projectName, {
Expand Down

0 comments on commit a08dbb8

Please sign in to comment.