Skip to content

Commit 0236e36

Browse files
committed
Copy netstandard2.0 dependencies required by non-NuGet users to Deployment folder
1 parent bbf7963 commit 0236e36

File tree

4 files changed

+284
-29
lines changed

4 files changed

+284
-29
lines changed

Notice.txt

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
1-
AWS SDK for .NET
2-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
1+
The AWS SDK for .NET includes the following third-party software/licensing:
32

4-
**********************
5-
THIRD PARTY COMPONENTS
6-
**********************
7-
This software includes third party software subject to the following copyrights:
8-
9-
-Json processing from LitJson �
3+
** Json processing from LitJson
104
All the source code and related files distributed with this software have
115
been dedicated to the public domain by the authors.
126

137
Anyone is free to copy, modify, publish, use, compile, sell, or distribute
148
the software, either in source code form or as a compiled binary, for any
159
purpose, commercial or non-commercial, and by any means.
1610

11+
----------------
1712

18-
- Parsing PEM files from Bouncy Castle -
19-
Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
13+
** Parsing PEM files from Bouncy Castle
14+
Copyright (c) 2000 - 2017 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
2015

21-
Permission is hereby granted, free of charge, to any person obtaining a copy of this
22-
software and associated documentation files (the "Software"), to deal in the Software
23-
without restriction, including without limitation the rights to use, copy, modify,
24-
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
25-
permit persons to whom the Software is furnished to do so, subject to the
26-
following conditions:
16+
Permission is hereby granted, free of charge, to any person obtaining a copy
17+
of this software and associated documentation files (the "Software"), to deal
18+
in the Software without restriction, including without limitation the rights
19+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20+
copies of the Software, and to permit persons to whom the Software is
21+
furnished to do so, subject to the following conditions:
2722

2823
The above copyright notice and this permission notice shall be included in all
2924
copies or substantial portions of the Software.
3025

31-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
32-
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
33-
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
34-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
35-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
36-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32+
SOFTWARE.
33+
34+
----------------
3735

38-
- Performing CRC32 checks from vbAccelerator.com
36+
** Performing CRC32 checks from vbAccelerator.com
3937
vbAccelerator Software License
4038

4139
Version 1.0

