Skip to content

Commit

Permalink
[INTERNAL] replaceVersion: Also process css files
Browse files Browse the repository at this point in the history
Follow-up of #693
There are use cases for a version placeholder in *.css files.

This also adds some basic tests for placeholder replacements during
a library build.
  • Loading branch information
matz3 committed Mar 10, 2022
1 parent a43f9ba commit 0998e1e
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/types/library/LibraryBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class LibraryBuilder extends AbstractBuilder {
workspace: resourceCollections.workspace,
options: {
version: project.version,
pattern: "/**/*.{js,json,library,less,theme,html}"
pattern: "/**/*.{js,json,library,css,less,theme,html}"
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
console.log('HelloWorld');

// 1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-xxx SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
1.0.0
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!--
UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-xxx SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
1.0.0
-->
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-xxx SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
1.0.0
*/
2 changes: 2 additions & 0 deletions test/fixtures/library.e/src/library/e/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
* ${copyright}
*/
console.log('HelloWorld');

// ${version}
2 changes: 1 addition & 1 deletion test/fixtures/library.e/src/library/e/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "library",
"embeds": [],
"applicationVersion": {
"version": "1.0.0"
"version": "${version}"
},
"title": "Library E",
"description": "Library E",
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/library.e/test/library/e/Test.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
${copyright}
${version}
*/
4 changes: 4 additions & 0 deletions test/fixtures/library.e/test/library/e/Test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!--
${copyright}
${version}
-->
4 changes: 4 additions & 0 deletions test/fixtures/library.e/test/library/e/Test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*
${copyright}
${version}
*/

0 comments on commit 0998e1e

Please sign in to comment.