Skip to content

Set ProductVersion by having a common props file #142

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

Merged
merged 4 commits into from
Feb 2, 2019

Conversation

TylerLeonhardt
Copy link
Member

With this change, you'll be able to do:

get-item ./Microsoft.Azure.Functions.PowerShellWorker.dll | % VersionInfo

to get the Version info. If you specifically want the ProductVersion, you can do:

get-item ./Microsoft.Azure.Functions.PowerShellWorker.dll | % VersionInfo | % ProductVersion
get-item ./Microsoft.Azure.Functions.PowerShellWorker.dll | % VersionInfo

ProductVersion   FileVersion      FileName
--------------   -----------      --------
0.1.9999-alpha   0.1.9999.0       /home/tyler/Code/PowerShell/azure-functions-powershell-worker/package/bin/Debug/Microsoft.Azure.Functions.PowerShellWorker.0.1.9999-al…

This will help us know which version of the worker is available.

<Project>
<PropertyGroup>
<BuildNumber Condition="$(APPVEYOR) != ''">$(APPVEYOR_BUILD_NUMBER)</BuildNumber>
<BuildNumber Condition="$(APPVEYOR) == ''">9999</BuildNumber>
Copy link

@SteveL-MSFT SteveL-MSFT Jan 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just use the date if it's not built in appveyor? This comment is not blocking.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now using the date - could only use month and day because BuildNumber can only be 4 digits max.

<PropertyGroup>
<BuildNumber Condition="$(APPVEYOR) != ''">$(APPVEYOR_BUILD_NUMBER)</BuildNumber>
<BuildNumber Condition="$(APPVEYOR) == ''">9999</BuildNumber>
<Version>0.1.$(BuildNumber)-alpha</Version>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we should call this preview instead of alpha.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to preview

@@ -3,17 +3,15 @@ Copyright (c) Microsoft. All rights reserved.
Licensed under the MIT license. See LICENSE file in the project root for full license information.
-->
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Microsoft.Azure.Functions.PowerShellWorker.Common.props))\Microsoft.Azure.Functions.PowerShellWorker.Common.props" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use <Import Project="..\Microsoft.Azure.Functions.PowerShellWorker.Common.props" />?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this so you would be able to build the project from anywhere on the file system, but it's probably not needed since build.ps1 is our entry point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -3,6 +3,7 @@ Copyright (c) Microsoft. All rights reserved.
Licensed under the MIT license. See LICENSE file in the project root for full license information.
-->
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Microsoft.Azure.Functions.PowerShellWorker.Common.props))\Microsoft.Azure.Functions.PowerShellWorker.Common.props" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, why not <Import Project="..\Microsoft.Azure.Functions.PowerShellWorker.Common.props" />?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Microsoft.Azure.Functions.PowerShellWorker.Common.props))\Microsoft.Azure.Functions.PowerShellWorker.Common.props" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -0,0 +1,11 @@
<Project>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking. Maybe the file name can be simplified a bit? like PowerShellWorker.Common.props.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@TylerLeonhardt
Copy link
Member Author

I'll merge this in now @daxian-dbw let me know if you need me to address anything else!

@TylerLeonhardt TylerLeonhardt merged commit 1ff1010 into Azure:dev Feb 2, 2019
@TylerLeonhardt TylerLeonhardt deleted the set-productversion branch February 2, 2019 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants