mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-08 17:42:31 +02:00
Build script
This commit is contained in:
@@ -195,11 +195,11 @@ $stopWatch.Start()
|
||||
$software = "UVtools"
|
||||
$project = "UVtools.WPF"
|
||||
$buildWith = "Release"
|
||||
$netFolder = "net6.0"
|
||||
$netVersion = "6.0"
|
||||
$rootFolder = $(Get-Location)
|
||||
$buildFolder = "$rootFolder\build"
|
||||
$releaseFolder = "$project\bin\$buildWith\$netFolder"
|
||||
$objFolder = "$project\obj\$buildWith\$netFolder"
|
||||
$releaseFolder = "$project\bin\$buildWith\net$netVersion"
|
||||
$objFolder = "$project\obj\$buildWith\net$netVersion"
|
||||
$publishFolder = "publish"
|
||||
$platformsFolder = "$buildFolder\platforms"
|
||||
|
||||
@@ -317,13 +317,18 @@ foreach ($obj in $runtimes.GetEnumerator()) {
|
||||
# Deploy
|
||||
Write-Output "################################
|
||||
Building: $runtime"
|
||||
dotnet publish "UVtools.Cmd" -o "$publishFolder/$publishName" -c $buildWith -r $runtime -p:PublishReadyToRun=true --self-contained $extraCmd
|
||||
dotnet publish $project -o "$publishFolder/$publishName" -c $buildWith -r $runtime -p:PublishReadyToRun=true --self-contained $extraCmd
|
||||
|
||||
New-Item "$publishFolder/$publishName/runtime_package.dat" -ItemType File -Value $runtime
|
||||
|
||||
# Cleanup
|
||||
Remove-Item "UVtools.Cmd\bin\$buildWith\net$netVersion\$runtime" -Recurse -ErrorAction Ignore
|
||||
Remove-Item "UVtools.Cmd\obj\$buildWith\net$netVersion\$runtime" -Recurse -ErrorAction Ignore
|
||||
|
||||
Remove-Item "$releaseFolder\$runtime" -Recurse -ErrorAction Ignore
|
||||
Remove-Item "$objFolder\$runtime" -Recurse -ErrorAction Ignore
|
||||
|
||||
Write-Output "$releaseFolder\$runtime"
|
||||
|
||||
foreach ($excludeObj in $obj.Value.exclude) {
|
||||
|
||||
@@ -25,8 +25,10 @@ publishName="UVtools_${runtime}_v$version"
|
||||
publishDir="$rootDir/publish"
|
||||
publishRuntimeDir="$publishDir/$publishName"
|
||||
buildProject="UVtools.WPF"
|
||||
cmdProject="UVtools.Cmd"
|
||||
buildWith="Release"
|
||||
projectDir="$rootDir/$buildProject"
|
||||
cmdProjectDir="$rootDir/$cmdProject"
|
||||
netVersion="6.0"
|
||||
|
||||
if [ $runtime == "clean" ]; then
|
||||
@@ -89,7 +91,8 @@ rm -rf "$publishRuntimeDir" 2>/dev/null
|
||||
|
||||
|
||||
echo "2. Publishing UVtools v$version for: $runtime"
|
||||
dotnet publish $buildProject -o "$publishRuntimeDir" -c $buildWith -r $runtime -p:PublishReadyToRun=true --self-contained
|
||||
dotnet publish $cmdProject -o "$publishRuntimeDir" -c $buildWith -r $runtime /p:PublishReadyToRun=true --self-contained
|
||||
dotnet publish $buildProject -o "$publishRuntimeDir" -c $buildWith -r $runtime /p:PublishReadyToRun=true --self-contained
|
||||
|
||||
echo "3. Copying dependencies"
|
||||
echo $runtime > "$publishRuntimeDir/runtime_package.dat"
|
||||
@@ -98,6 +101,8 @@ echo $runtime > "$publishRuntimeDir/runtime_package.dat"
|
||||
[ -f "$runtimePlatformDir/libcvextern.zip" ] && unzip "$runtimePlatformDir/libcvextern.zip" -d "$publishRuntimeDir"
|
||||
|
||||
echo "4. Cleaning up"
|
||||
rm -rf "$cmdProjectDir/bin/$buildWith/net$netVersion/$runtime" 2>/dev/null
|
||||
rm -rf "$cmdProjectDir/obj/$buildWith/net$netVersion/$runtime" 2>/dev/null
|
||||
rm -rf "$projectDir/bin/$buildWith/net$netVersion/$runtime" 2>/dev/null
|
||||
rm -rf "$projectDir/obj/$buildWith/net$netVersion/$runtime" 2>/dev/null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user