buildtools/Copy-Dependencies.ps1

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# Find all dependency paths under a folder and copy each of them to the target folder
2+
Function Copy-Dependencies
3+
{
4+
[CmdletBinding()]
5+
Param
6+
(
7+
# The list of dependencies to copy
8+
#
9+
# Note, only dependencies of Core projects may currently be listed
10+
# Restoring the full slns just for copying was disruptive to later tests
11+
#
12+
# If ever modifying this list, you likely need to update buildtools/NoticeForZips.txt and
13+
# the corresponding copy-license-and-notice task as well.
14+
[Parameter()]
15+
[string[]]
16+
$DependencyNames = @("microsoft.bcl.asyncinterfaces", "system.runtime.compilerservices.unsafe", "system.threading.tasks.extensions"),
17+
18+
# The location to copy the built dlls to
19+
[Parameter(Mandatory=$true, Position=1)]
20+
[string]
21+
$Destination,
22+
23+
# Absolute path to a temporary folder to restore the Core projects into prior the copy the dependencies from
24+
[Parameter(Mandatory=$true, Position=2)]
25+
[string]
26+
$TempRestoreFolder,
27+
28+
# The build type. If not specified defaults to 'release'.
29+
[Parameter()]
30+
[string]
31+
$BuildType = "release",
32+
33+
# The supported platforms in .NET SDK
34+
[Parameter()]
35+
[string[]]
36+
$AcceptedPlatforms = @("net35","net45","netstandard1.3","netstandard2.0","netcoreapp3.1"),
37+
38+
# The supported platforms in .NET SDK
39+
[Parameter()]
40+
[string[]]
41+
$ProjectFiles = @("AWSSDK.Core.Net35.csproj", "AWSSDK.Core.Net45.csproj", "AWSSDK.Core.NetStandard.csproj")
42+
43+
)
44+
45+
Process
46+
{
47+
foreach ($project in $ProjectFiles)
48+
{
49+
if (Test-Path sdk/src/core/$project) {
50+
dotnet restore -f --packages $TempRestoreFolder sdk/src/core/$project
51+
}
52+
elseif (Test-Path ../sdk/src/core/$project)
53+
{
54+
dotnet restore -f --packages $TempRestoreFolder ../sdk/src/core/$project
55+
}
56+
}
57+
58+
foreach ($dependency in $DependencyNames)
59+
{
60+
Write-Debug "Checking if $dependency exists in $TempRestoreFolder"
61+
if (Test-Path $TempRestoreFolder/$dependency) {
62+
$dependencyFolder = Get-Item -Path $TempRestoreFolder/$dependency
63+
$versions = Get-ChildItem -Path $dependencyFolder | Sort-Object -Property Name -Descending
64+
$max = $versions[0]
65+
$libPath = Join-Path $max.FullName lib
66+
if (Test-Path $libPath)
67+
{
68+
$targets = Get-Item -Path $libPath | Get-ChildItem
69+
foreach ($target in $targets)
70+
{
71+
$targetDllPath = Join-Path $target.FullName *.dll
72+
if (($AcceptedPlatforms -match $target.Name) -And (Test-Path $targetDllPath))
73+
{
74+
$dllFile = Get-ChildItem -Path $targetDllPath
75+
if (@($dllFile).Length -eq 1)
76+
{
77+
Write-Debug "Copying $dllFile to $Destination for $target"
78+
Copy-Dependency -SourceFile $dllFile -Destination $Destination -Platform $target.Name
79+
}
80+
else
81+
{
82+
throw "Multiple dll files found for dependency $dependency"
83+
}
84+
}
85+
else
86+
{
87+
Write-Debug "$target is not an accepted platform for $dependency"
88+
}
89+
}
90+
}
91+
else
92+
{
93+
throw "No lib folder found for dependency $dependency"
94+
}
95+
}
96+
else
97+
{
98+
throw "Could not find dependency $dependency in packages $TempRestoreFolder"
99+
}
100+
}
101+
102+
Write-Debug "Deleting $TempRestoreFolder"
103+
Remove-Item -Recurse -Force $TempRestoreFolder
104+
}
105+
}
106+
107+
# Given the path of a dependency dll, copy it to the target folder for the correct platform
108+
Function Copy-Dependency
109+
{
110+
[CmdletBinding()]
111+
Param
112+
(
113+
# The path to the dll for the dependency
114+
[Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)]
115+
[string]
116+
$SourceFile,
117+
118+
# The location to copy the built dll to
119+
[Parameter(Mandatory=$true, Position=1)]
120+
[string]
121+
$Destination,
122+
123+
# The platform to copy.
124+
[Parameter()]
125+
[string]
126+
$Platform
127+
)
128+
129+
Process
130+
{
131+
Write-Verbose "Copying built SDK assemblies beneath $SourceFile to $Destination"
132+
if (!(Test-Path $Destination))
133+
{
134+
New-Item $Destination -ItemType Directory
135+
}
136+
$platformDestination = Join-Path $Destination $Platform
137+
if (!(Test-Path $platformDestination))
138+
{
139+
New-Item $platformDestination -ItemType Directory
140+
}
141+
$assembly = Get-Item -Path $SourceFile
142+
Write-Debug "Checking if $assembly exists"
143+
if(!(Test-Path $assembly))
144+
{
145+
throw "Configured to copy $assembly but it was not found. Please check the path of the dependency."
146+
}
147+
148+
Write-Verbose "Copying $($assembly.FullName) to $(Resolve-Path $platformDestination)"
149+
Copy-Item $assembly.FullName -Destination $(Resolve-Path $platformDestination)
150+
}
151+
}
152+
153+
Copy-Dependencies -Destination ..\Deployment\assemblies $(Join-Path -Path $([System.IO.Path]::GetTempPath()) -ChildPath "/temp-nuget-packages")

