Skip to content

Commit 55565dc

Browse files
authored
Merge pull request #32 from timunie/main
Update build script
2 parents ad84ec9 + 31cda4c commit 55565dc

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.gitmodules

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

build.ps1

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ param (
1111

1212
$version = Get-Content ./AvaloniaVersion.txt
1313

14-
# Update git submodules
14+
# Update git submodules.
15+
git submodule update --init --remote --depth=1 -f
1516
git submodule update --init --recursive
16-
git submodule update --remote --recursive
17-
18-
# git submodule foreach -q --recursive 'branch="$(git config -f $toplevel.gitmodules submodule.$name.branch)"; git checkout $branch'
1917

2018
# set SHFBRoot
2119
$env:SHFBRoot = ".\src\packages\ewsoftware.shfb\2025.3.22\tools\"

set-avalonia-branch.ps1

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ if (-Not $branchName){
77
$branchName = "release/latest"
88
}
99

10-
# Update git submodules
11-
git submodule set-branch --branch $branchName ext/Avalonia
12-
git submodule sync --recursive
13-
git submodule update --init --recursive --remote
14-
git submodule foreach -q --recursive 'branch="$(git config -f $toplevel.gitmodules submodule.$name.branch)"; git checkout $branch'
10+
# make sure submodules are initialized yet
11+
git submodule update --init --recursive
12+
13+
# change dir into Avalonia submodule and checkout requested branch.
14+
Set-Location .\ext\Avalonia
15+
git fetch
16+
git checkout $branchName
17+
Set-Location ..\..
1518

16-
git add .\.gitmodules
17-
git add .\ext\*
19+
# Commit changes
20+
git add .\ext\*
21+
git commit -m "Updated Avalonia submodule to target branch $branchName"
22+
23+
# Update git submodules
24+
git submodule update --init --recursive --force

0 commit comments

Comments
 (0)