Skip to content

Commit

Permalink
Merge pull request #11 from max-ieremenko/release/2.3.0
Browse files Browse the repository at this point in the history
Release/2.3.0
  • Loading branch information
max-ieremenko committed Apr 4, 2021
2 parents eaab43c + 3ddb300 commit 0d845bb
Show file tree
Hide file tree
Showing 444 changed files with 11,943 additions and 113 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
obj/
bin/
.vs/
packages/
build.out/

launchSettings.json
Expand Down
1 change: 1 addition & 0 deletions Build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build.ps1 is designed to run on windows
- PowerShell Desktop 5.1
- PowerShell Core 6.* (.net core 2.2 tests), versions 7+ are optional
- InvokeBuild 5.7.2
- ThirdPartyLibraries https://www.nuget.org/packages/ThirdPartyLibraries.GlobalTool/
- .net framework 4.7.2+ sdk
- .net core 2.2 sdk
- .net core 3.1 sdk
Expand Down
27 changes: 19 additions & 8 deletions Build/build-tasks.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
task Default Initialize, Clean, Build, Pack, UnitTest, InitializeIntegrationTest, IntegrationTest
task Default Initialize, Clean, Build, ThirdPartyNotices, Pack, UnitTest, InitializeIntegrationTest, IntegrationTest
task Pack PackGlobalTool, PackPoweShellModule, PackNuget452, PackManualDownload

. .\build-scripts.ps1

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

Expand Down Expand Up @@ -37,6 +37,10 @@ task Build {
exec { dotnet build $solutionFile -t:Rebuild -p:Configuration=Release }
}

task ThirdPartyNotices {
Invoke-Build -File build-tasks.third-party.ps1 -Task "ThirdParty" -settings $settings
}

