Skip to content

Commit

Permalink
Publish to MyGet feed plus auto versioning for Bot Builder V3. (#4817)
Browse files Browse the repository at this point in the history
* Set up automated versioning for all projects.

* Version references fixed in 3 projects.

* Rename .nuspec to match .csproj file name.

* Add bones folder to .gitignore

* revert .nuspec files for AspNetCore projects.

* Add buildtools\SetVersionInNuspecFile.ps1

* File version setting removed from AssemblyInfo.cs. for Microsoft.Bot.Builder and Microsoft.Bot.Connector.AspNetCore2 and

* .gitignores updated.

* Version setting added to 2 .csproj files, Microsoft.Bot.Builder, Microsoft.Bot.Builder.Autofac.

* Add SetVersionInAssemblyInfoCsFiles.ps1

* Changed assembly name to Microsoft.Bot.Connector.AspNetCore2.

* AssemblyVersion uncommented in AssemblyInfo.cs

* Diagnostic message added to SetVersionInAssembliInforCsFies.ps1

* Fixed Microsoft.Bot.Connector.AspNetCore2.nuspec

* Reverting some of netcore2 changes.

* Tweak
  • Loading branch information
BruceHaley authored and Tom Laird-McConnell committed Jul 6, 2018
1 parent 783f2f9 commit 3e130b0
Show file tree
Hide file tree
Showing 13 changed files with 93 additions and 11 deletions.
16 changes: 16 additions & 0 deletions .gitignore
@@ -0,0 +1,16 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/

bones/
10 changes: 10 additions & 0 deletions CSharp/Directory.Build.props
@@ -0,0 +1,10 @@
<Project>

<PropertyGroup>
<Version Condition=" '$(PackageVersion)' == '' ">3.15.3.0-local</Version>
<Version Condition=" '$(PackageVersion)' != '' ">$(PackageVersion)</Version>
<PackageVersion Condition=" '$(PackageVersion)' == '' ">3.15.3.0-local</PackageVersion>
<PackageVersion Condition=" '$(PackageVersion)' != '' ">$(PackageVersion)</PackageVersion>
</PropertyGroup>

</Project>
Expand Up @@ -19,7 +19,7 @@
<dependency id="Autofac" version="3.5.2"/>
<dependency id="Microsoft.AspNet.WebApi.Client" version="5.2.3" />
<dependency id="Microsoft.AspNet.WebApi.Core" version="5.2.3" />
<dependency id="Microsoft.Bot.Builder" version="$builder$" />
<dependency id="Microsoft.Bot.Builder" version="$version$" />
<dependency id="Newtonsoft.Json" version="9.0.1" />
</dependencies>
</metadata>
Expand Down
Expand Up @@ -17,7 +17,7 @@
<summary>A Microsoft Bot Builder extension for declaratively specifying FormFlow dialogs using JSON Schema.</summary>
<language>en-US</language>
<dependencies>
<dependency id="Microsoft.Bot.Builder" version="$builder$" />
<dependency id="Microsoft.Bot.Builder" version="$version$" />
<dependency id="Newtonsoft.Json" version="8.0.3" />
<dependency id="Microsoft.CodeAnalysis.CSharp.Scripting" version="1.2.2" />
</dependencies>
Expand Down
Expand Up @@ -17,7 +17,7 @@
<summary>Microsoft History extensions for Microsoft.Bot.Builder.</summary>
<language>en-US</language>
<dependencies>
<dependency id="Microsoft.Bot.Builder" version="$builder$"/>
<dependency id="Microsoft.Bot.Builder" version="$version$"/>
<dependency id="Newtonsoft.Json" version="9.0.1" />
</dependencies>
</metadata>
Expand Down
Expand Up @@ -28,7 +28,7 @@
<dependency id="Autofac" version="3.5.2"/>
<dependency id="Chronic.Signed" version="0.3.2" />
<dependency id="Microsoft.AspNet.WebAPI.Core" version="5.2.3" />
<dependency id="Microsoft.Bot.Connector" version="3.15.3.0" />
<dependency id="Microsoft.Bot.Connector" version="3.15.3" />
<dependency id="Microsoft.Rest.ClientRuntime" version="2.3.2" />
<dependency id="Newtonsoft.Json" version="9.0.1" />
<dependency id="System.IdentityModel.Tokens.Jwt" version="5.1.4" />
Expand Down
@@ -1,6 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version Condition=" '$(NetCoreVersion)' != '' ">$(NetCoreVersion)</Version>
<PackageVersion Condition=" '$(NetCoreVersion)' != '' ">$(NetCoreVersion)</PackageVersion>
<AssemblyTitle>Microsoft.Bot.Connector</AssemblyTitle>
<TargetFramework>netstandard1.6</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
Expand All @@ -9,10 +11,9 @@
<PackageId>Microsoft.Bot.Connector.AspNetCore</PackageId>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
<AssemblyVersion>1.1.3.0</AssemblyVersion>
<FileVersion>1.1.3.0</FileVersion>
<!--<AssemblyVersion>1.1.3.0</AssemblyVersion>-->
<!--<FileVersion>1.1.3.0</FileVersion>-->
<RootNamespace>Microsoft.Bot.Connector</RootNamespace>
<Version>1.1.3.0</Version>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
Expand Down
@@ -1,6 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version Condition=" '$(NetCore2Version)' != '' ">$(NetCore2Version)</Version>
<PackageVersion Condition=" '$(NetCore2Version)' != '' ">$(NetCore2Version)</PackageVersion>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Microsoft.Bot.Connector.AspNetCore</AssemblyName>
<RootNamespace>Microsoft.Bot.Connector</RootNamespace>
Expand All @@ -12,8 +14,6 @@
<Description>This library implements C# classes for using the Bot Framework Connector REST API, using the ASP.NET Core 2.x</Description>
<Copyright>Microsoft</Copyright>
<RepositoryUrl>http://github.com/microsoft/BotBuilder</RepositoryUrl>
<AssemblyName>Microsoft.Bot.Connector.AspNetCore</AssemblyName>
<RootNamespace>Microsoft.Bot.Connector</RootNamespace>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
Expand Down
Expand Up @@ -2,7 +2,7 @@
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Microsoft.Bot.Connector.AspNetCore</id>
<version>2.0.1.9</version>
<version>2.0.1.19</version>
<authors>Microsoft</authors>
<owners>microsoft, BotFramework, nugetbotbuilder </owners>
<iconUrl>https://bots.botframework.com/Client/Images/bot-framework-default-7.png</iconUrl>
Expand Down
Expand Up @@ -2,7 +2,7 @@
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Microsoft.Bot.Connector</id>
<version>3.15.3.0</version>
<version>$version$</version>
<authors>Microsoft</authors>
<owners>microsoft, BotFramework, nugetbotbuilder </owners>
<iconUrl>https://bots.botframework.com/Client/Images/bot-framework-default-7.png</iconUrl>
Expand Down
43 changes: 43 additions & 0 deletions CSharp/buildtools/SetVersionInAssemblyInfoCsFiles.ps1
@@ -0,0 +1,43 @@
# Set version in AssemblyInfo.cs files.
Param (
[string]$rootFolder,
[string]$version,
[string]$filePattern = "AssemblyInfo.cs"
)

function UpdateAssemblyInfo()
{
foreach ($file in $input)
{
$path = $file.FullName
Write-Host ($path)
$isUpdated = $false

$patternAV = '^((?!\/\/).)*\[assembly: AssemblyVersion\("(.*)"\)\]'
$patternAFV = '^((?!\/\/).)*\[assembly: AssemblyFileVersion\("(.*)"\)\]'
(Get-Content $path) | ForEach-Object{
if($_ -match $patternAV){
# We have found the matching line
$isUpdated = $true
'[assembly: AssemblyVersion("{0}")]' -f $version
} elseif($_ -match $patternAFV){
$isUpdated = $true
# We have found the matching line
'[assembly: AssemblyFileVersion("{0}")]' -f $version
} else {
# Output line as is
$_
}
} | Set-Content $path
if (!$isUpdated) {
Write-Host ' Nothing found to update.'
}
}
}

Write-Host ("Root folder: " + $rootFolder)
Write-Host ("File pattern: " + $filePattern)
Write-Host ("Version: " + $version)

Write-Host ("Updating files...")
Get-Childitem -Path $rootFolder -recurse |? {$_.Name -like $filePattern} | UpdateAssemblyInfo;
11 changes: 11 additions & 0 deletions CSharp/buildtools/SetVersionInNuspecFile.ps1
@@ -0,0 +1,11 @@
param
(
[string]$fileFullPath,
[string]$version
)

[xml]$myXML = Get-Content $fileFullPath

$myXML.package.metadata.version = $version

$myXML.Save($fileFullPath)
1 change: 1 addition & 0 deletions CSharp/buildtools/updateAssemblyInfo.ps1
@@ -1,3 +1,4 @@
# Modify AssemblyInfo.cs files for delay signing: Remove InternalsVisibleTo attributes and add delay signing attributes.
Param ([string]$rootFolder = $(get-location).Path,
[string]$filePattern
)
Expand Down

0 comments on commit 3e130b0

Please sign in to comment.