Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ _ReSharper*/
*.resharper
[Tt]est[Rr]esult*

#Project files
[Bb]uild/

#Subversion files
.svn/

Expand Down
18 changes: 18 additions & 0 deletions build/KeyReporting.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) Rackspace, US Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="EnsureAssemblySigningKeyPresent"
Condition="('$(SignAssembly)' == 'true') And ('$(AssemblyOriginatorKeyFile)' != '')"
BeforeTargets="CoreCompile">

<PropertyGroup>
<ErrorText>This project references a strong name key that is missing on this computer. Run 'sn -k {0}' to generate the file.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists($([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(AssemblyOriginatorKeyFile)')))"
Text="$([System.String]::Format('$(ErrorText)', '$([System.IO.Path]::GetFullPath('$([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(AssemblyOriginatorKeyFile)'))'))'))" />

</Target>
</Project>
58 changes: 58 additions & 0 deletions build/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
param (
[switch]$Debug,
[string]$VisualStudioVersion = "12.0",
[switch]$SkipKeyCheck,
[switch]$NoDocs
)

# build the solution
$SolutionPath = "..\src\openstack.net.sln"

# make sure the script was run from the expected path
if (!(Test-Path $SolutionPath)) {
$host.ui.WriteErrorLine('The script was run from an invalid working directory.')
exit 1
}

. .\version.ps1

If ($Debug) {
$BuildConfig = 'Debug'
} Else {
$BuildConfig = 'Release'
}

If ($NoDocs -and -not $Debug) {
$SolutionBuildConfig = $BuildConfig + 'NoDocs'
} Else {
$SolutionBuildConfig = $BuildConfig
}

# build the main project
$msbuild = "$env:windir\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe"

&$msbuild '/nologo' '/m' '/nr:false' '/t:rebuild' "/p:Configuration=$SolutionBuildConfig" "/p:Platform=Mixed Platforms" "/p:VisualStudioVersion=$VisualStudioVersion" $SolutionPath
if ($LASTEXITCODE -ne 0) {
$host.ui.WriteErrorLine('Build failed, aborting!')
exit $p.ExitCode
}

# By default, do not create a NuGet package unless the expected strong name key files were used
if (-not $SkipKeyCheck) {
. .\keys.ps1

foreach ($pair in $Keys.GetEnumerator()) {
$assembly = Resolve-FullPath -Path "..\src\corelib\bin\$($pair.Key)\$BuildConfig\openstacknet.dll"
# Run the actual check in a separate process or the current process will keep the assembly file locked
powershell -Command ".\check-key.ps1 -Assembly '$assembly' -ExpectedKey '$($pair.Value)' -Build '$($pair.Key)'"
if ($LASTEXITCODE -ne 0) {
Exit $p.ExitCode
}
}
}

if (-not (Test-Path 'nuget')) {
mkdir "nuget"
}

..\src\.nuget\NuGet.exe 'pack' '..\src\corelib\corelib.nuspec' '-OutputDirectory' 'nuget' '-Prop' "Configuration=$BuildConfig" '-Version' "$Version" '-Symbols'
31 changes: 31 additions & 0 deletions build/check-key.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
param(
[string]$Assembly,
[string]$ExpectedKey,
[string]$Build = $null
)

function Get-PublicKeyToken() {
param([string]$assembly = $null)
if ($assembly) {
$bytes = $null
$bytes = [System.Reflection.Assembly]::ReflectionOnlyLoadFrom($assembly).GetName().GetPublicKeyToken()
if ($bytes) {
$key = ""
for ($i=0; $i -lt $bytes.Length; $i++) {
$key += "{0:x2}" -f $bytes[$i]
}

$key
}
}
}

if (-not $Build) {
$Build = $Assembly
}

$actual = Get-PublicKeyToken -assembly $Assembly
if ($actual -ne $ExpectedKey) {
$host.ui.WriteErrorLine("Invalid publicKeyToken for '$Build'; expected '$ExpectedKey' but found '$actual'")
exit 1
}
10 changes: 10 additions & 0 deletions build/keys.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Note: these values may only change during minor release
$Keys = @{
'v3.5' = '8965cea5c205d3a3'
'v4.0' = '8965cea5c205d3a3'
}

function Resolve-FullPath() {
param([string]$Path)
[System.IO.Path]::GetFullPath((Join-Path (pwd) $Path))
}
8 changes: 8 additions & 0 deletions build/push.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
. .\version.ps1

If ($Version.EndsWith('-dev')) {
$host.ui.WriteErrorLine("Cannot push development version '$Version' to NuGet.")
Exit 1
}

..\src\.nuget\NuGet.exe 'push' ".\nuget\openstack.net.$Version.nupkg"
1 change: 1 addition & 0 deletions build/version.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$Version = "1.3.3.0-dev"
12 changes: 1 addition & 11 deletions src/Documentation/Documentation.v3.5.shfbproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<SyntaxFilters>Standard</SyntaxFilters>
<SdkLinkTarget>Blank</SdkLinkTarget>
<RootNamespaceContainer>True</RootNamespaceContainer>
<PresentationStyle>VS2013Alt</PresentationStyle>
<PresentationStyle>VS2013</PresentationStyle>
<Preliminary>False</Preliminary>
<NamingMethod>MemberName</NamingMethod>
<HelpTitle>openstack.net API Reference Documentation</HelpTitle>
Expand Down Expand Up @@ -92,9 +92,6 @@
<HelpAttributes />
<NamespaceSummaries />
<PlugInConfigurations>
<PlugInConfig id="Lightweight TOC" enabled="True">
<configuration />
</PlugInConfig>
<PlugInConfig id="Additional Reference Links" enabled="True">
<configuration>
<targets>
Expand Down Expand Up @@ -130,13 +127,6 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' ">
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\corelib\corelib.v3.5.csproj">
<Name>corelib.v3.5</Name>
<Project>{e49d9dc3-79d5-4c5e-8c38-fd5060b4e318}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Content\AsynchronousServices.aml" />
<None Include="Content\Authentication\Authentication.aml" />
Expand Down
12 changes: 1 addition & 11 deletions src/Documentation/Documentation.v4.0.shfbproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<SyntaxFilters>Standard</SyntaxFilters>
<SdkLinkTarget>Blank</SdkLinkTarget>
<RootNamespaceContainer>True</RootNamespaceContainer>
<PresentationStyle>VS2013Alt</PresentationStyle>
<PresentationStyle>VS2013</PresentationStyle>
<Preliminary>False</Preliminary>
<NamingMethod>MemberName</NamingMethod>
<HelpTitle>openstack.net API Reference Documentation</HelpTitle>
Expand Down Expand Up @@ -97,9 +97,6 @@
</versions>
</configuration>
</PlugInConfig>
<PlugInConfig id="Lightweight TOC" enabled="True">
<configuration />
</PlugInConfig>
<PlugInConfig id="Additional Reference Links" enabled="True">
<configuration>
<targets>
Expand Down Expand Up @@ -138,13 +135,6 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' ">
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\corelib\corelib.v4.0.csproj">
<Name>corelib.v4.0</Name>
<Project>{7dba11eb-dba7-4d3a-8d42-b5312e74b9c0}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Content\AsynchronousServices.aml" />
<None Include="Content\Authentication\Authentication.aml" />
Expand Down
1 change: 1 addition & 0 deletions src/corelib/corelib.v3.5.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@
<None Include="Icons\openstack_net_logo.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\..\build\KeyReporting.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
1 change: 1 addition & 0 deletions src/corelib/corelib.v4.0.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@
<None Include="Icons\openstack_net_logo.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\..\build\KeyReporting.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Loading