-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Sapui5MavenSnapshotResolver: Expose cacheMode parameter through all APIs #607
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,8 @@ const log = getLogger("generateProjectGraph"); | |
* Whether framework dependencies should be added to the graph | ||
* @param {string} [options.workspaceName] | ||
* Name of the workspace configuration that should be used if any is provided | ||
* @param {module:@ui5/project/ui5Framework/maven/CacheMode} [options.cacheMode] | ||
* Cache mode to use when consuming SNAPSHOT versions of a framework | ||
* @param {string} [options.workspaceConfigPath=ui5-workspace.yaml] | ||
* Workspace configuration file to use if no object has been provided | ||
* @param {@ui5/project/graph/Workspace~Configuration} [options.workspaceConfiguration] | ||
|
@@ -40,7 +42,7 @@ const log = getLogger("generateProjectGraph"); | |
*/ | ||
export async function graphFromPackageDependencies({ | ||
cwd, rootConfiguration, rootConfigPath, | ||
versionOverride, resolveFrameworkDependencies = true, | ||
versionOverride, cacheMode, resolveFrameworkDependencies = true, | ||
workspaceName /* TODO 4.0: default workspaceName to "default" ? */, | ||
workspaceConfiguration, workspaceConfigPath = "ui5-workspace.yaml" | ||
}) { | ||
|
@@ -71,7 +73,7 @@ export async function graphFromPackageDependencies({ | |
const projectGraph = await projectGraphBuilder(provider, workspace); | ||
|
||
if (resolveFrameworkDependencies) { | ||
await ui5Framework.enrichProjectGraph(projectGraph, {versionOverride, workspace}); | ||
await ui5Framework.enrichProjectGraph(projectGraph, {versionOverride, cacheMode, workspace}); | ||
} | ||
|
||
return projectGraph; | ||
|
@@ -93,14 +95,16 @@ export async function graphFromPackageDependencies({ | |
* Configuration file to use for the root module instead the default ui5.yaml. Either a path relative to | ||
* <code>cwd</code> or an absolute path. In both case, platform-specific path segment separators must be used. | ||
* @param {string} [options.versionOverride] Framework version to use instead of the one defined in the root project | ||
* @param {module:@ui5/project/ui5Framework/maven/CacheMode} [options.cacheMode] | ||
* Cache mode to use when consuming SNAPSHOT versions | ||
* @param {string} [options.resolveFrameworkDependencies=true] | ||
* Whether framework dependencies should be added to the graph | ||
* @returns {Promise<@ui5/project/graph/ProjectGraph>} Promise resolving to a Project Graph instance | ||
*/ | ||
export async function graphFromStaticFile({ | ||
filePath = "projectDependencies.yaml", cwd, | ||
rootConfiguration, rootConfigPath, | ||
versionOverride, resolveFrameworkDependencies = true | ||
versionOverride, cacheMode, resolveFrameworkDependencies = true | ||
}) { | ||
log.verbose(`Creating project graph using static file...`); | ||
const { | ||
|
@@ -121,7 +125,7 @@ export async function graphFromStaticFile({ | |
const projectGraph = await projectGraphBuilder(provider); | ||
|
||
if (resolveFrameworkDependencies) { | ||
await ui5Framework.enrichProjectGraph(projectGraph, {versionOverride}); | ||
await ui5Framework.enrichProjectGraph(projectGraph, {versionOverride, cacheMode}); | ||
} | ||
|
||
return projectGraph; | ||
|
@@ -143,14 +147,16 @@ export async function graphFromStaticFile({ | |
* Configuration file to use for the root module instead the default ui5.yaml. Either a path relative to | ||
* <code>cwd</code> or an absolute path. In both case, platform-specific path segment separators must be used. | ||
* @param {string} [options.versionOverride] Framework version to use instead of the one defined in the root project | ||
* @param {module:@ui5/project/ui5Framework/maven/CacheMode} [options.cacheMode] | ||
* Cache mode to use when consuming SNAPSHOT versions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
* @param {string} [options.resolveFrameworkDependencies=true] | ||
* Whether framework dependencies should be added to the graph | ||
* @returns {Promise<@ui5/project/graph/ProjectGraph>} Promise resolving to a Project Graph instance | ||
*/ | ||
export async function graphFromObject({ | ||
dependencyTree, cwd, | ||
rootConfiguration, rootConfigPath, | ||
versionOverride, resolveFrameworkDependencies = true | ||
versionOverride, cacheMode, resolveFrameworkDependencies = true | ||
}) { | ||
log.verbose(`Creating project graph using object...`); | ||
const { | ||
|
@@ -169,7 +175,7 @@ export async function graphFromObject({ | |
const projectGraph = await projectGraphBuilder(dependencyTreeProvider); | ||
|
||
if (resolveFrameworkDependencies) { | ||
await ui5Framework.enrichProjectGraph(projectGraph, {versionOverride}); | ||
await ui5Framework.enrichProjectGraph(projectGraph, {versionOverride, cacheMode}); | ||
} | ||
|
||
return projectGraph; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
|
||
/** | ||
* Cache modes for maven consumption | ||
* | ||
* @public | ||
flovogt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* @readonly | ||
* @enum {string} | ||
* @property {string} Default Cache everything, invalidate after 9 hours | ||
* @property {string} Force Use cache only | ||
* @property {string} Off Do not use the cache | ||
* @module @ui5/project/ui5Framework/maven/CacheMode | ||
*/ | ||
export default { | ||
Default: "Default", | ||
Force: "Force", | ||
Off: "Off" | ||
}; |
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done