Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorTiago Conceição <Tiago_caza@hotmail.com>2022-05-02 03:02:13 +0300
committerTiago Conceição <Tiago_caza@hotmail.com>2022-05-02 03:02:13 +0300
commit3130ebe0f21d34f3d50c5ef05b7d0144ce674aa9 (patch)
tree5aa893183909e4822d82852a1ca40466698a74f6 /build
parent2625c13cc3179a55865e5594180050258ab60a95 (diff)
v3.4.0v3.4.0
- **Tools:** - (Add) PCB exposure: Converts a gerber file to a pixel perfect image given your printer LCD/resolution to exposure the copper traces. - (Improvement) Export settings now indent the XML to be more user friendly to edit - (Improvement) Layer import: Allow to have profiles - (Improvement) Layer import: Validates if selected files exists before execute - (Fix) Lithophane: Disallow having start threshold equal to end threshold - (Add) Windows explorer: Right-click on files will show "Open with UVtools" on context menu which opens the selected file on UVtools (Windows MSI only) - (Improvement) Island and overhang detection: Ignore detection on all layers that are in direct contact with the plate (On same first layer position) - (Improvement) Cmd: Better error messages for convert command when using shared extensions and no extension
Diffstat (limited to 'build')
-rw-r--r--build/createRelease.ps165
-rw-r--r--build/createRelease.sh19
2 files changed, 67 insertions, 17 deletions
diff --git a/build/createRelease.ps1 b/build/createRelease.ps1
index 3b5a59f..ab4359a 100644
--- a/build/createRelease.ps1
+++ b/build/createRelease.ps1
@@ -26,7 +26,6 @@ class FixedEncoder : System.Text.UTF8Encoding {
}
}
-
function wixCleanUpElement([System.Xml.XmlElement]$element, [string]$rootPath)
{
$files = Get-ChildItem -Path $rootPath -File -Force -ErrorAction SilentlyContinue
@@ -216,6 +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"
+$msiProductFile = "$rootFolder\UVtools.Installer\Code\Product.wxs"
$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"
@@ -329,8 +329,11 @@ foreach ($obj in $runtimes.GetEnumerator()) {
$deployStopWatch.Restart()
$runtime = $obj.Name; # runtime name
$extraCmd = $obj.extraCmd; # extra cmd to run with dotnet
-
$publishName="${software}_${runtime}_v$version"
+
+ #dotnet build "UVtools.Cmd" -c $buildWith
+ #dotnet build $project -c $buildWith
+
if($runtime.StartsWith("win-"))
{
$targetZip = "$publishFolder/${software}_${runtime}_v$version.zip" # Target zip filename
@@ -372,14 +375,13 @@ foreach ($obj in $runtimes.GetEnumerator()) {
}
else
{
+ $args = '-b' # Bundle
if($null -ne $zipPackages -and $zipPackages)
{
- wsl bash "build/createRelease.sh" -b -z $runtime
- }
- else
- {
- wsl bash "build/createRelease.sh" -b $runtime
+ $args += ' -z' # Zip
}
+ bash -c "'build/createRelease.sh' $args $runtime"
+ #Start-Job { bash -c "'build/createRelease.sh' $using:args $using:runtime" }
}
$deployStopWatch.Stop()
@@ -388,6 +390,26 @@ foreach ($obj in $runtimes.GetEnumerator()) {
"
}
+<#
+$deployStopWatch.Restart()
+#Wait for all jobs to finish.
+While ($(Get-Job -State Running).count -gt 0){
+ Write-Host -NoNewline "."
+ Start-Sleep 1
+}
+
+Write-Output " Took: $($deployStopWatch.Elapsed)"
+
+#Get information from each job.
+foreach($job in Get-Job){
+ $job
+ #Receive-Job -Id ($job.Id)
+}
+
+#Remove all jobs created.
+Get-Job | Remove-Job
+#>
+
# Universal package
<#
$deployStopWatch.Restart()
@@ -411,14 +433,15 @@ if($null -ne $enableMSI -and $enableMSI)
{
$deployStopWatch.Restart()
$runtime = 'win-x64'
+ $publishName = "${software}_${runtime}_v$version";
if ((Test-Path -Path $msiSourceFiles) -and ((Get-ChildItem "$msiSourceFiles" | Measure-Object).Count) -gt 0) {
- $msiTargetFile = "$publishFolder\${software}_${runtime}_v$version.msi"
+ $msiTargetFile = "$publishFolder\$publishName.msi"
Write-Output "################################"
Write-Output "Clean and build MSI components manifest file"
Remove-Item "$msiTargetFile" -ErrorAction Ignore
- (Get-Content "$msiComponentsFile") -replace 'SourceDir="\.\.\\publish\\.+"', "SourceDir=`"..\publish\${software}_win-x64_v$version`"" | Out-File "$msiComponentsFile"
+ (Get-Content "$msiComponentsFile") -replace 'SourceDir="\.\.\\publish\\.+"', "SourceDir=`"..\publish\$publishName`"" | Out-File "$msiComponentsFile"
$msiComponentsXml = [Xml] (Get-Content "$msiComponentsFile")
foreach($element in $msiComponentsXml.Wix.Module.Directory.Directory)
@@ -431,6 +454,30 @@ if($null -ne $enableMSI -and $enableMSI)
}
}
+ if(Test-Path "$publishFolder\$publishName\UVtools.Core.dll" -PathType Leaf){
+ Add-Type -Path "$publishFolder\$publishName\UVtools.Core.dll"
+ } else {
+ Write-Error "Unable to find UVtools.Core.dll"
+ return
+ }
+
+ # Add edit with UVtools possible extensions
+ $extensions = [UVtools.Core.FileFormats.FileFormat]::AllFileExtensions;
+ $extensionList = New-Object Collections.Generic.List[String]
+ foreach($ext in $extensions)
+ {
+ if($ext.Extension.Contains('.')) { continue; } # Virtual extension
+
+ $extKey = "System.FileName:&quot;*.$($ext.Extension.ToLowerInvariant())&quot;";
+ if($extensionList.Contains($extKey)) { continue; } # Already here
+ $extensionList.Add($extKey);
+ }
+ if($extensionList.Count -gt 0)
+ {
+ $regValue = [String]::Join(' OR ', $extensionList)
+ (Get-Content "$msiProductFile") -replace '(?<A><RegistryValue Root="HKCR".+Name="AppliesTo".+Value=").+(?<B>" Type=.+)', "`${A}$regValue`${B}" | Out-File "$msiProductFile"
+ }
+
Write-Output "Building: $runtime MSI Installer"
foreach($installer in $installers)
diff --git a/build/createRelease.sh b/build/createRelease.sh
index 22a6b3d..c988ecd 100644
--- a/build/createRelease.sh
+++ b/build/createRelease.sh
@@ -31,7 +31,7 @@ projectDir="$rootDir/$buildProject"
cmdProjectDir="$rootDir/$cmdProject"
netVersion="6.0"
-if [ $runtime == "clean" ]; then
+if [ "$runtime" == "clean" ]; then
echo "Cleaning publish directory"
rm -rf "$publishDir" 2>/dev/null
exit
@@ -72,13 +72,13 @@ if [ -z "$runtime" ]; then
exit -1
fi
-if [[ $runtime != *-* && $runtime != *-arm && $runtime != *-x64 && $runtime != *-x86 ]]; then
+if [[ "$runtime" != *-* && $runtime != *-arm && $runtime != *-x64 && $runtime != *-x86 ]]; then
echo "Error: The runtime '$runtime' is not valid, please pick one of the following:"
ls "$platformsDir"
exit -1
fi
-if [ $runtime != "win-x64" -a ! -d "$platformsDir/$runtime" ]; then
+if [ "$runtime" != "win-x64" -a ! -d "$platformsDir/$runtime" ]; then
echo "Error: The runtime '$runtime' is not valid, please pick one of the following:"
ls "$platformsDir"
exit -1
@@ -111,9 +111,9 @@ chmod -fv a+x "$publishRuntimeDir/UVtools"
chmod -fv a+x "$publishRuntimeDir/UVtoolsCmd"
chmod -fv a+x "$publishRuntimeDir/UVtools.sh"
-if [[ $runtime == win-* ]]; then
+if [[ "$runtime" == win-* ]]; then
echo "6. Windows should be published in a windows machine!"
-elif [[ $runtime == osx-* ]]; then
+elif [[ "$runtime" == osx-* ]]; then
if [ $bundlePublish == true ]; then
echo "6. macOS: Creating app bundle"
osxApp="$publishDir/$publishName.app"
@@ -134,13 +134,16 @@ elif [[ $runtime == osx-* ]]; then
# Packing AppImage
if [ "$zipPackage" == true -a -d "$osxApp" ] ; then
echo "7. Compressing '$publishName.app' to '$publishName.zip'"
- cd "$publishDir"
+ tempFolder="$publishDir/$publishName.app.ln"
+ mkdir "$tempFolder"
+ cd "$tempFolder"
+
#mv "$publishName.app" "UVtools.app"
- ln -s "$publishName.app" "UVtools.app"
+ ln -s "$publishDir/$publishName.app" "UVtools.app"
zip -rq "$publishDir/$publishName.zip" "UVtools.app"
#mv "UVtools.app" "$publishName.app"
- rm -f "UVtools.app"
cd "$rootDir"
+ rm -rf "$tempFolder"
zipPackage=false
fi
fi