Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# perform crlf normalization on batch and cmd files
*.ps1 eol=crlf
*.psm1 eol=crlf
*.bat eol=crlf
*.cmd eol=crlf
*.sh eol=lf
*.sh eol=lf
26 changes: 26 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"lsp": {
"yaml-language-server": {
"settings": {
"yaml": {
"customTags": [
"!run: mapping",
"!registryKey: mapping",
"!registryValue: mapping",
"!appx: mapping",
"!file: mapping",
"!service: mapping",
"!scheduledTask: mapping",
"!taskKill: mapping",
"!systemPackage: mapping",
"!cmd: mapping",
"!powerShell: mapping",
"!writeStatus: mapping",
"!writeStatus mapping",
"!task: mapping"
]
}
}
}
}
}
22 changes: 22 additions & 0 deletions .zed/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"label": "Build Playbook (Test)",
"command": "Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force; $repo = if (Test-Path '$ZED_WORKTREE_ROOT/src/dependencies/local-build.ps1') { '$ZED_WORKTREE_ROOT' } elseif (Test-Path '$ZED_WORKTREE_ROOT/atlas/src/dependencies/local-build.ps1') { '$ZED_WORKTREE_ROOT/atlas' } else { throw 'Could not find Atlas repo root from ZED_WORKTREE_ROOT.' }; Set-Location \"$repo/src/playbook\"; & \"$repo/src/dependencies/local-build.ps1\" -AddLiveLog -ReplaceOldPlaybook -Removals WinverRequirement, Verification",
"cwd": "$ZED_WORKTREE_ROOT"
},
{
"label": "Build Playbook (Test w/o deps)",
"command": "Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force; $repo = if (Test-Path '$ZED_WORKTREE_ROOT/src/dependencies/local-build.ps1') { '$ZED_WORKTREE_ROOT' } elseif (Test-Path '$ZED_WORKTREE_ROOT/atlas/src/dependencies/local-build.ps1') { '$ZED_WORKTREE_ROOT/atlas' } else { throw 'Could not find Atlas repo root from ZED_WORKTREE_ROOT.' }; Set-Location \"$repo/src/playbook\"; & \"$repo/src/dependencies/local-build.ps1\" -AddLiveLog -ReplaceOldPlaybook -Removals Dependencies, WinverRequirement, Verification",
"cwd": "$ZED_WORKTREE_ROOT"
},
{
"label": "Build Playbook (Release)",
"command": "Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force; $repo = if (Test-Path '$ZED_WORKTREE_ROOT/src/dependencies/local-build.ps1') { '$ZED_WORKTREE_ROOT' } elseif (Test-Path '$ZED_WORKTREE_ROOT/atlas/src/dependencies/local-build.ps1') { '$ZED_WORKTREE_ROOT/atlas' } else { throw 'Could not find Atlas repo root from ZED_WORKTREE_ROOT.' }; Set-Location \"$repo/src/playbook\"; & \"$repo/src/dependencies/local-build.ps1\" -FileName 'Atlas Release'",
"cwd": "$ZED_WORKTREE_ROOT"
},
{
"label": "Build Playbook (Release Candidate)",
"command": "Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force; $repo = if (Test-Path '$ZED_WORKTREE_ROOT/src/dependencies/local-build.ps1') { '$ZED_WORKTREE_ROOT' } elseif (Test-Path '$ZED_WORKTREE_ROOT/atlas/src/dependencies/local-build.ps1') { '$ZED_WORKTREE_ROOT/atlas' } else { throw 'Could not find Atlas repo root from ZED_WORKTREE_ROOT.' }; Set-Location \"$repo/src/playbook\"; & \"$repo/src/dependencies/local-build.ps1\" -FileName 'Atlas RC' -ReplaceOldPlaybook -Removals Verification",
"cwd": "$ZED_WORKTREE_ROOT"
}
]
33 changes: 22 additions & 11 deletions src/dependencies/local-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,11 @@ try {
}
}

# update the oem version so the wizard displays the correct build tag
# update the oem version so Settings/winver display the correct build tag
$oemYmlRelativePath = Join-Path -Path (Join-Path -Path 'Configuration' -ChildPath 'tweaks') -ChildPath (Join-Path -Path 'misc' -ChildPath 'config-oem-information.yml')
if (Test-Path -LiteralPath $oemYmlRelativePath -PathType Leaf) {
$oemScriptRelativePath = Join-Path -Path (Join-Path -Path (Join-Path -Path 'Executables' -ChildPath 'AtlasModules') -ChildPath 'Scripts') -ChildPath (Join-Path -Path 'Tasks' -ChildPath 'Set-OemInformation.ps1')
$oemVersionFiles = @($oemYmlRelativePath, $oemScriptRelativePath)
if ($oemVersionFiles | Where-Object { Test-Path -LiteralPath $_ -PathType Leaf }) {
try {
$confXml = [xml](Get-Content -Path 'playbook.conf' -Raw -Encoding UTF8)
$playbookNode = $confXml.Playbook
Expand All @@ -418,16 +420,25 @@ try {
$versionLabel += ' (dev)'
}

$oemContent = Get-Content -Path $oemYmlRelativePath -Raw -Encoding UTF8
$updatedOemContent = $oemContent -replace 'AtlasVersionUndefined', $versionLabel
$updatedOemVersion = $false
foreach ($oemVersionFile in $oemVersionFiles) {
if (-not (Test-Path -LiteralPath $oemVersionFile -PathType Leaf)) {
continue
}

$oemContent = Get-Content -Path $oemVersionFile -Raw -Encoding UTF8
$updatedOemContent = $oemContent -replace 'AtlasVersionUndefined', $versionLabel

if ($updatedOemContent -ne $oemContent) {
$playbookTempPath = Get-PlaybookTempPath
$tempOemYmlPath = Join-Path -Path $playbookTempPath -ChildPath $oemYmlRelativePath
Set-ParentDirectory -Path $tempOemYmlPath
Set-Content -Path $tempOemYmlPath -Value $updatedOemContent -Encoding UTF8
if ($updatedOemContent -ne $oemContent) {
$playbookTempPath = Get-PlaybookTempPath
$tempOemPath = Join-Path -Path $playbookTempPath -ChildPath $oemVersionFile
Set-ParentDirectory -Path $tempOemPath
Set-Content -Path $tempOemPath -Value $updatedOemContent -Encoding UTF8
$updatedOemVersion = $true
}
}
else {

if (-not $updatedOemVersion) {
Write-Warning "Couldn't find OEM string 'AtlasVersionUndefined', not updating OEM version."
}
}
Expand All @@ -440,7 +451,7 @@ try {
}
}
else {
Write-Warning "Can't find '$oemYmlRelativePath', not setting OEM version."
Write-Warning "Can't find an OEM version file, not setting OEM version."
}

# skip local script + staged overrides so we dont pack duplicates
Expand Down
Loading