Skip to content

Commit

Permalink
Add release notes in chocolatey package
Browse files Browse the repository at this point in the history
  • Loading branch information
pmiossec committed Nov 24, 2013
1 parent 5246fe4 commit 3f5770c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
3 changes: 3 additions & 0 deletions ChocolateyTemplates/gittfs.nuspec
Expand Up @@ -10,6 +10,9 @@
<description>git-tfs is a two-way bridge between TFS and git, similar to git-svn. It fetches TFS commits into a git repository, and lets you push your updates back to TFS.</description>
<projectUrl>https://github.com/git-tfs/git-tfs</projectUrl>
<tags>git tfs git-tfs sourceControl</tags>
<releaseNotes>
${ReleaseNotesContents}
</releaseNotes>
<licenseUrl>https://github.com/git-tfs/git-tfs/blob/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<dependencies>
Expand Down
29 changes: 22 additions & 7 deletions Release.proj
Expand Up @@ -164,12 +164,6 @@

<!-- Chocolatey-related files. -->
<ItemGroup>
<ChocolateyTokens Include="PackageVersion">
<ReplacementValue>$(Version)</ReplacementValue>
</ChocolateyTokens>
<ChocolateyTokens Include="DownloadUrl">
<ReplacementValue>$(DownloadUrl)</ReplacementValue>
</ChocolateyTokens>
<!-- TemplateFile needs a full path, so we define the output files here so that MSBuild can resolve the paths. -->
<ChocolateyNuspec Include="$(ChocolateyBuildDir)\gittfs.nuspec" />
<ChocolateyInstallScript Include="$(ChocolateyBuildDir)/tools/chocolateyInstall.ps1" />
Expand All @@ -185,8 +179,29 @@
<MakeDir Directories="$(ChocolateyBuildDir)\tools" />
</Target>

<!-- Internal. -->
<Target Name="ChocolateyReadReleaseNotes">
<ReadLinesFromFile File="$(ReleaseNotes)" Condition="'$(ReleaseNotes)' != ''">
<Output TaskParameter="Lines" ItemName="ReleaseNotesContents" />
</ReadLinesFromFile>
<ItemGroup Condition="'$(ReleaseNotes)' == ''">
<ReleaseNotesContents Include="See https://github.com/git-tfs/git-tfs/releases/tag/v$(Version)" />
</ItemGroup>
</Target>

<!-- Internal: Generate a nuspec file for the chocolatey package. -->
<Target Name="ChocolateyNuspec" DependsOnTargets="VersionRequired; MSBuildCommunityTasks; ChocolateyTempDir">
<Target Name="ChocolateyNuspec" DependsOnTargets="VersionRequired; MSBuildCommunityTasks; ChocolateyTempDir; ChocolateyReadReleaseNotes">
<ItemGroup>
<ChocolateyTokens Include="PackageVersion">
<ReplacementValue>$(Version)</ReplacementValue>
</ChocolateyTokens>
<ChocolateyTokens Include="DownloadUrl">
<ReplacementValue>$(DownloadUrl)</ReplacementValue>
</ChocolateyTokens>
<ChocolateyTokens Include="ReleaseNotesContents">
<ReplacementValue>@(ReleaseNotesContents, '%0a')</ReplacementValue>
</ChocolateyTokens>
</ItemGroup>
<TemplateFile
Template="$(ChocolateyTemplateDir)\gittfs.nuspec"
OutputFilename="%(ChocolateyNuspec.FullPath)"
Expand Down

0 comments on commit 3f5770c

Please sign in to comment.