Skip to content

Commit 0d845bb

Browse files
Merge pull request #11 from max-ieremenko/release/2.3.0
Release/2.3.0
2 parents eaab43c + 3ddb300 commit 0d845bb

File tree

444 files changed

+11943
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

444 files changed

+11943
-113
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
obj/
22
bin/
33
.vs/
4-
packages/
54
build.out/
65

76
launchSettings.json

Build/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ build.ps1 is designed to run on windows
55
- PowerShell Desktop 5.1
66
- PowerShell Core 6.* (.net core 2.2 tests), versions 7+ are optional
77
- InvokeBuild 5.7.2
8+
- ThirdPartyLibraries https://www.nuget.org/packages/ThirdPartyLibraries.GlobalTool/
89
- .net framework 4.7.2+ sdk
910
- .net core 2.2 sdk
1011
- .net core 3.1 sdk

Build/build-tasks.ps1

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
task Default Initialize, Clean, Build, Pack, UnitTest, InitializeIntegrationTest, IntegrationTest
1+
task Default Initialize, Clean, Build, ThirdPartyNotices, Pack, UnitTest, InitializeIntegrationTest, IntegrationTest
22
task Pack PackGlobalTool, PackPoweShellModule, PackNuget452, PackManualDownload
33

44
. .\build-scripts.ps1
55

66
task Initialize {
7-
$sources = Join-Path $PSScriptRoot "..\Sources"
7+
$sources = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot "..\Sources"))
88
$bin = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot "..\bin"))
99
$artifacts = Join-Path $bin "artifacts"
1010

@@ -37,6 +37,10 @@ task Build {
3737
exec { dotnet build $solutionFile -t:Rebuild -p:Configuration=Release }
3838
}
3939

