-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] generateThemeDesignerResources: Allow core .theming in sources (#…
…1062) This change respects an sap.ui.core library .theming file from the sources instead of simply overwriting the file. It allows the configuration to be put into the library and adjusted there instead of having to adjust it in the build task. The existing logic is kept to support older UI5 versions where the file is not available in the sources. JIRA: CPOUI5FOUNDATION-862 (cherry picked from commit dda3011)
- Loading branch information
Showing
6 changed files
with
488 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export async function updateLibraryDotTheming({resource, namespace, version, hasThemes}) { | ||
const dotTheming = JSON.parse(await resource.getString()); | ||
|
||
if (!dotTheming.sEntity) { | ||
throw new Error(`Missing 'sEntity' property in ${resource.getPath()}`); | ||
} | ||
|
||
if (dotTheming.sEntity !== "Library") { | ||
throw new Error( | ||
`Incorrect 'sEntity' value '${dotTheming.sEntity}' in ${resource.getPath()}: ` + | ||
`Expected 'Library'` | ||
); | ||
} | ||
|
||
if (!dotTheming.sId) { | ||
throw new Error(`Missing 'sId' property in ${resource.getPath()}`); | ||
} | ||
|
||
if (dotTheming.sId !== namespace) { | ||
throw new Error(`Incorrect 'sId' value '${dotTheming.sId}' in ${resource.getPath()}: Expected '${namespace}'`); | ||
} | ||
|
||
dotTheming.sVersion = version; | ||
|
||
if (!hasThemes) { | ||
// Set ignore flag when there are no themes at all | ||
// This is important in case a library used to contain themes that have been removed | ||
// in a later version of the library. | ||
dotTheming.bIgnore = true; | ||
} | ||
|
||
resource.setString(JSON.stringify(dotTheming, null, 2)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.