-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpinvoke.build.ps1
60 lines (53 loc) · 1.54 KB
/
pinvoke.build.ps1
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
$Version = "2.1.0"
$OutputPath = "$PSScriptRoot\bin\Release\netstandard2.0\publish"
task Build {
Set-Location $PSScriptRoot
dotnet publish -c Release
$Assemblies = @(
'AdvApi32',
'BCrypt',
'Cabinet',
'CfgMgr32',
'Crypt32',
'DwmApi',
'Fusion',
'Gdi32',
'Hid',
'Iphlpapi',
'Kernel32',
'Magnification',
'MSCorEE',
'Msi',
'NCrypt',
'NetApi32',
'NewDev',
'NtDll',
'Psapi',
'SetupApi',
'SHCore',
'Shell32',
'User32',
'Userenv',
'UxTheme',
'WinUsb',
'Wtsapi32'
)
Copy-Item "$PSScriptRoot\pinvoke.psm1" -Destination "$OutputPath"
New-ModuleManifest -Path (Join-Path $OutputPath "pinvoke.psd1") `
-ModuleVersion $Version `
-Author 'Adam Driscoll' `
-Copyright '2021 Adam Driscoll' `
-RequiredAssemblies ($Assemblies | ForEach-Object { "PInvoke.$_.dll" }) `
-LicenseUri 'https://github.com/adamdriscoll/pinvoke/blob/master/LICENSE' `
-CompanyName 'Ironman Software, LLC' `
-Description 'P\Invoke library for PowerShell' `
-FunctionsToExport @('Get-Window', 'Remove-Window') `
-CmdletsToExport @() `
-RootModule "pinvoke.psm1"
}
task Publish {
Rename-Item -Path $OutputPath -NewName "PInvoke"
$ModulePath = "$PSScriptRoot\bin\Release\netstandard2.0\PInvoke"
Publish-Module -Path $ModulePath -NuGetApiKey $Env:APIKEY
}
task . Build