40+
task ThirdPartyNotices {
41+
Invoke-Build -File build-tasks.third-party.ps1 -Task "ThirdParty" -settings $settings
42+
}
43+
4044
task PackGlobalTool {
4145
$projectFile = Join-Path $settings.sources "SqlDatabase\SqlDatabase.csproj"
4246

@@ -62,8 +66,13 @@ task PackPoweShellModule {
6266
$psdFile = Join-Path $dest "SqlDatabase.psd1"
6367
((Get-Content -Path $psdFile -Raw) -replace '{{ModuleVersion}}', $settings.version) | Set-Content -Path $psdFile
6468

65-
# copy to powershell
69+
# copy license
6670
Copy-Item -Path (Join-Path $settings.sources "..\LICENSE.md") -Destination $dest
71+
72+
# copy ThirdPartyNotices
73+
Copy-Item -Path (Join-Path $settings.bin "ThirdPartyNotices.txt") -Destination $dest
74+
75+
# copy net452
6776
$net45Dest = Join-Path $dest "net452"
6877
$net45Source = Join-Path $settings.bin "SqlDatabase\net452"
6978
New-Item -Path $net45Dest -ItemType Directory | Out-Null
@@ -94,11 +103,12 @@ task PackNuget452 PackPoweShellModule, {
94103
task PackManualDownload PackGlobalTool, PackPoweShellModule, {
95104
$out = $settings.artifacts
96105
$lic = Join-Path $settings.sources "..\LICENSE.md"
106+
$thirdParty = Join-Path $settings.bin "ThirdPartyNotices.txt"
97107
$packageVersion = $settings.version
98-
108+
99109
$destination = Join-Path $out "SqlDatabase.$packageVersion-net452.zip"
100110
$source = Join-Path $settings.bin "SqlDatabase\net452\*"
101-
Compress-Archive -Path $source, $lic -DestinationPath $destination
111+
Compress-Archive -Path $source, $lic, $thirdParty -DestinationPath $destination
102112

103113
$destination = Join-Path $out "SqlDatabase.$packageVersion-PowerShell.zip"
104114
$source = Join-Path $settings.artifactsPowerShell "*"
@@ -108,15 +118,15 @@ task PackManualDownload PackGlobalTool, PackPoweShellModule, {
108118
$exe = Join-Path $settings.bin "SqlDatabase\netcoreapp3.1\publish\SqlDatabase.exe"
109119
$destination = Join-Path $out "SqlDatabase.$packageVersion-netcore22.zip"
110120
$source = Join-Path $settings.bin "SqlDatabase\netcoreapp2.2\publish\*"
111-
Compress-Archive -Path $source, $exe, $lic -DestinationPath $destination
121+
Compress-Archive -Path $source, $exe, $lic, $thirdParty -DestinationPath $destination
112122

113123
$destination = Join-Path $out "SqlDatabase.$packageVersion-netcore31.zip"
114124
$source = Join-Path $settings.bin "SqlDatabase\netcoreapp3.1\publish\*"
115-
Compress-Archive -Path $source, $lic -DestinationPath $destination
125+
Compress-Archive -Path $source, $lic, $thirdParty -DestinationPath $destination
116126

117127
$destination = Join-Path $out "SqlDatabase.$packageVersion-net50.zip"
118128
$source = Join-Path $settings.bin "SqlDatabase\net5.0\publish\*"
119-
Compress-Archive -Path $source, $lic -DestinationPath $destination
129+
Compress-Archive -Path $source, $lic, $thirdParty -DestinationPath $destination
120130
}
121131

122132
task UnitTest {
@@ -165,6 +175,7 @@ task IntegrationTest {
165175
@{ File = "build-tasks.it-ps-core.ps1"; Task = "Test"; settings = $settings; image = "mcr.microsoft.com/powershell:7.1.0-ubuntu-18.04" }
166176
@{ File = "build-tasks.it-ps-core.ps1"; Task = "Test"; settings = $settings; image = "mcr.microsoft.com/powershell:7.1.2-ubuntu-20.04" }
167177
@{ File = "build-tasks.it-ps-core.ps1"; Task = "Test"; settings = $settings; image = "mcr.microsoft.com/powershell:7.2.0-preview.2-ubuntu-20.04" }
178+
@{ File = "build-tasks.it-ps-core.ps1"; Task = "Test"; settings = $settings; image = "mcr.microsoft.com/powershell:7.2.0-preview.4-ubuntu-20.04" }
168179

169180
@{ File = "build-tasks.it-tool-linux.ps1"; Task = "Test"; settings = $settings; image = "sqldatabase/dotnet_pwsh:2.2-sdk" }
170181
@{ File = "build-tasks.it-tool-linux.ps1"; Task = "Test"; settings = $settings; image = "sqldatabase/dotnet_pwsh:3.1-sdk" }

Build/build-tasks.third-party.ps1

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
param(
2+
$settings
3+
)
4+
5+
function Write-ThirdPartyNotices($appName, $sources, $repository, $out) {
6+
$source = $sources | ForEach-Object {"-source", $_}
7+
$outTemp = Join-Path $out "Temp"
8+
9+
Exec {
10+
ThirdPartyLibraries update `
11+
-appName $appName `
12+
$source `
13+
-repository $repository
14+
}
15+
16+
Exec {
17+
ThirdPartyLibraries validate `
18+
-appName $appName `
19+
$source `
20+
-repository $repository
21+
}
22+
23+
Exec {
24+
ThirdPartyLibraries generate `
25+
-appName $appName `
26+
-repository $repository `
27+
-to $outTemp
28+
}
29+
30+
Move-Item (Join-Path $outTemp "ThirdPartyNotices.txt") $out -Force
31+
Remove-Item -Path $outTemp -Recurse -Force
32+
}
33+
34+
task ThirdParty {
35+
$sourceDir = $settings.sources
36+
$thirdPartyRepository = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot "third-party-libraries"))
37+
$binDir = $settings.bin
38+
39+
$sources = @(
40+
(Join-Path $sourceDir "SqlDatabase"),
41+
(Join-Path $sourceDir "SqlDatabase.Test"),
42+
(Join-Path $sourceDir "SqlDatabase.PowerShell"),
43+
(Join-Path $sourceDir "SqlDatabase.PowerShell.Test"),
44+
(Join-Path $sourceDir "SqlDatabase.Test")
45+
)
46+
47+
Write-ThirdPartyNotices "SqlDatabase" $sources $thirdPartyRepository $binDir
48+
}

Build/notes.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"nuget.org": {
3+
"allowToUseLocalCache": true,
4+
"downloadPackageIntoRepository": false,
5+
"ignorePackages": {
6+
"byName": [],
7+
"byProjectName": []
8+
},
9+
"internalPackages": {
10+
"byName": [ "StyleCop\\.Analyzers" ],
11+
"byProjectName": [ "\\.Test$" ]
12+
}
13+
},
14+
"npmjs.com": {
15+
"downloadPackageIntoRepository": false,
16+
"ignorePackages": {
17+
"byName": [ "Abc.*" ],
18+
"byFolderName": [ "\\.Demo$" ]
19+
}
20+
},
21+
"github.com": {
22+
"personalAccessToken": ""
23+
},
24+
"staticLicenseUrls": {
25+
"byCode": [
26+
{
27+
"code": "ms-net-library",
28+
"fullName": "MICROSOFT .NET LIBRARY",
29+
"downloadUrl": "https://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm"
30+
},
31+
{
32+
"code": "ms-clr-types-sql-server-2012",
33+
"fullName": "MICROSOFT SYSTEM CLR TYPES FOR MICROSOFT SQL SERVER 2012",
34+
"downloadUrl": "https://www.microsoft.com/web/webpi/eula/Microsoft_SQL_Server_2012_Microsoft_CLR_ENG.htm"
35+
}
36+
],
37+
"byUrl": [
38+
{
39+
"code": "MIT",
40+
"urls": [ "https://github.com/dotnet/corefx/blob/master/LICENSE.TXT" ]
41+
},
42+
{
43+
"code": "Apache-2.0",
44+
"urls": [
45+
"http://www.apache.org/licenses/LICENSE-2.0",
46+
"http://www.apache.org/licenses/LICENSE-2.0.html",
47+
"http://www.apache.org/licenses/LICENSE-2.0.txt"
48+
]
49+
},
50+
{
51+
"code": "ms-clr-types-sql-server-2012",
52+
"urls": [
53+
"https://www.microsoft.com/web/webpi/eula/SysClrTypes_SQLServer.htm",
54+
"https://www.microsoft.com/web/webpi/eula/Microsoft_SQL_Server_2012_Microsoft_CLR_ENG.htm",
55+
"http://go.microsoft.com/fwlink/?LinkId=331280"
56+
]
57+
},
58+
{
59+
"code": "ms-net-library",
60+
"urls": [
61+
"https://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm",
62+
"https://www.microsoft.com/en-us/web/webpi/eula/net_library_eula_ENU.htm",
63+
"http://go.microsoft.com/fwlink/?LinkId=329770",
64+
"http://go.microsoft.com/fwlink/?LinkId=529443"
65+
]
66+
}
67+
]
68+
}
69+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{{Name}} [{{Version}}]({{HRef}})
2+
--------------------
3+
4+
Used by: {{UsedBy}}
5+
6+
Target frameworks: {{TargetFrameworks}}
7+
8+
License: {{LicenseMarkdownExpression}} {% if LicenseDescription %}, {{LicenseDescription}}{% endif %}
9+
10+
{%- for license in Licenses -%}
11+
- {{license.Subject}} license: [{{license.Code}}]({{license.HRef}}) {% if license.Description %}, {{license.Description}}{% endif %}
12+
{%- endfor -%}
13+
14+
Description
15+
-----------
16+
{{Description}}
17+
18+
Remarks
19+
-----------
20+
{{Remarks}}
21+
22+
{%- if ThirdPartyNotices -%}
23+
Third party notices
24+
-----------
25+
{{ThirdPartyNotices}}
26+
{%- endif -%}
27+
28+
Dependencies {{DependenciesCount}}
29+
-----------
30+
31+
{%- if DependenciesCount > 0 -%}
32+
|Name|Version|
33+
|----------|:----|
34+
{%- for dependency in Dependencies -%}
35+
|[{{dependency.Name}}]({{dependency.LocalHRef}})|{{dependency.Version}}|
36+
{%- endfor -%}
37+
{%- endif -%}
38+
39+
*This page was generated by a tool.*
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Licenses
2+
--------
3+
4+
|Code|Requires approval|Requires third party notices|Packages count|
5+
|----------|:----|:----|:----|
6+
{% for license in Licenses -%}
7+
|[{{license.Code}}]({{license.LocalHRef}})|{% if license.RequiresApproval%}yes{% else %}no{% endif %}|{% if license.RequiresThirdPartyNotices%}yes{% else %}no{% endif %}|{{license.PackagesCount}}|
8+
{% endfor -%}
9+
10+
{%- if TodoPackagesCount > 0 -%}
11+
TODO {{TodoPackagesCount}}
12+
--------
13+
14+
|Name|Version|Source|License|Used by|
15+
|----------|:----|:----|:----|:----|
16+
{%- for package in TodoPackages -%}
17+
|[{{package.Name}}]({{package.LocalHRef}})|{{package.Version}}|[{{package.Source}}]({{package.SourceHRef}})|{{package.LicenseMarkdownExpression}}|{{package.UsedBy}}|
18+
{%- endfor -%}
19+
{%- endif -%}
20+
21+
22+
Packages {{PackagesCount}}
23+
--------
24+
25+
|Name|Version|Source|License|Used by|
26+
|----------|:----|:----|:----|:----|
27+
{%- for package in Packages -%}
28+
|[{{package.Name}}]({{package.LocalHRef}})|{{package.Version}}|[{{package.Source}}]({{package.SourceHRef}})|{{package.LicenseMarkdownExpression}}|{{package.UsedBy}}|
29+
{%- endfor -%}
30+
31+
*This page was generated by a tool.*
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
SqlDatabase
2+
************
3+
4+
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
5+
6+
{% for package in Packages -%}
7+
{{package.Name}} ({{package.HRef}})
8+
{%- if package.Author -%}
9+
Authors: {{package.Author}}
10+
{%- endif -%}
11+
{%- if package.Copyright -%}
12+
Copyright: {{package.Copyright}}
13+
{%- endif -%}
14+
License: {{package.License.FullName}}, full text can be found at{% for i in package.License.HRefs %} {{i}}{% endfor %} or in{% for i in package.License.FileNames %} {{i}}{% endfor %}
15+
{%- if package.ThirdPartyNotices -%}
16+
17+
{{package.ThirdPartyNotices}}
18+
{%- endif -%}
19+
20+
{% endfor -%}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Code": "Apache-2.0",
3+
"FullName": "Apache License 2.0",
4+
"RequiresApproval": false,
5+
"RequiresThirdPartyNotices": false,
6+
"HRef": "https://spdx.org/licenses/Apache-2.0",
7+
"FileName": "license.txt",
8+
"Dependencies": []
9+
}

0 commit comments

Comments
 (0)