task PackGlobalTool {
$projectFile = Join-Path $settings.sources "SqlDatabase\SqlDatabase.csproj"

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

# copy to powershell
# copy license
Copy-Item -Path (Join-Path $settings.sources "..\LICENSE.md") -Destination $dest

# copy ThirdPartyNotices
Copy-Item -Path (Join-Path $settings.bin "ThirdPartyNotices.txt") -Destination $dest

# copy net452
$net45Dest = Join-Path $dest "net452"
$net45Source = Join-Path $settings.bin "SqlDatabase\net452"
New-Item -Path $net45Dest -ItemType Directory | Out-Null
Expand Down Expand Up @@ -94,11 +103,12 @@ task PackNuget452 PackPoweShellModule, {
task PackManualDownload PackGlobalTool, PackPoweShellModule, {
$out = $settings.artifacts
$lic = Join-Path $settings.sources "..\LICENSE.md"
$thirdParty = Join-Path $settings.bin "ThirdPartyNotices.txt"
$packageVersion = $settings.version

$destination = Join-Path $out "SqlDatabase.$packageVersion-net452.zip"
$source = Join-Path $settings.bin "SqlDatabase\net452\*"
Compress-Archive -Path $source, $lic -DestinationPath $destination
Compress-Archive -Path $source, $lic, $thirdParty -DestinationPath $destination

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

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

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

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

@{ File = "build-tasks.it-tool-linux.ps1"; Task = "Test"; settings = $settings; image = "sqldatabase/dotnet_pwsh:2.2-sdk" }
@{ File = "build-tasks.it-tool-linux.ps1"; Task = "Test"; settings = $settings; image = "sqldatabase/dotnet_pwsh:3.1-sdk" }
Expand Down
48 changes: 48 additions & 0 deletions Build/build-tasks.third-party.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
param(
$settings
)

function Write-ThirdPartyNotices($appName, $sources, $repository, $out) {
$source = $sources | ForEach-Object {"-source", $_}
$outTemp = Join-Path $out "Temp"

Exec {
ThirdPartyLibraries update `
-appName $appName `
$source `
-repository $repository
}

Exec {
ThirdPartyLibraries validate `
-appName $appName `
$source `
-repository $repository
}

Exec {
ThirdPartyLibraries generate `
-appName $appName `
-repository $repository `
-to $outTemp
}

Move-Item (Join-Path $outTemp "ThirdPartyNotices.txt") $out -Force
Remove-Item -Path $outTemp -Recurse -Force
}

task ThirdParty {
$sourceDir = $settings.sources
$thirdPartyRepository = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot "third-party-libraries"))
$binDir = $settings.bin

$sources = @(
(Join-Path $sourceDir "SqlDatabase"),
(Join-Path $sourceDir "SqlDatabase.Test"),
(Join-Path $sourceDir "SqlDatabase.PowerShell"),
(Join-Path $sourceDir "SqlDatabase.PowerShell.Test"),
(Join-Path $sourceDir "SqlDatabase.Test")
)

Write-ThirdPartyNotices "SqlDatabase" $sources $thirdPartyRepository $binDir
}
3 changes: 0 additions & 3 deletions Build/notes.txt

This file was deleted.

69 changes: 69 additions & 0 deletions Build/third-party-libraries/configuration/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"nuget.org": {
"allowToUseLocalCache": true,
"downloadPackageIntoRepository": false,
"ignorePackages": {
"byName": [],
"byProjectName": []
},
"internalPackages": {
"byName": [ "StyleCop\\.Analyzers" ],
"byProjectName": [ "\\.Test$" ]
}
},
"npmjs.com": {
"downloadPackageIntoRepository": false,
"ignorePackages": {
"byName": [ "Abc.*" ],
"byFolderName": [ "\\.Demo$" ]
}
},
"github.com": {
"personalAccessToken": ""
},
"staticLicenseUrls": {
"byCode": [
{
"code": "ms-net-library",
"fullName": "MICROSOFT .NET LIBRARY",
"downloadUrl": "https://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm"
},
{
"code": "ms-clr-types-sql-server-2012",
"fullName": "MICROSOFT SYSTEM CLR TYPES FOR MICROSOFT SQL SERVER 2012",
"downloadUrl": "https://www.microsoft.com/web/webpi/eula/Microsoft_SQL_Server_2012_Microsoft_CLR_ENG.htm"
}
],
"byUrl": [
{
"code": "MIT",
"urls": [ "https://github.com/dotnet/corefx/blob/master/LICENSE.TXT" ]
},
{
"code": "Apache-2.0",
"urls": [
"http://www.apache.org/licenses/LICENSE-2.0",
"http://www.apache.org/licenses/LICENSE-2.0.html",
"http://www.apache.org/licenses/LICENSE-2.0.txt"
]
},
{
"code": "ms-clr-types-sql-server-2012",
"urls": [
"https://www.microsoft.com/web/webpi/eula/SysClrTypes_SQLServer.htm",
"https://www.microsoft.com/web/webpi/eula/Microsoft_SQL_Server_2012_Microsoft_CLR_ENG.htm",
"http://go.microsoft.com/fwlink/?LinkId=331280"
]
},
{
"code": "ms-net-library",
"urls": [
"https://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm",
"https://www.microsoft.com/en-us/web/webpi/eula/net_library_eula_ENU.htm",
"http://go.microsoft.com/fwlink/?LinkId=329770",
"http://go.microsoft.com/fwlink/?LinkId=529443"
]
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{Name}} [{{Version}}]({{HRef}})
--------------------

Used by: {{UsedBy}}

Target frameworks: {{TargetFrameworks}}

License: {{LicenseMarkdownExpression}} {% if LicenseDescription %}, {{LicenseDescription}}{% endif %}

{%- for license in Licenses -%}
- {{license.Subject}} license: [{{license.Code}}]({{license.HRef}}) {% if license.Description %}, {{license.Description}}{% endif %}
{%- endfor -%}

Description
-----------
{{Description}}

Remarks
-----------
{{Remarks}}

{%- if ThirdPartyNotices -%}
Third party notices
-----------
{{ThirdPartyNotices}}
{%- endif -%}

Dependencies {{DependenciesCount}}
-----------

{%- if DependenciesCount > 0 -%}
|Name|Version|
|----------|:----|
{%- for dependency in Dependencies -%}
|[{{dependency.Name}}]({{dependency.LocalHRef}})|{{dependency.Version}}|
{%- endfor -%}
{%- endif -%}

*This page was generated by a tool.*
31 changes: 31 additions & 0 deletions Build/third-party-libraries/configuration/readme-template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Licenses
--------

|Code|Requires approval|Requires third party notices|Packages count|
|----------|:----|:----|:----|
{% for license in Licenses -%}
|[{{license.Code}}]({{license.LocalHRef}})|{% if license.RequiresApproval%}yes{% else %}no{% endif %}|{% if license.RequiresThirdPartyNotices%}yes{% else %}no{% endif %}|{{license.PackagesCount}}|
{% endfor -%}

{%- if TodoPackagesCount > 0 -%}
TODO {{TodoPackagesCount}}
--------

|Name|Version|Source|License|Used by|
|----------|:----|:----|:----|:----|
{%- for package in TodoPackages -%}
|[{{package.Name}}]({{package.LocalHRef}})|{{package.Version}}|[{{package.Source}}]({{package.SourceHRef}})|{{package.LicenseMarkdownExpression}}|{{package.UsedBy}}|
{%- endfor -%}
{%- endif -%}


Packages {{PackagesCount}}
--------

|Name|Version|Source|License|Used by|
|----------|:----|:----|:----|:----|
{%- for package in Packages -%}
|[{{package.Name}}]({{package.LocalHRef}})|{{package.Version}}|[{{package.Source}}]({{package.SourceHRef}})|{{package.LicenseMarkdownExpression}}|{{package.UsedBy}}|
{%- endfor -%}

*This page was generated by a tool.*
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
SqlDatabase
************

THIRD-PARTY SOFTWARE NOTICES AND INFORMATION

{% for package in Packages -%}
{{package.Name}} ({{package.HRef}})
{%- if package.Author -%}
Authors: {{package.Author}}
{%- endif -%}
{%- if package.Copyright -%}
Copyright: {{package.Copyright}}
{%- endif -%}
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 %}
{%- if package.ThirdPartyNotices -%}

{{package.ThirdPartyNotices}}
{%- endif -%}

{% endfor -%}
9 changes: 9 additions & 0 deletions Build/third-party-libraries/licenses/apache-2.0/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Code": "Apache-2.0",
"FullName": "Apache License 2.0",
"RequiresApproval": false,
"RequiresThirdPartyNotices": false,
"HRef": "https://spdx.org/licenses/Apache-2.0",
"FileName": "license.txt",
"Dependencies": []
}
Loading

0 comments on commit 0d845bb

Please sign in to comment.