Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop to master #72

Merged
merged 3 commits into from
Jul 31, 2017
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
24 changes: 0 additions & 24 deletions Microsoft.Azure.Amqp/Nuget/Microsoft.Azure.Amqp.nuspec

This file was deleted.

2 changes: 1 addition & 1 deletion Microsoft.Azure.Amqp/Properties/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyInformationalVersion("2.1.0")]
6 changes: 4 additions & 2 deletions Microsoft_Azure_Amqp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{0D7D9775-844A-407D-980A-4E0FA53F1D01}"
ProjectSection(SolutionItems) = preProject
build\build.cmd = build\build.cmd
build\make_nuget_package.ps1 = build\make_nuget_package.ps1
build\Microsoft.Azure.Amqp.nuspec = build\Microsoft.Azure.Amqp.nuspec
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.Microsoft.Amqp", "test\Test.Microsoft.Amqp\Test.Microsoft.Amqp.csproj", "{683D2AD2-E000-4DE1-AC8E-44A64E420F5B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.Microsoft.Amqp.Uwp", "test\Test.Microsoft.Amqp.Uwp\Test.Microsoft.Amqp.Uwp.csproj", "{2F827371-C1A6-4795-A298-3CE9A255F3B5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestAmqpClient", "test\TestAmqpClient\TestAmqpClient.csproj", "{A08B02A1-4BCE-4DF5-A1E9-1809E9515D87}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestAmqpClient", "test\TestAmqpClient\TestAmqpClient.csproj", "{A08B02A1-4BCE-4DF5-A1E9-1809E9515D87}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -252,7 +254,7 @@ Global
{A08B02A1-4BCE-4DF5-A1E9-1809E9515D87} = {07A72A72-7CE5-46AE-B383-F4EA6408AE3C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EnterpriseLibraryConfigurationToolBinariesPath = packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4
EnterpriseLibraryConfigurationToolBinariesPathV6 = packages\EnterpriseLibrary.TransientFaultHandling.6.0.1304.0\lib\portable-net45+win+wp8;packages\EnterpriseLibrary.TransientFaultHandling.WindowsAzure.Storage.6.0.1304.1\lib\NET45;packages\EnterpriseLibrary.TransientFaultHandling.Data.6.0.1304.1\lib\NET45
EnterpriseLibraryConfigurationToolBinariesPath = packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4
EndGlobalSection
EndGlobal
17 changes: 17 additions & 0 deletions build/Microsoft.Azure.Amqp.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Microsoft.Azure.Amqp</id>
<version>$Version$</version>
<title>Microsoft Azure Amqp</title>
<authors>Microsoft</authors>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<licenseUrl>https://github.com/Azure/azure-amqp/blob/master/LICENSE.txt</licenseUrl>
<description>Package for Azure AMQP</description>
<iconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</iconUrl>
<language>en-US</language>
</metadata>
<files>
<file src="$InputDirectory$\lib\**" target="lib"/>
</files>
</package>
66 changes: 33 additions & 33 deletions build/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,18 @@
@echo off

set current-path=%~dp0
rem // remove trailing slash
set current-path=%current-path:~0,-1%

set build-root=%current-path%\..
set build-root=%current-path%..
rem // resolve to fully qualified path
for %%i in ("%build-root%") do set build-root=%%~fi

rem ensure nuget.exe exists
where /q nuget.exe
if not !errorlevel! == 0 (
@Echo Azure IoT SDK needs to download nuget.exe from https://www.nuget.org/nuget.exe
@Echo https://www.nuget.org
choice /C yn /M "Do you want to download and run nuget.exe"
if not !errorlevel!==1 goto :eof
rem if nuget.exe is not found, then ask user
Powershell.exe wget -outf nuget.exe https://nuget.org/nuget.exe
if not exist .\nuget.exe (
echo nuget does not exist
exit /b 1
)
if not exist %current-path%\NuGet.exe (
@Echo Downloading NuGet.exe from https://www.nuget.org
Powershell.exe wget -outf %current-path%\NuGet.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
)
if not exist %current-path%\NuGet.exe (
echo Failed to download NuGet.exe
exit /b 1
)

rem -----------------------------------------------------------------------------
Expand All @@ -30,8 +22,8 @@ rem ----------------------------------------------------------------------------

rem // default build options
set build-clean=0
set build-config=Release
set build-platform="Any CPU"
set build-config=Debug
set build-platform=Any CPU

:args-loop
if "%1" equ "" goto args-done
Expand Down Expand Up @@ -64,17 +56,31 @@ goto args-loop
:args-done

rem -----------------------------------------------------------------------------
rem -- build csharp iot client
rem -- build solution
rem -----------------------------------------------------------------------------

call nuget restore "%build-root%\microsoft_azure_amqp.sln"
call "%current-path%\nuget.exe" restore "%build-root%\microsoft_azure_amqp.sln"
if %build-clean%==1 (
call :clean-a-solution "%build-root%\microsoft_azure_amqp.sln" %build-config% %build-platform%
call :clean-a-solution "%build-root%\microsoft_azure_amqp.sln" "%build-config%" "%build-platform%"
if not !errorlevel!==0 exit /b !errorlevel!
)
call :build-a-solution "%build-root%\microsoft_azure_amqp.sln" %build-config% %build-platform%

call :build-a-solution "%build-root%\microsoft_azure_amqp.sln" "%build-config%" "%build-platform%"
if not !errorlevel!==0 exit /b !errorlevel!

set dest-path=%build-root%\bin\Payload
if /I "%build-config%" == "Signed" (
rd /s /q "%dest-path%"
mkdir "%dest-path%"
xcopy "%build-root%\Microsoft.Azure.Amqp\bin\signed\net45\Microsoft.Azure.Amqp.dll" "%dest-path%\lib\net45\" /F
xcopy "%build-root%\Microsoft.Azure.Amqp\bin\signed\net45\Microsoft.Azure.Amqp.xml" "%dest-path%\lib\net45\" /F
xcopy "%build-root%\Microsoft.Azure.Amqp\bin\signed\netstandard1.3\Microsoft.Azure.Amqp.dll" "%dest-path%\lib\netstandard1.3\" /F
xcopy "%build-root%\Microsoft.Azure.Amqp\bin\signed\netstandard1.3\Microsoft.Azure.Amqp.xml" "%dest-path%\lib\netstandard1.3\" /F
xcopy "%build-root%\Microsoft.Azure.Amqp.Uwp\bin\signed\Microsoft.Azure.Amqp.dll" "%dest-path%\lib\uap10.0\" /F
xcopy "%build-root%\Microsoft.Azure.Amqp.Uwp\bin\signed\Microsoft.Azure.Amqp.pri" "%dest-path%\lib\uap10.0\" /F
xcopy "%build-root%\Microsoft.Azure.Amqp.Android\bin\signed\Microsoft.Azure.Amqp.dll" "%dest-path%\lib\monoandroid\" /F
xcopy "%build-root%\Microsoft.Azure.Amqp.Pcl\bin\signed\Microsoft.Azure.Amqp.dll" "%dest-path%\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\" /F
)
rem -----------------------------------------------------------------------------
rem -- done
rem -----------------------------------------------------------------------------
Expand All @@ -87,19 +93,19 @@ rem -- subroutines
rem -----------------------------------------------------------------------------

:clean-a-solution
call :_run-msbuild "Clean" %1 %2 %3
call :_run-msbuild Clean %1 %2 %3
echo %errorlevel%
goto :eof

:build-a-solution
call :_run-msbuild "Build" %1 %2 %3
call :_run-msbuild Build %1 %2 %3
goto :eof

:usage
echo build.cmd [options]
echo options:
echo -c, --clean delete artifacts from previous build before building
echo --config ^<value^> [Debug] build configuration (e.g. Debug, Release)
echo --config ^<value^> [Debug] build configuration (e.g. Debug, Release, Signed)
echo --platform ^<value^> [Win32] build platform (e.g. Win32, x64, ...)
goto :eof

Expand All @@ -109,13 +115,7 @@ rem -- helper subroutines
rem -----------------------------------------------------------------------------

:_run-msbuild
rem // optionally override configuration|platform
setlocal EnableExtensions
set build-target=
if "%~1" neq "Build" set "build-target=/t:%~1"
if "%~3" neq "" set build-config=%~3
if "%~4" neq "" set build-platform=%~4

msbuild /m %build-target% "/p:Configuration=%build-config%;Platform=%build-platform%" %2
echo msbuild /t:%1 /v:m "/p:Configuration=%~3;Platform=%~4" %2
msbuild /t:%1 /v:m "/p:Configuration=%~3;Platform=%~4" %2
if not %errorlevel%==0 exit /b %errorlevel%
goto :eof
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,26 @@ function GetAssemblyVersionFromFile($filename) {
exit
}

if (-Not (Test-Path 'NuGet.exe')) {
Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile 'NuGet.exe'
$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
$NugetPath = "$PSScriptRoot\NuGet.exe"
$AssemblyInfoFile = "$PSScriptRoot\..\Microsoft.Azure.Amqp\Properties\Version.cs"
$InputDirectory = [IO.Path]::GetFullPath("$PSScriptRoot\..\bin\Payload\")
$OutputDirectory = [IO.Path]::GetFullPath("$PSScriptRoot\..\bin\Package\")

echo "$InputDirectory -> $OutputDirectory"

if (-Not (Test-Path $NugetPath)) {
Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile $NugetPath
}

$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
$AssemblyInfoFile = "$PSScriptRoot\..\Properties\AssemblyInfo.cs"
$BuildConfig = "Release"
$OutputDirectory = [IO.Path]::GetFullPath("$PSScriptRoot\..\..\bin\$BuildConfig\")
if (-Not (Test-Path $InputDirectory)) {
echo "Input directory does not exist. Make sure build is complete and successful."
exit 2
}

if (-Not (Test-Path $OutputDirectory)) {
New-Item -ItemType Directory -Force -Path $OutputDirectory
}

# Delete existing packages to force rebuild
ls "$OutputDirectory\Microsoft.Azure.Amqp.*.nupkg" | % { del $_ }
Expand All @@ -27,4 +39,4 @@ $ver = GetAssemblyVersionFromFile($AssemblyInfoFile)
$id='Microsoft.Azure.Amqp'

echo "Creating NuGet package $id version $ver"
.\NuGet.exe pack "$PSScriptRoot\$id.nuspec" -Prop Configuration=$BuildConfig -Prop Version=$ver -OutputDirectory $OutputDirectory
& "$NugetPath" pack "$PSScriptRoot\$id.nuspec" -Prop InputDirectory=$InputDirectory -Prop Version=$ver -OutputDirectory $OutputDirectory