diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2022-03-24 19:31:38 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2022-03-24 19:31:38 +0300 |
commit | 19a0ff5496b0cdac950468451a559103bb41905f (patch) | |
tree | 3cdab5f8dcc43009b269e058a96cbd96ebce7dc1 /build | |
parent | 1690499b18496554c964b362a8ca02919cf380f5 (diff) |
Build script
Diffstat (limited to 'build')
-rw-r--r-- | build/createRelease.ps1 | 11 | ||||
-rw-r--r-- | build/createRelease.sh | 7 |
2 files changed, 14 insertions, 4 deletions
diff --git a/build/createRelease.ps1 b/build/createRelease.ps1 index 9fd38e0..40efdd9 100644 --- a/build/createRelease.ps1 +++ b/build/createRelease.ps1 @@ -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) { diff --git a/build/createRelease.sh b/build/createRelease.sh index 4f2647b..b966771 100644 --- a/build/createRelease.sh +++ b/build/createRelease.sh @@ -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 |