Skip to content

Commit f3f484d

Browse files
committed
refactor(builder): Rename task param 'buildCache' to 'cacheUtil'
1 parent 9e8f574 commit f3f484d

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

packages/builder/lib/tasks/minify.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import fsInterface from "@ui5/fs/fsInterface";
1616
* @param {object} parameters Parameters
1717
* @param {@ui5/fs/DuplexCollection} parameters.workspace DuplexCollection to read and write files
1818
* @param {@ui5/project/build/helpers/TaskUtil|object} [parameters.taskUtil] TaskUtil
19+
* @param {object} [parameters.cacheUtil] Cache utility instance
1920
* @param {object} parameters.options Options
2021
* @param {string} parameters.options.pattern Pattern to locate the files to be processed
2122
* @param {boolean} [parameters.options.omitSourceMapResources=false] Whether source map resources shall
@@ -26,12 +27,12 @@ import fsInterface from "@ui5/fs/fsInterface";
2627
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
2728
*/
2829
export default async function({
29-
workspace, taskUtil, buildCache,
30+
workspace, taskUtil, cacheUtil,
3031
options: {pattern, omitSourceMapResources = false, useInputSourceMaps = true}
3132
}) {
3233
let resources = await workspace.byGlob(pattern);
33-
if (buildCache.hasCache()) {
34-
const changedPaths = buildCache.getChangedProjectResourcePaths();
34+
if (cacheUtil.hasCache()) {
35+
const changedPaths = cacheUtil.getChangedProjectResourcePaths();
3536
resources = resources.filter((resource) => changedPaths.has(resource.getPath()));
3637
}
3738
if (resources.length === 0) {

packages/builder/lib/tasks/replaceBuildtime.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ function getTimestamp() {
2828
*
2929
* @param {object} parameters Parameters
3030
* @param {@ui5/fs/DuplexCollection} parameters.workspace DuplexCollection to read and write files
31+
* @param {object} [parameters.cacheUtil] Cache utility instance
3132
* @param {object} parameters.options Options
3233
* @param {string} parameters.options.pattern Pattern to locate the files to be processed
3334
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
3435
*/
35-
export default async function({workspace, buildCache, options: {pattern}}) {
36+
export default async function({workspace, cacheUtil, options: {pattern}}) {
3637
let resources = await workspace.byGlob(pattern);
3738

38-
if (buildCache.hasCache()) {
39-
const changedPaths = buildCache.getChangedProjectResourcePaths();
39+
if (cacheUtil.hasCache()) {
40+
const changedPaths = cacheUtil.getChangedProjectResourcePaths();
4041
resources = resources.filter((resource) => changedPaths.has(resource.getPath()));
4142
}
4243
const timestamp = getTimestamp();

packages/builder/lib/tasks/replaceCopyright.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ import stringReplacer from "../processors/stringReplacer.js";
2424
*
2525
* @param {object} parameters Parameters
2626
* @param {@ui5/fs/DuplexCollection} parameters.workspace DuplexCollection to read and write files
27+
* @param {object} [parameters.cacheUtil] Cache utility instance
2728
* @param {object} parameters.options Options
2829
* @param {string} parameters.options.copyright Replacement copyright
2930
* @param {string} parameters.options.pattern Pattern to locate the files to be processed
3031
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
3132
*/
32-
export default async function({workspace, buildCache, options: {copyright, pattern}}) {
33+
export default async function({workspace, cacheUtil, options: {copyright, pattern}}) {
3334
if (!copyright) {
3435
return;
3536
}
@@ -38,8 +39,8 @@ export default async function({workspace, buildCache, options: {copyright, patte
3839
copyright = copyright.replace(/(?:\$\{currentYear\})/, new Date().getFullYear());
3940

4041
let resources = await workspace.byGlob(pattern);
41-
if (buildCache.hasCache()) {
42-
const changedPaths = buildCache.getChangedProjectResourcePaths();
42+
if (cacheUtil.hasCache()) {
43+
const changedPaths = cacheUtil.getChangedProjectResourcePaths();
4344
resources = resources.filter((resource) => changedPaths.has(resource.getPath()));
4445
}
4546

packages/builder/lib/tasks/replaceVersion.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ import stringReplacer from "../processors/stringReplacer.js";
1414
*
1515
* @param {object} parameters Parameters
1616
* @param {@ui5/fs/DuplexCollection} parameters.workspace DuplexCollection to read and write files
17+
* @param {object} parameters.cacheUtil Cache utility instance
1718
* @param {object} parameters.options Options
1819
* @param {string} parameters.options.pattern Pattern to locate the files to be processed
1920
* @param {string} parameters.options.version Replacement version
2021
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
2122
*/
22-
export default async function({workspace, buildCache, options: {pattern, version}}) {
23+
export default async function({workspace, cacheUtil, options: {pattern, version}}) {
2324
let resources = await workspace.byGlob(pattern);
2425

25-
if (buildCache.hasCache()) {
26-
const changedPaths = buildCache.getChangedProjectResourcePaths();
26+
if (cacheUtil.hasCache()) {
27+
const changedPaths = cacheUtil.getChangedProjectResourcePaths();
2728
resources = resources.filter((resource) => changedPaths.has(resource.getPath()));
2829
}
2930
const processedResources = await stringReplacer({

0 commit comments

Comments
 (0)