Skip to content

Commit

Permalink
[FEATURE] specVersion 2.5
Browse files Browse the repository at this point in the history
Adds support for build configuration includeDependency

JIRA: CPOUI5FOUNDATION-208
  • Loading branch information
larskissel committed Jul 23, 2021
1 parent 7431f47 commit 3008dac
Show file tree
Hide file tree
Showing 26 changed files with 1,166 additions and 144 deletions.
6 changes: 4 additions & 2 deletions lib/projectPreprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ class ProjectPreprocessor {
if (project.specVersion !== "0.1" && project.specVersion !== "1.0" &&
project.specVersion !== "1.1" && project.specVersion !== "2.0" &&
project.specVersion !== "2.1" && project.specVersion !== "2.2" &&
project.specVersion !== "2.3" && project.specVersion !== "2.4") {
project.specVersion !== "2.3" && project.specVersion !== "2.4" &&
project.specVersion !== "2.5") {
throw new Error(
`Unsupported specification version ${project.specVersion} defined for project ` +
`${project.id}. Your UI5 CLI installation might be outdated. ` +
Expand Down Expand Up @@ -362,7 +363,8 @@ class ProjectPreprocessor {
extension.specVersion !== "2.1" &&
extension.specVersion !== "2.2" &&
extension.specVersion !== "2.3" &&
extension.specVersion !== "2.4") {
extension.specVersion !== "2.4" &&
extension.specVersion !== "2.5") {
throw new Error(
`Unsupported specification version ${extension.specVersion} defined for extension ` +
`${extension.metadata.name}. Your UI5 CLI installation might be outdated. ` +
Expand Down
4 changes: 2 additions & 2 deletions lib/translators/ui5Framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const utils = {
if (
project.specVersion !== "2.0" && project.specVersion !== "2.1" &&
project.specVersion !== "2.2" && project.specVersion !== "2.3" &&
project.specVersion !== "2.4"
project.specVersion !== "2.4" && project.specVersion !== "2.5"
) {
log.warn(`Project ${project.metadata.name} defines invalid ` +
`specification version ${project.specVersion} for framework.libraries configuration`);
Expand Down Expand Up @@ -254,7 +254,7 @@ module.exports = {
(
project.specVersion === "2.0" || project.specVersion === "2.1" ||
project.specVersion === "2.2" || project.specVersion === "2.3" ||
project.specVersion === "2.4"
project.specVersion === "2.4" || project.specVersion === "2.5"
) && project.framework && project.framework.libraries) {
const frameworkDeps = project.framework.libraries
.filter((dependency) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/validation/schema/specVersion/2.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "object",
"required": ["specVersion"],
"properties": {
"specVersion": { "enum": ["2.4", "2.3", "2.2", "2.1", "2.0"] },
"specVersion": { "enum": ["2.5", "2.4", "2.3", "2.2", "2.1", "2.0"] },
"kind": {
"enum": ["project", "extension", null],
"$comment": "Using null to allow not defining 'kind' which defaults to project"
Expand Down
2 changes: 1 addition & 1 deletion lib/validation/schema/specVersion/2.0/kind/extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "object",
"required": ["specVersion", "kind", "type", "metadata"],
"properties": {
"specVersion": { "enum": ["2.4", "2.3", "2.2", "2.1", "2.0"] },
"specVersion": { "enum": ["2.5", "2.4", "2.3", "2.2", "2.1", "2.0"] },
"kind": {
"enum": ["extension"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"required": ["specVersion", "kind", "type", "metadata", "shims"],
"if": {
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4"] }
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": {
"enum": ["2.1", "2.2", "2.3", "2.4"]
"enum": ["2.1", "2.2", "2.3", "2.4", "2.5"]
},
"kind": {
"enum": ["extension"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"required": ["specVersion", "kind", "type", "metadata", "middleware"],
"if": {
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4"] }
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4"] },
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5"] },
"kind": {
"enum": ["extension"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"required": ["specVersion", "kind", "type", "metadata", "task"],
"if": {
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4"] }
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4"] },
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5"] },
"kind": {
"enum": ["extension"]
},
Expand Down
26 changes: 25 additions & 1 deletion lib/validation/schema/specVersion/2.0/kind/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "object",
"required": ["specVersion", "type"],
"properties": {
"specVersion": { "enum": ["2.4", "2.3", "2.2", "2.1", "2.0"] },
"specVersion": { "enum": ["2.5", "2.4", "2.3", "2.2", "2.1", "2.0"] },
"kind": {
"enum": ["project", null],
"$comment": "Using null to allow not defining 'kind' which defaults to project"
Expand Down Expand Up @@ -505,6 +505,30 @@
}
]
}
},
"builder-settings": {
"type": "object",
"additionalProperties": false,
"properties": {
"includeDependency": {
"type": "array",
"items": {
"type": "string"
}
},
"includeDependencyRegExp": {
"type": "array",
"items": {
"type": "string"
}
},
"includeDependencyTree": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
132 changes: 100 additions & 32 deletions lib/validation/schema/specVersion/2.0/kind/project/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"required": ["specVersion", "type", "metadata"],
"if": {
"properties": {
"specVersion": { "enum": ["2.4"] }
"specVersion": { "enum": ["2.5"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["2.4"] },
"specVersion": { "enum": ["2.5"] },
"kind": {
"enum": ["project", null]
},
Expand All @@ -29,7 +29,7 @@
"$ref": "#/definitions/resources"
},
"builder": {
"$ref": "#/definitions/builder-specVersion-2.4"
"$ref": "#/definitions/builder-specVersion-2.5"
},
"server": {
"$ref": "../project.json#/definitions/server"
Expand All @@ -43,13 +43,13 @@
"else": {
"if": {
"properties": {
"specVersion": { "enum": ["2.3"] }
"specVersion": { "enum": ["2.4"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["2.3"] },
"specVersion": { "enum": ["2.4"] },
"kind": {
"enum": ["project", null]
},
Expand All @@ -66,7 +66,7 @@
"$ref": "#/definitions/resources"
},
"builder": {
"$ref": "#/definitions/builder-specVersion-2.3"
"$ref": "#/definitions/builder-specVersion-2.4"
},
"server": {
"$ref": "../project.json#/definitions/server"
Expand All @@ -80,13 +80,13 @@
"else": {
"if": {
"properties": {
"specVersion": { "enum": ["2.1", "2.2"] }
"specVersion": { "enum": ["2.3"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["2.1", "2.2"] },
"specVersion": { "enum": ["2.3"] },
"kind": {
"enum": ["project", null]
},
Expand All @@ -103,7 +103,7 @@
"$ref": "#/definitions/resources"
},
"builder": {
"$ref": "#/definitions/builder"
"$ref": "#/definitions/builder-specVersion-2.3"
},
"server": {
"$ref": "../project.json#/definitions/server"
Expand All @@ -115,29 +115,67 @@
}
},
"else": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["2.0"] },
"kind": {
"enum": ["project", null]
},
"type": {
"enum": ["application"]
},
"metadata": {
"$ref": "../project.json#/definitions/metadata"
},
"framework": {
"$ref": "../project.json#/definitions/framework"
},
"resources": {
"$ref": "#/definitions/resources"
},
"builder": {
"$ref": "#/definitions/builder"
},
"server": {
"$ref": "../project.json#/definitions/server"
"if": {
"properties": {
"specVersion": { "enum": ["2.1", "2.2"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["2.1", "2.2"] },
"kind": {
"enum": ["project", null]
},
"type": {
"enum": ["application"]
},
"metadata": {
"$ref": "../project.json#/definitions/metadata"
},
"framework": {
"$ref": "../project.json#/definitions/framework"
},
"resources": {
"$ref": "#/definitions/resources"
},
"builder": {
"$ref": "#/definitions/builder"
},
"server": {
"$ref": "../project.json#/definitions/server"
},
"customConfiguration": {
"type": "object",
"additionalProperties": true
}
}
},
"else": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["2.0"] },
"kind": {
"enum": ["project", null]
},
"type": {
"enum": ["application"]
},
"metadata": {
"$ref": "../project.json#/definitions/metadata"
},
"framework": {
"$ref": "../project.json#/definitions/framework"
},
"resources": {
"$ref": "#/definitions/resources"
},
"builder": {
"$ref": "#/definitions/builder"
},
"server": {
"$ref": "../project.json#/definitions/server"
}
}
}
}
Expand Down Expand Up @@ -251,6 +289,36 @@
"$ref": "../project.json#/definitions/customTasks"
}
}
},
"builder-specVersion-2.5": {
"type": "object",
"additionalProperties": false,
"properties": {
"resources": {
"$ref": "../project.json#/definitions/builder-resources"
},
"cachebuster": {
"type": "object",
"additionalProperties": false,
"properties": {
"signatureType": {
"enum": ["time", "hash"]
}
}
},
"bundles": {
"$ref": "../project.json#/definitions/builder-bundles-2.4"
},
"componentPreload": {
"$ref": "../project.json#/definitions/builder-componentPreload-specVersion-2.3"
},
"customTasks": {
"$ref": "../project.json#/definitions/customTasks"
},
"settings": {
"$ref": "../project.json#/definitions/builder-settings"
}
}
}
}
}
Loading

0 comments on commit 3008dac

Please sign in to comment.