-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildAll.ps1
More file actions
71 lines (55 loc) · 2.33 KB
/
Copy pathBuildAll.ps1
File metadata and controls
71 lines (55 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<#
.NOTES
File Name : PSHelpers.ps1
Author : Moustafa K. Elsayed
Created : June 15, 2025
Last Modified : Feb 17, 2026
Version : $Scriptversion
Requirements:
- PowerShell 7.0 or higher you can run this in any powershell to install powershell 7: winget install --id Microsoft.Powershell --source winget
- Git installed and in PATH
- Valid Git repository
History log:
#1.0 Initial $global:Release
#>
######### GLOBAL VARIABLES #########
###
# IF THERE IS LOAD ERROR Add WSBLib\WSBLib\SolutionItems to the PSMOdulePath under the enviromentalvariable
###
using module "D:\RevitAPI\Shared\visualstudio-settings\TypicalProps\ProjectBuildingEngine.psm1"
[CmdletBinding()]
param (
[string[]] $Configs = @("Rwin"),
[bool] $Clean = 1,
[bool] $Build = 1,
[bool] $Protect = 0,
[bool] $All = 0,
[bool] $IgnoreCheck = 0,
[bool] $IncrementGit = 1,
[int] $PublishToServer = 0,
[bool] $publish = $false
)
Set-Location $PSScriptRoot
$options = [BuildOptions]::new($Configs, $PSBoundParameters)
$options.IsDotNetBuild = $true
Set-Location $PSScriptRoot
$options.Initialize(".\SharpBIM.IssueTracker.Core\SharpBIM.IssueTracker.Core.csproj")
if ($IncrementGit -eq 1) {
$gitPathString = (Get-Item ".\VersionControl.txt").FullName
$gitPathString
$currentGitVersion = (Get-Content $gitPathString)
# Split the version into major and minor parts
$versionParts = $currentGitVersion -split '\.'
# Increment the last part of the version
$minorVersion = [int]::Parse($versionParts[1])
$minorVersion += 1
$newGitVersion = "$($versionParts[0]).$($minorVersion).0.0"
(Set-Content -Path $gitPathString -Value $newGitVersion)
SetVersionAllFiles "AssemblyVersion>(\d+\.\d+\.\d+\.\d+)</" $gitPathString.$FolderPath "*.props" $newGitVersion
SetVersionAllFiles "AssemblyVersion>(\d+\.\d+\.\d+\.\d+)</" $gitPathString.$FolderPath "*.cs" $newGitVersion
SetVersionAllFiles "AssemblyVersion>(\d+\.\d+\.\d+\.\d+)</" $gitPathString.$FolderPath "*.csproj" $newGitVersion
SetVersionAllFiles """ Version=""(\d+\.\d+)""" $gitPathString.$FolderPath "*.vsixmanifest" "$($versionParts[0]).$($minorVersion)"
IsAllGood "Building IssueTracker $conf"
}
$options.InvokeBuild()
#################################################