@ui5/task-adaptation
Version:
Custom task for ui5-builder which allows building UI5 Flexibility Adaptation Projects for SAP BTP, Cloud Foundry environment
39 lines • 1.5 kB
JavaScript
import Language from "../model/language.js";
import { validateObject } from "../util/commonUtil.js";
export default class AbapProcessor {
abapRepoManager;
configuration;
cacheManager;
annotationManager;
constructor(configuration, cacheManager, abapRepoManager, annotationManager) {
this.configuration = configuration;
this.abapRepoManager = abapRepoManager;
this.cacheManager = cacheManager;
this.annotationManager = annotationManager;
}
getBaseAppFiles(baseAppId) {
return this.cacheManager.getFiles(() => this.abapRepoManager.getMetadata(baseAppId), () => this.abapRepoManager.downloadBaseAppFiles());
}
validateConfiguration() {
// validate general app config
const properties = ["appName"];
validateObject(this.configuration, properties, "should be specified in ui5.yaml configuration");
}
async updateLandscapeSpecificContent(renamedBaseAppManifest, baseAppFiles) {
const files = await this.annotationManager.process(renamedBaseAppManifest, (Language.create(this.configuration.languages)));
if (baseAppFiles) {
files.forEach((value, key) => baseAppFiles.set(key, value));
}
}
getConfigurationType() {
return "abap";
}
createAppVariantHierarchyItem(appVariantId, version) {
return {
appVariantId,
version,
layer: "VENDOR"
};
}
}
//# sourceMappingURL=abapProcessor.js.map