diff options
author | Tiago Conceição <Tiago_caza@hotmail.com> | 2022-03-20 06:04:24 +0300 |
---|---|---|
committer | Tiago Conceição <Tiago_caza@hotmail.com> | 2022-03-20 06:04:24 +0300 |
commit | 9656a48afec79b9a749eda5c222e7b5417c146fa (patch) | |
tree | b8c205b5aaf96be27276108a2f73123b447737ef /build | |
parent | 8b4ee49ca25275c966945cd9c7981937cd6fd14a (diff) |
Cleanup build
Diffstat (limited to 'build')
-rw-r--r-- | build/createRelease.ps1 | 100 | ||||
-rw-r--r-- | build/createRelease.sh | 28 | ||||
-rw-r--r-- | build/platforms/arch-x64/libcvextern.zip | bin | 0 -> 46389798 bytes | |||
-rw-r--r-- | build/platforms/linux-arm64/libcvextern.zip | bin | 0 -> 24340822 bytes | |||
-rw-r--r-- | build/platforms/linux-x64/libcvextern.zip | bin | 0 -> 46389798 bytes | |||
-rw-r--r-- | build/platforms/linux/AppImage/AppRun | 5 | ||||
-rw-r--r-- | build/platforms/linux/AppImage/UVtools.desktop | 11 | ||||
-rw-r--r-- | build/platforms/linux/AppImage/usr/share/applications/UVtools.desktop | 11 | ||||
-rw-r--r-- | build/platforms/linux/AppImage/usr/share/metainfo/UVtools.appdata.xml | 42 | ||||
-rw-r--r-- | build/platforms/osx-arm64/libcvextern.zip | bin | 0 -> 17285772 bytes | |||
-rw-r--r-- | build/platforms/osx-x64/libcvextern.zip | bin | 0 -> 19399577 bytes | |||
-rw-r--r-- | build/platforms/osx/Info.plist | 36 | ||||
-rw-r--r-- | build/platforms/osx/UVtools.entitlements | 14 | ||||
-rw-r--r-- | build/platforms/rhel-x64/libcvextern.zip | bin | 0 -> 46389798 bytes |
14 files changed, 160 insertions, 87 deletions
diff --git a/build/createRelease.ps1 b/build/createRelease.ps1 index 81a1bef..ef2e5b7 100644 --- a/build/createRelease.ps1 +++ b/build/createRelease.ps1 @@ -178,8 +178,8 @@ Set-Location $PSScriptRoot\.. ### Configuration ### #################################### $enableMSI = $true -#$buildOnly = 'win-x64' -$buildOnly = 'linux-x64' +$buildOnly = 'win-x64' +#$buildOnly = 'linux-x64' #$buildOnly = 'osx-x64' #$buildOnly = 'osx-arm64' $zipPackages = $true @@ -201,9 +201,7 @@ $buildFolder = "$rootFolder\build" $releaseFolder = "$project\bin\$buildWith\$netFolder" $objFolder = "$project\obj\$buildWith\$netFolder" $publishFolder = "publish" -$platformsFolder = "UVtools.Platforms" - -$macIcns = "UVtools.CAD/UVtools.icns" +$platformsFolder = "$buildFolder\platforms" #$version = (Get-Command "$releaseFolder\UVtools.dll").FileVersionInfo.ProductVersion $projectXml = [Xml] (Get-Content "$project\$project.csproj") @@ -217,7 +215,7 @@ if([string]::IsNullOrWhiteSpace($version)){ $installers = @("UVtools.InstallerMM", "UVtools.Installer") $msiOutputFile = "$rootFolder\UVtools.Installer\bin\x64\Release\UVtools.msi" $msiComponentsFile = "$rootFolder\UVtools.InstallerMM\UVtools.InstallerMM.wxs" -$msiSourceFiles = "$rootFolder\$publishFolder\win-x64" +$msiSourceFiles = "$rootFolder\$publishFolder\${software}_win-x64_v$version" $msbuild = "`"${env:ProgramFiles}\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe`" /t:Build /p:Configuration=$buildWith /p:MSIProductVersion=$version" Write-Output " @@ -265,7 +263,7 @@ $runtimes = #} #"unix-x64" = @{ # "extraCmd" = "" - # "exclude" = @("x86", "x64", "libcvextern.dylib") + # "exclude" = @() #} "osx-x64" = @{ "extraCmd" = "" @@ -309,10 +307,12 @@ foreach ($obj in $runtimes.GetEnumerator()) { $runtime = $obj.Name; # runtime name $extraCmd = $obj.extraCmd; # extra cmd to run with dotnet - $publishName="UVtools_${runtime}_v$version" + $publishName="${software}_${runtime}_v$version" if($runtime.StartsWith("win-")) { $targetZip = "$publishFolder/${software}_${runtime}_v$version.zip" # Target zip filename + Remove-Item "$publishFolder/$publishName" -Recurse -ErrorAction Ignore + Remove-Item "$targetZip" -ErrorAction Ignore # Deploy Write-Output "################################ @@ -320,12 +320,6 @@ foreach ($obj in $runtimes.GetEnumerator()) { 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 - #if(!$runtime.Equals('win-x64')) - #{ - # # Fix permissions - # wsl chmod +x "$publishFolder/$runtime/UVtools" `|`| : - # wsl chmod +x "$publishFolder/$runtime/UVtools.sh" `|`| : - #} # Cleanup Remove-Item "$releaseFolder\$runtime" -Recurse -ErrorAction Ignore @@ -339,72 +333,27 @@ foreach ($obj in $runtimes.GetEnumerator()) { foreach ($includeObj in $obj.Value.include) { Write-Output "Including: $includeObj" - Copy-Item "$platformsFolder\$runtime\$includeObj" -Destination "$publishFolder\$runtime" -Recurse -ErrorAction Ignore + Copy-Item "$platformsFolder\$runtime\$includeObj" -Destination "$publishFolder\$publishName" -Recurse -ErrorAction Ignore } if($null -ne $zipPackages -and $zipPackages) { Write-Output "Compressing $runtime to: $targetZip" - Write-Output $targetZip "$publishFolder/$runtime" - wsl cd "$publishFolder/$runtime" `&`& pwd `&`& zip -r "../../$targetZip" . + wsl cd "$publishFolder/$publishName" `&`& pwd `&`& zip -rq "../../$targetZip" . } } else { - wsl bash "build/createRelease.sh" -b -z $runtime + if($null -ne $zipPackages -and $zipPackages) + { + wsl bash "build/createRelease.sh" -b -z $runtime + } + else + { + wsl bash "build/createRelease.sh" -b $runtime + } } - - # Old - #if($runtime.Equals('linux-x64')){ - # $appDirDest = "$publishFolder/AppImage.$runtime/AppDir" - # Copy-Item "$platformsFolder/AppImage/AppDir" $appDirDest -Force -Recurse - # wsl chmod 755 "$appDirDest/AppRun" - # wsl cp -a "$publishFolder/$runtime/." "$appDirDest/usr/bin" - # wsl $appImageFilePath $appDirDest - #} - #if($runtime.StartsWith('osx-')){ - # $macAppFolder = "${software}.app" - # $macPublishFolder = "$publishFolder/${macAppFolder}" - # $macInfoplist = "$platformsFolder/osx/Info.plist" - # $macEntitlements = "$platformsFolder/osx/UVtools.entitlements" - # $macContents = "$macPublishFolder/Contents" - # $macTargetZipLegacy = "$publishFolder/${software}_${runtime}-legacy_v$version.zip" - # - # New-Item -ItemType directory -Path $macPublishFolder - # New-Item -ItemType directory -Path "$macPublishFolder/Contents" - # New-Item -ItemType directory -Path "$macPublishFolder/Contents/MacOS" - # New-Item -ItemType directory -Path "$macPublishFolder/Contents/Resources" - # - # - # Copy-Item $macIcns -Destination "$macPublishFolder/Contents/Resources" - # ((Get-Content -Path $macInfoplist) -replace '#VERSION',"$version") | Set-Content -Path "$macContents/Info.plist" - # Copy-Item $macEntitlements -Destination $macContents - # wsl cp -a "$publishFolder/$runtime/." "$macPublishFolder/Contents/MacOS" - # wsl chmod +x "$macPublishFolder/Contents/MacOS/UVtools" - # - # if($null -ne $zipPackages -and $zipPackages) - # { - # wsl cd "$publishFolder/" `&`& pwd `&`& zip -r "../$targetZip" "$macAppFolder/*" - # #wsl cd "$publishFolder/$runtime" `&`& pwd `&`& zip -r "../../$macTargetZipLegacy" . - # } - # - # Rename-Item -Path $macPublishFolder -NewName "${macAppFolder}_${runtime}" - # - #} - #else { - # if($null -ne $zipPackages -and $zipPackages) - # { - # Write-Output "Compressing $runtime to: $targetZip" - # Write-Output $targetZip "$publishFolder/$runtime" - # wsl cd "$publishFolder/$runtime" `&`& pwd `&`& zip -r "../../$targetZip" . - # } - #} - - # Zip - #Write-Output "Compressing $runtime to: $targetZip" - #Write-Output $targetZip "$publishFolder/$runtime" - #[System.IO.Compression.ZipFile]::CreateFromDirectory("$publishFolder\$runtime", $targetZip, [System.IO.Compression.CompressionLevel]::Optimal, $false, [FixedEncoder]::new()) - #wsl cd "$publishFolder/$runtime" `&`& pwd `&`& chmod +x -f "./$software" `|`| : `&`& zip -r "../../$targetZip" "." + $deployStopWatch.Stop() Write-Output "Took: $($deployStopWatch.Elapsed) ################################ @@ -438,7 +387,10 @@ if($null -ne $enableMSI -and $enableMSI) $msiTargetFile = "$publishFolder\${software}_${runtime}_v$version.msi" Write-Output "################################" Write-Output "Clean and build MSI components manifest file" - $msiComponentsXml = [Xml] (Get-Content $msiComponentsFile) + + (Get-Content "$msiComponentsFile") -replace 'SourceDir="\.\.\\publish\\.+"', "SourceDir=`"..\publish\${software}_win-x64_v$version`"" | Out-File "$msiComponentsFile" + + $msiComponentsXml = [Xml] (Get-Content "$msiComponentsFile") foreach($element in $msiComponentsXml.Wix.Module.Directory.Directory) { if($element.Id -eq 'MergeRedirectFolder') @@ -466,9 +418,9 @@ if($null -ne $enableMSI -and $enableMSI) ################################ " } - else { - Write-Error "MSI build is enabled but the runtime '$runtime' is not found." - } + #else { + # Write-Error "MSI build is enabled but the runtime '$runtime' is not found." + #} } diff --git a/build/createRelease.sh b/build/createRelease.sh index 0c9c96d..d1f32ab 100644 --- a/build/createRelease.sh +++ b/build/createRelease.sh @@ -15,10 +15,11 @@ cd .. #runtime=$1 for runtime in $@; do :; done # Get last argument rootDir="$(pwd)" +buildDir="$rootDir/build" coreDir="$rootDir/UVtools.Core" #version="$(grep -oP '<Version>\K(\d\.\d\.\d)(?=<\/Version>)' "$coreDir/UVtools.Core.csproj")" # Not supported on recent macos! version="$(perl -nle'print $& while m{<Version>\K(\d\.\d\.\d)(?=<\/Version>)}g' "$coreDir/UVtools.Core.csproj")" -platformsDir="$rootDir/UVtools.Platforms" +platformsDir="$buildDir/platforms" runtimePlatformDir="$platformsDir/$runtime" publishName="UVtools_${runtime}_v$version" publishDir="$rootDir/publish" @@ -28,7 +29,7 @@ buildWith="Release" projectDir="$rootDir/$buildProject" netVersion="6.0" -if [[ $runtime = "clean" ]]; then +if [[ $runtime == "clean" ]]; then echo "Cleaning publish directory" rm -rf "$publishDir" 2>/dev/null exit @@ -75,7 +76,7 @@ if [[ ! $runtime == *-* && ! $runtime == *-arm && ! $runtime == *-x64 && ! $runt exit -1 fi -if [ ! $runtime = "win-x64" -a ! -d "$platformsDir/$runtime" ]; then +if [ ! $runtime == "win-x64" -a ! -d "$platformsDir/$runtime" ]; then echo "The runtime '$runtime' is not valid, please pick one of the following:" ls "$platformsDir" exit -1 @@ -84,7 +85,7 @@ fi echo "1. Preparing the environment" rm -rf "$publishRuntimeDir" 2>/dev/null -[ "$zipPackage" = true ] && rm -f "$publishDir/$publishName.zip" 2>/dev/null +[ "$zipPackage" == true ] && rm -f "$publishDir/$publishName.zip" 2>/dev/null echo "2. Publishing UVtools v$version for: $runtime" @@ -93,7 +94,8 @@ dotnet publish $buildProject -o "$publishRuntimeDir" -c $buildWith -r $runtime - echo "3. Copying dependencies" echo $runtime > "$publishRuntimeDir/runtime_package.dat" #find "$runtimePlatformDir" -type f | grep -i lib | xargs -i cp -fv {} "$publishRuntimeDir/" -cp -afv "$runtimePlatformDir/." "$publishRuntimeDir/" +#cp -afv "$runtimePlatformDir/." "$publishRuntimeDir/" +[ -f "$runtimePlatformDir/libcvextern.zip" ] && unzip "$runtimePlatformDir/libcvextern.zip" -d "$publishRuntimeDir" echo "4. Cleaning up" rm -rf "$projectDir/bin/$buildWith/net$netVersion/$runtime" 2>/dev/null @@ -106,7 +108,7 @@ chmod -fv a+x "$publishRuntimeDir/UVtools.sh" if [[ $runtime == win-* ]]; then echo "6. Windows should be published in a windows machine!" elif [[ $runtime == osx-* ]]; then - if [[ $bundlePublish = true ]]; then + if [ $bundlePublish == true ]; then echo "6. macOS: Creating app bundle" osxApp="$publishDir/$publishName.app" rm -rf "$osxApp" 2>/dev/null @@ -120,10 +122,10 @@ elif [[ $runtime == osx-* ]]; then sed -i '' "s/#VERSION/$version/g" "$osxApp/Contents/Info.plist" # Remove the base publish if able - [ "$keepNetPublish" = false ] && rm -rf "$publishRuntimeDir" 2>/dev/null + [ "$keepNetPublish" == false ] && rm -rf "$publishRuntimeDir" 2>/dev/null # Packing AppImage - if [ "$zipPackage" = true -a -d "$osxApp" ] ; then + if [ "$zipPackage" == true -a -d "$osxApp" ] ; then echo "7. Compressing '$publishName.app' to '$publishName.zip'" cd "$publishDir" mv "$publishName.app" "UVtools.app" @@ -134,14 +136,14 @@ elif [[ $runtime == osx-* ]]; then fi fi else - if [[ $bundlePublish = true ]]; then + if [ $bundlePublish == true ]; then echo "6. Linux: Creating AppImage bundle" linuxAppDir="$publishDir/$publishName.AppDir" linuxAppImage="$publishDir/$publishName.AppImage" rm -f "$linuxAppImage" 2>/dev/null rm -rf "$linuxAppDir" 2>/dev/null - cp -arf "$platformsDir/AppImage/." "$linuxAppDir" + cp -arf "$platformsDir/linux/AppImage/." "$linuxAppDir" cp -af "$rootDir/UVtools.CAD/UVtools.png" "$linuxAppDir/" mkdir -p "$linuxAppDir/usr/bin" cp -a "$publishRuntimeDir/." "$linuxAppDir/usr/bin" @@ -162,10 +164,10 @@ else chmod a+x "$linuxAppImage" # Remove the base publish if able - #[ "$keepNetPublish" = false ] && rm -rf "$publishRuntimeDir" 2>/dev/null + #[ "$keepNetPublish" == false ] && rm -rf "$publishRuntimeDir" 2>/dev/null # # Packing AppImage - #if [ "$zipPackage" = true -a -f "$linuxAppImage" ] ; then + #if [ "$zipPackage" == true -a -f "$linuxAppImage" ] ; then # echo "7. Compressing '$publishName.AppImage' to '$publishName.zip'" # cd "$publishDir" # zip -q "$publishDir/$publishName.zip" "$publishName.AppImage" @@ -183,7 +185,7 @@ else fi # Zip generic builds -if [ "$zipPackage" = true -a -d "$publishRuntimeDir" ] ; then +if [ "$zipPackage" == true -a -d "$publishRuntimeDir" ]; then echo "7. Compressing '$runtime' to '$publishName.zip'" cd "$publishRuntimeDir" zip -rq "$publishDir/$publishName.zip" . diff --git a/build/platforms/arch-x64/libcvextern.zip b/build/platforms/arch-x64/libcvextern.zip Binary files differnew file mode 100644 index 0000000..fe79060 --- /dev/null +++ b/build/platforms/arch-x64/libcvextern.zip diff --git a/build/platforms/linux-arm64/libcvextern.zip b/build/platforms/linux-arm64/libcvextern.zip Binary files differnew file mode 100644 index 0000000..8ac48c1 --- /dev/null +++ b/build/platforms/linux-arm64/libcvextern.zip diff --git a/build/platforms/linux-x64/libcvextern.zip b/build/platforms/linux-x64/libcvextern.zip Binary files differnew file mode 100644 index 0000000..fe79060 --- /dev/null +++ b/build/platforms/linux-x64/libcvextern.zip diff --git a/build/platforms/linux/AppImage/AppRun b/build/platforms/linux/AppImage/AppRun new file mode 100644 index 0000000..f954dda --- /dev/null +++ b/build/platforms/linux/AppImage/AppRun @@ -0,0 +1,5 @@ +#!/bin/sh +HERE="$(dirname "$(readlink -f "${0}")")" +export PATH="${HERE}"/usr/bin/:"${PATH}" +EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1) +exec "${EXEC}" $@
\ No newline at end of file diff --git a/build/platforms/linux/AppImage/UVtools.desktop b/build/platforms/linux/AppImage/UVtools.desktop new file mode 100644 index 0000000..f774a15 --- /dev/null +++ b/build/platforms/linux/AppImage/UVtools.desktop @@ -0,0 +1,11 @@ +# Desktop Entry Specification: https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html +# https://github.com/AppImage/AppImageKit/wiki/Bundling-.NET-Core-apps +[Desktop Entry] +Type=Application +Name=UVtools +Comment=MSLA/DLP, file analysis, calibration, repair, conversion and manipulation +Icon=UVtools +Exec=UVtools +Path=~ +Terminal=true +Categories=Utility;
\ No newline at end of file diff --git a/build/platforms/linux/AppImage/usr/share/applications/UVtools.desktop b/build/platforms/linux/AppImage/usr/share/applications/UVtools.desktop new file mode 100644 index 0000000..f774a15 --- /dev/null +++ b/build/platforms/linux/AppImage/usr/share/applications/UVtools.desktop @@ -0,0 +1,11 @@ +# Desktop Entry Specification: https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html +# https://github.com/AppImage/AppImageKit/wiki/Bundling-.NET-Core-apps +[Desktop Entry] +Type=Application +Name=UVtools +Comment=MSLA/DLP, file analysis, calibration, repair, conversion and manipulation +Icon=UVtools +Exec=UVtools +Path=~ +Terminal=true +Categories=Utility;
\ No newline at end of file diff --git a/build/platforms/linux/AppImage/usr/share/metainfo/UVtools.appdata.xml b/build/platforms/linux/AppImage/usr/share/metainfo/UVtools.appdata.xml new file mode 100644 index 0000000..78293f1 --- /dev/null +++ b/build/platforms/linux/AppImage/usr/share/metainfo/UVtools.appdata.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Copyright 2022 PTRTECH --> +<component type="desktop-application"> + <id>org.UVtools.</id> + <metadata_license>FSFAP</metadata_license> + <project_license>AGPL-3.0</project_license> + <name>UVtools</name> + <summary>MSLA/DLP, file analysis, calibration, repair, conversion and manipulation</summary> + + <description> + <p> + MSLA/DLP, file analysis, calibration, repair, conversion and manipulation + </p> + </description> + + <launchable type="desktop-id">UVtools.desktop</launchable> + + <screenshots> + <screenshot type="default"> + <caption>The options dialog</caption> + <image>https://raw.githubusercontent.com/sn4k3/UVtools/master/wiki/UI1.png</image> + </screenshot> + </screenshots> + + <url type="homepage">https://github.com/sn4k3/UVtools</url> + <developer_name>Tiago Conceição</developer_name> + <update_contact>tiago_caza_AT_hotmail.com</update_contact> + + <provides> + <binary>UVtools</binary> + </provides> + + <!-- + <releases> + <release version="3.12.2" date="2013-04-12"> + <description> + <p>Fixes issues X, Y and Z</p> + </description> + </release> + </releases> + --> +</component>
\ No newline at end of file diff --git a/build/platforms/osx-arm64/libcvextern.zip b/build/platforms/osx-arm64/libcvextern.zip Binary files differnew file mode 100644 index 0000000..6f3bbdc --- /dev/null +++ b/build/platforms/osx-arm64/libcvextern.zip diff --git a/build/platforms/osx-x64/libcvextern.zip b/build/platforms/osx-x64/libcvextern.zip Binary files differnew file mode 100644 index 0000000..ffb34c4 --- /dev/null +++ b/build/platforms/osx-x64/libcvextern.zip diff --git a/build/platforms/osx/Info.plist b/build/platforms/osx/Info.plist new file mode 100644 index 0000000..f5e8719 --- /dev/null +++ b/build/platforms/osx/Info.plist @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>CFBundleDevelopmentRegion</key> + <string>en</string> + <key>CFBundleIconFile</key> + <string>UVtools.icns</string> + <key>CFBundleIdentifier</key> + <string>com.UVtools</string> + <key>CFBundleName</key> + <string>UVtools</string> + <key>CFBundleVersion</key> + <string>#VERSION</string> + <key>LSMinimumSystemVersion</key> + <string>10.15</string> + <key>CFBundleExecutable</key> + <string>UVtools</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string>#VERSION</string> + <key>CFBundleSupportedPlatforms</key> + <array> + <string>MacOSX</string> + </array> + <key>LSApplicationCategoryType</key> + <string>public.app-category.utilities</string> + <key>NSHighResolutionCapable</key> + <true /> + <key>NSHumanReadableCopyright</key> + <string>Copyright © 2020 PTRTECH. All rights reserved.</string> + </dict> +</plist> diff --git a/build/platforms/osx/UVtools.entitlements b/build/platforms/osx/UVtools.entitlements new file mode 100644 index 0000000..dcdd7aa --- /dev/null +++ b/build/platforms/osx/UVtools.entitlements @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>com.apple.security.cs.allow-jit</key> + <true/> + <key>com.apple.security.cs.allow-unsigned-executable-memory</key> + <true/> + <key>com.apple.security.cs.disable-library-validation</key> + <true/> + <key>com.apple.security.cs.allow-dyld-environment-variables</key> + <true/> +</dict> +</plist>
\ No newline at end of file diff --git a/build/platforms/rhel-x64/libcvextern.zip b/build/platforms/rhel-x64/libcvextern.zip Binary files differnew file mode 100644 index 0000000..fe79060 --- /dev/null +++ b/build/platforms/rhel-x64/libcvextern.zip |