Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
ThreadJob/doBuild.ps1 at master · Metekillot/ThreadJob · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Metekillot
ThreadJob
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
ThreadJob
/
doBuild.ps1
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
122 lines (102 loc) · 5.67 KB
master
Breadcrumbs
ThreadJob
/
doBuild.ps1
Copy path
Top
File metadata and controls
Code
Blame
122 lines (102 loc) · 5.67 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
Copyright (c) Microsoft Corporation. All rights reserved.
#
Licensed under the MIT License.
<#
.
DESCRIPTION
Implement build and packaging of the package and place the output $OutDirectory/$ModuleName
#>
function
DoBuild
{
Write-Verbose
-
Verbose
-
Message
"
Starting DoBuild with configuration:
$BuildConfiguration
, framework:
$BuildFramework
"
#
Module build out path
$BuildOutPath
=
"
${OutDirectory}
/
${ModuleName}
"
Write-Verbose
-
Verbose
-
Message
"
Official Module output file path: '
$BuildOutPath
'
"
#
Proxy module out path
$ProxyOutPath
=
"
${OutDirectory}
/
${ProxyModuleName}
"
Write-Verbose
-
Verbose
-
Message
"
Proxy Module output file path: '
$ProxyOutPath
'
"
#
Module build source path
$BuildSrcPath
=
"
bin/
${BuildConfiguration}
/
${BuildFramework}
/publish
"
Write-Verbose
-
Verbose
-
Message
"
Module build source path: '
$BuildSrcPath
'
"
#
Copy psd1 file
Write-Verbose
-
Verbose
"
Copy-Item
${SrcPath}
/
${ModuleName}
.psd1 to
$BuildOutPath
"
Copy-Item
"
${SrcPath}
/
${ModuleName}
.psd1
"
"
$BuildOutPath
"
#
Copy Proxy psd1 and psm1 file
Write-Verbose
-
Verbose
-
Message
"
Copying proxy module files to '
$ProxyOutPath
'
"
Copy-Item
"
${SrcPath}
/
${ProxyModuleName}
/
${ProxyModuleName}
.psd1
"
"
$ProxyOutPath
"
Copy-Item
"
${SrcPath}
/
${ProxyModuleName}
/
${ProxyModuleName}
.psm1
"
"
$ProxyOutPath
"
#
Copy help
Write-Verbose
-
Verbose
-
Message
"
Copying help files to '
$BuildOutPath
'
"
copy-item
-
Recurse
"
${HelpPath}
/
${Culture}
"
"
$BuildOutPath
"
#
Copy license
Write-Verbose
-
Verbose
-
Message
"
Copying LICENSE file to '
$BuildOutPath
'
"
Copy-Item
-
Path
"
./LICENSE
"
-
Dest
"
$BuildOutPath
"
#
Copy notice
Write-Verbose
-
Verbose
-
Message
"
Copying ThirdPartyNotices.txt to '
$BuildOutPath
'
"
Copy-Item
-
Path
"
./ThirdPartyNotices.txt
"
-
Dest
"
$BuildOutPath
"
if
(
Test-Path
"
${SrcPath}
/code
"
) {
Write-Verbose
-
Verbose
-
Message
"
Building assembly and copying to '
$BuildOutPath
'
"
#
build code and place it in the staging location
Push-Location
"
${SrcPath}
/code
"
try
{
#
Get dotnet.exe command path.
$dotnetCommand
=
Get-Command
-
Name
'
dotnet
'
-
ErrorAction Ignore
#
Check for dotnet for Windows (we only build on Windows platforms).
if
(
$null
-eq
$dotnetCommand
) {
if
(
$IsWindows
) {
Write-Verbose
-
Verbose
-
Message
"
dotnet.exe cannot be found in current path. Looking in ProgramFiles path.
"
$dotnetCommandPath
=
Join-Path
-
Path
$
env:
ProgramFiles
-
ChildPath
"
dotnet\dotnet.exe
"
}
elseif
(
$IsLinux
) {
Write-Verbose
-
Verbose
-
Message
"
dotnet cannot be found in current path. Looking in /usr/share/dotnet path.
"
$dotnetCommandPath
=
"
/usr/share/dotnet/dotnet
"
}
elseif
(
$IsMaxOS
) {
Write-Verbose
-
Verbose
-
Message
"
dotnet cannot be found in current path. Looking in /usr/local/share/dotnet path.
"
$dotnetCommandPath
=
"
/usr/local/share/dotnet/dotnet
"
}
else
{
throw
"
Unsupported operating system.
"
}
$dotnetCommand
=
Get-Command
-
Name
$dotnetCommandPath
-
ErrorAction Ignore
if
(
$null
-eq
$dotnetCommand
) {
throw
"
Dotnet.exe cannot be found:
$dotnetCommandPath
is unavailable for build.
"
}
}
Write-Verbose
-
Verbose
-
Message
"
dotnet.exe command found in path:
$
(
$dotnetCommand
.Path
)
"
#
Check dotnet version
Write-Verbose
-
Verbose
-
Message
"
DotNet version:
$
(
&
(
$dotnetCommand
)
--
version
)
"
#
Build source
Write-Verbose
-
Verbose
-
Message
"
Building location: PSScriptRoot:
$PSScriptRoot
, PWD:
$pwd
"
$buildCommand
=
"
$
(
$dotnetCommand
.Name
)
publish --configuration
$BuildConfiguration
--framework
$BuildFramework
--output
$BuildSrcPath
"
Write-Verbose
-
Verbose
-
Message
"
Starting dotnet build command:
$buildCommand
"
#
Capture the output and error streams
$output
=
Invoke-Expression
-
Command
$buildCommand
2>&1
Write-Verbose
-
Verbose
-
Message
"
Build output:
$output
"
#
Dump build source output directory
$outResultsPath
=
(
Resolve-Path
-
Path
"
.
"
).ProviderPath
Write-Verbose
-
Verbose
-
Message
"
Dumping expected results output path:
$outResultsPath
"
$outResults
=
Get-ChildItem
-
Path
$outResultsPath
-
Recurse
|
Out-String
Write-Verbose
-
Verbose
-
Message
$outResults
#
Place build results
if
(
!
(
Test-Path
-
Path
"
$BuildSrcPath
/
${ModuleName}
.dll
"
))
{
throw
"
Expected binary was not created:
$BuildSrcPath
/
${ModuleName}
.dll
"
}
Write-Verbose
-
Verbose
-
Message
"
Copying implementation assembly
$BuildSrcPath
/
${ModuleName}
.dll to
$BuildOutPath
"
Copy-Item
"
$BuildSrcPath
/
${ModuleName}
.dll
"
-
Dest
"
$BuildOutPath
"
if
((
Test-Path
-
Path
"
$BuildSrcPath
/
${ModuleName}
.pdb
"
)
-and
(
$
script
:BuildConfiguration
-ne
'
Release
'
))
{
Write-Verbose
-
Verbose
-
Message
"
Copying implementation pdb
$BuildSrcPath
/
${ModuleName}
.pdb to
$BuildOutPath
"
Copy-Item
-
Path
"
$BuildSrcPath
/
${ModuleName}
.pdb
"
-
Dest
"
$BuildOutPath
"
}
}
catch
{
Write-Verbose
-
Verbose
-
Message
"
dotnet build failed with error:
$_
"
Write-Error
"
dotnet build failed with error:
$_
"
}
finally
{
Pop-Location
}
}
else
{
Write-Verbose
-
Verbose
-
Message
"
No code to build in '
${SrcPath}
/code'
"
}
#
# Add build and packaging here
Write-Verbose
-
Verbose
-
Message
"
Ending DoBuild
"
}
You can’t perform that action at this time.