buildtools/NoticeForZips.txt

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
The AWS SDK for .NET includes the following third-party software/licensing:
2+
3+
** Json processing from LitJson
4+
All the source code and related files distributed with this software have
5+
been dedicated to the public domain by the authors.
6+
7+
Anyone is free to copy, modify, publish, use, compile, sell, or distribute
8+
the software, either in source code form or as a compiled binary, for any
9+
purpose, commercial or non-commercial, and by any means.
10+
11+
----------------
12+
13+
** Parsing PEM files from Bouncy Castle
14+
Copyright (c) 2000 - 2017 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
15+
** Microsoft.Bcl.AsyncInterfaces from Microsoft
16+
Copyright (c) .NET Foundation and Contributors
17+
** System.Runtime.CompilerServices.Unsafe from Microsoft
18+
Copyright (c) .NET Foundation and Contributors
19+
** System.Threading.Tasks.Extensions from Microsoft
20+
Copyright (c) .NET Foundation and Contributors
21+
22+
Permission is hereby granted, free of charge, to any person obtaining a copy
23+
of this software and associated documentation files (the "Software"), to deal
24+
in the Software without restriction, including without limitation the rights
25+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
26+
copies of the Software, and to permit persons to whom the Software is
27+
furnished to do so, subject to the following conditions:
28+
29+
The above copyright notice and this permission notice shall be included in all
30+
copies or substantial portions of the Software.
31+
32+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38+
SOFTWARE.
39+
40+
----------------
41+
42+
** Performing CRC32 checks from vbAccelerator.com
43+
vbAccelerator Software License
44+
45+
Version 1.0
46+
47+
Copyright (c) 2002 vbAccelerator.com
48+
49+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
50+
51+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer
52+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
53+
The end-user documentation included with the redistribution, if any, must include the following acknowledgment:
54+
55+
"This product includes software developed by vbAccelerator ( http://vbaccelerator.com/)."
56+
57+
Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear.
58+
The names "vbAccelerator" and "vbAccelerator.com" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact vbAccelerator through [email protected].
59+
Products derived from this software may not be called "vbAccelerator", nor may "vbAccelerator" appear in their name, without prior written permission of vbAccelerator.
60+
61+
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
62+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
63+
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
64+
VBACCELERATOR OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
65+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
66+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
67+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
68+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
69+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
70+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
71+
72+
This software consists of voluntary contributions made by many individuals on behalf of the vbAccelerator. For more information, please see http://vbaccelerator.com/ .
73+
74+
The vbAccelerator licence is based on the Apache Software Foundation Software Licence, Copyright (c) 2000 The Apache Software Foundation. All rights reserved.

buildtools/build.proj

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@
112112
/>
113113
</Target>
114114

115-
<Target Name="full-build" DependsOnTargets="test-sdk;copy-assemblies;copy-service-models;keyscan;consolidate-docartifacts;save-build"/>
115+
<Target Name="full-build" DependsOnTargets="test-sdk;copy-assemblies;copy-dependencies;copy-service-models;keyscan;consolidate-docartifacts;save-build"/>
116116

117117
<Target Name="full-build-service" DependsOnTargets="test-sdk-service"/>
118118

119119
<Target Name="full-build-nodocs" DependsOnTargets="full-build-nodocs-all;full-build-nodocs-service"/>
120120

121-
<Target Name="full-build-nodocs-all" DependsOnTargets="test-sdk;package-extensions;keyscan;copy-assemblies;copy-service-models;save-build" Condition="'$(ServiceList)'==''"/>
121+
<Target Name="full-build-nodocs-all" DependsOnTargets="test-sdk;package-extensions;keyscan;copy-assemblies;copy-dependencies;copy-service-models;save-build" Condition="'$(ServiceList)'==''"/>
122122

123-
<Target Name="full-build-nodocs-service" DependsOnTargets="test-sdk-service;package-extensions;keyscan;copy-assemblies;copy-service-models;save-build" Condition="'$(ServiceList)'!=''"/>
123+
<Target Name="full-build-nodocs-service" DependsOnTargets="test-sdk-service;package-extensions;keyscan;copy-assemblies;copy-dependencies;copy-service-models;save-build" Condition="'$(ServiceList)'!=''"/>
124124

