Skip to content

Commit a4e0732

Browse files
(MAINT) Define build data per-project
Prior to this change, any updates to project build configuration needed to land in the root `build.data.psd1` file. This made it relatively easy to forget to update the configuration when working on a specific project. This change: 1. Defines the configuration on a per-project basis in newly defined `.project.data.json` files. These files contain the build metadata for each project _except_ for the `RelativePath` field. 1. Replaces the root `build.data.psd1` file with `build.data.json` containing the same data. 1. Defines JSON Schemas to validate and provide in-editor help for modifying and creating new project data files and modifying the root build data file. 1. Updates the build helpers to work with JSON data files instead of the PSD1. 1. Provides a model to retrieve updated project data for use in the build script, even when the root build data file hasn't been updated yet. 1. Defines the helper function `Update-DscBuildData` to pull changes from the per-project data files into the root build data file. Except for using the JSON files, this change doesn't modify the build behavior. This change doesn't remove the `copy_files.txt` files, though they are now redundant with the project data files. Once we remove the old build script, the `copy_files.txt` files should also be removed.
1 parent ce56e6f commit a4e0732

File tree

35 files changed

+1331
-425
lines changed

35 files changed

+1331
-425
lines changed

.vscode/schemas/build.data.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$ref": "./definitions.json#/$defs/BuildDataFile"
4+
}

.vscode/schemas/definitions.json

Lines changed: 296 additions & 0 deletions
Large diffs are not rendered by default.

.vscode/schemas/project.data.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$ref": "./definitions.json#/$defs/ProjectDataFile"
4+
}

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
{
55
"fileMatch": ["**/*.dsc.resource.json"],
66
"url": "/schemas/v3/bundled/resource/manifest.vscode.json"
7+
},
8+
{
9+
"fileMatch": ["build.data.json"],
10+
"url": "./.vscode/schemas/build.data.json"
11+
},
12+
{
13+
"fileMatch": ["**/.project.data.json"],
14+
"url": "./.vscode/schemas/project.data.json"
715
}
816
],
917
"yaml.schemas": {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"Name": "powershell-adapter",
3+
"Kind": "Adapter",
4+
"CopyFiles": {
5+
"All": [
6+
"psDscAdapter/powershell.resource.ps1",
7+
"psDscAdapter/psDscAdapter.psd1",
8+
"psDscAdapter/psDscAdapter.psm1",
9+
"powershell.dsc.resource.json"
10+
],
11+
"Windows": [
12+
"psDscAdapter/win_psDscAdapter.psd1",
13+
"psDscAdapter/win_psDscAdapter.psm1",
14+
"windowspowershell.dsc.resource.json"
15+
]
16+
}
17+
}

adapters/wmi/.project.data.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"Name": "wmi",
3+
"Kind": "Adapter",
4+
"SupportedPlatformOS": "Windows",
5+
"CopyFiles": {
6+
"Windows": [
7+
"wmi.resource.ps1",
8+
"wmiAdapter.psd1",
9+
"wmiAdapter.psm1",
10+
"wmi.dsc.resource.json"
11+
]
12+
}
13+
}

0 commit comments

Comments
 (0)