Skip to content

Commit 9e0090d

Browse files
authored
Improve website building (#34)
* read Avalonia-Version from SharedVersion.props * remove unused version file * Updated Avalonia submodule to latest commit * Updated Avalonia submodule to latest commit * Updated Avalonia submodule to latest commit * Some more improvements
1 parent 972bfb8 commit 9e0090d

File tree

9 files changed

+30
-43
lines changed

9 files changed

+30
-43
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,3 +414,5 @@ website/docs/
414414
src/ApiDocumentation/Help/
415415

416416
artifacts.zip
417+
418+
website/AvaloniaVersion.txt

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "Avalonia"]
22
path = ext/Avalonia
33
url = https://github.com/AvaloniaUI/Avalonia.git
4+
branch = release/latest

AvaloniaVersion.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

build.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ param (
99
[switch]$pack
1010
)
1111

12-
$version = Get-Content ./AvaloniaVersion.txt
13-
1412
# Update git submodules.
15-
git submodule update --init --remote --depth=1 -f
1613
git submodule update --init --recursive
1714

15+
# The current Avalonia version is stored in SharedVersion.props. Read it and write it out for the website.
16+
[xml]$xmldoc = Get-Content ./ext/Avalonia/build/SharedVersion.props
17+
$version = $xmldoc.Project.PropertyGroup.Version
18+
New-item ./website/AvaloniaVersion.txt -ItemType File -Value $version -Force
19+
20+
Write-Host "Avalonia version is $version"
21+
1822
# set SHFBRoot
1923
$env:SHFBRoot = ".\src\packages\ewsoftware.shfb\2025.3.22\tools\"
2024

@@ -87,5 +91,5 @@ if($build.IsPresent){
8791

8892
# pack the md-files and version settings if pack switch is on
8993
if($pack.IsPresent){
90-
Compress-Archive -Path ./website/docs, ./website/versionSettings.js -DestinationPath ./artifacts.zip -Force
94+
Compress-Archive -Path ./website/docs, ./website/versionSettings.js, ./website/AvaloniaVersion.txt -DestinationPath ./artifacts.zip -Force
9195
}

ext/Avalonia

Submodule Avalonia updated 66 files

set-avalonia-branch.ps1

Lines changed: 0 additions & 24 deletions
This file was deleted.

set-version.ps1

Lines changed: 0 additions & 9 deletions
This file was deleted.

update-submodule.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Update submodule to upstream latest commit
2+
git submodule update --init --depth=1 --remote --force
3+
4+
# Commit changes
5+
git add .\ext\*
6+
git commit -m "Updated Avalonia submodule to latest commit"
7+
8+
# Need to fetch submodules recursive
9+
git submodule update --init --recursive
10+
11+
# The current Avalonia version is stored in SharedVersion.props. Read it and print it to the host.
12+
[xml]$xmldoc = Get-Content ./ext/Avalonia/build/SharedVersion.props
13+
$version = $xmldoc.Project.PropertyGroup.Version
14+
15+
Write-Host "Avalonia version is $version"

website/versionSettings.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
// @ts-check
22
import fs from "node:fs";
33

4-
function getAvaloniaVerison (){
4+
function getAvaloniaVersion (){
55
try {
6-
const data = fs.readFileSync('./../AvaloniaVersion.txt', {encoding: 'utf8'});
7-
return data;
6+
return fs.readFileSync('./AvaloniaVersion.txt', {encoding: 'utf8'});
87
}
98
catch (e) {
109
console.error(e);
1110
}
1211
}
1312

1413
export const versionSettings = {
15-
current: getAvaloniaVerison(),
14+
current: getAvaloniaVersion(),
1615
};

0 commit comments

Comments
 (0)