125125
<Target Name="restore-nuget">
126126
<Message Text="Restore nuget packages"/>
@@ -153,13 +153,13 @@
153153
RepoPath = "$(MSBuildProjectDirectory)\.."/>
154154
</Target>
155155

156-
<Target Name="build-sdk" DependsOnTargets="populate-deployment;build-sdk-desktop;build-code-analysis;build-sdk-netstandard;copy-assemblies">
156+
<Target Name="build-sdk" DependsOnTargets="populate-deployment;build-sdk-desktop;build-code-analysis;build-sdk-netstandard;copy-assemblies;copy-dependencies">
157157
<Copy
158158
SourceFiles="..\generator\ServiceModels\_sdk-versions.json"
159159
DestinationFolder="$(Deployment)" />
160160
</Target>
161161

162-
<Target Name="build-sdk-service" DependsOnTargets="populate-deployment;build-sdk-desktop-service;build-code-analysis;copy-assemblies">
162+
<Target Name="build-sdk-service" DependsOnTargets="populate-deployment;build-sdk-desktop-service;build-code-analysis;copy-assemblies;copy-dependencies">
163163
<Copy
164164
SourceFiles="..\generator\ServiceModels\_sdk-versions.json"
165165
DestinationFolder="$(Deployment)" />
@@ -436,7 +436,37 @@
436436
Command="$(powershell) -ExecutionPolicy Unrestricted -NoProfile -File copy-sdkassemblies.ps1 -PublicKeyTokenToCheck $(CustomSnkPublicKeyToken) -BuildType $(Configuration) -ServiceList &quot;$(ServiceList)&quot;"/>
437437
</Target>
438438

439-
<Target Name="copy-service-models" DependsOnTargets="copy-assemblies">
439+
<Target Name="copy-dependencies" DependsOnTargets="copy-assemblies">
440+
<Message Text="Copying dependency dlls" />
441+
<Exec LogStandardErrorAsError="true" Command="$(powershell) -ExecutionPolicy Unrestricted -NoProfile -File copy-dependencies.ps1"/>
442+
</Target>
443+
444+
<Target Name="copy-license-and-notice" DependsOnTargets="copy-dependencies">
445+
<Message Text="Copying License.txt and Notice.txt to the assembly zips" />
446+
<Copy
447+
SourceFiles="..\Notice.txt;..\License.txt"
448+
DestinationFiles="..\Deployment\assemblies\net35\Notice.txt;..\Deployment\assemblies\net35\License.txt"
449+
/>
450+
<Copy
451+
SourceFiles="..\Notice.txt;..\License.txt"
452+
DestinationFiles="..\Deployment\assemblies\net45\Notice.txt;..\Deployment\assemblies\net45\License.txt"
453+
/>
454+
<Copy
455+
SourceFiles="..\Notice.txt;..\License.txt"
456+
DestinationFiles="..\Deployment\assemblies\netstandard1.3\Notice.txt;..\Deployment\assemblies\netstandard1.3\License.txt"
457+
/>
458+
<!-- netstandard2.0 needs modified Notice with additional 3rd party dependencies -->
459+
<Copy
460+
SourceFiles=".\NoticeForZips.txt;..\License.txt"
461+
DestinationFiles="..\Deployment\assemblies\netstandard2.0\Notice.txt;..\Deployment\assemblies\netstandard2.0\License.txt"
462+
/>
463+
<Copy
464+
SourceFiles="..\Notice.txt;..\License.txt"
465+
DestinationFiles="..\Deployment\assemblies\netcoreapp3.1\Notice.txt;..\Deployment\assemblies\netcoreapp3.1\License.txt"
466+
/>
467+
</Target>
468+
469+
<Target Name="copy-service-models" DependsOnTargets="copy-license-and-notice">
440470
<Message Text="Collating service models for downstream tooling" />
441471

442472
<ItemGroup>

0 commit comments

Comments
 (0)