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

Update files to remove explicit version number in readmes and templates #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
33 changes: 32 additions & 1 deletion Directory.Build.Targets
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<None Include="Sdk\**"
Pack="true"
PackagePath="Sdk\" />
<None Include="README.md" Condition="EXISTS('README.md')" Pack="true" PackagePath="\" />
<None Include="README.md" Condition="EXISTS('README.md')" Pack="true" PackagePath="\" ReplaceVersion="true" />
<None Include="$(PackageLicensePath)"
Pack="true"
PackagePath="$(PackageLicenseFile)"
Expand All @@ -43,5 +43,36 @@
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="All" />
</ItemGroup>

<Target Name="UpdateFiles" BeforeTargets="BeforeBuild" DependsOnTargets="GetBuildVersion">
<ItemGroup>
<_Temporary Remove="@(_Temporary)" />
<_Temporary Include="@(None->HasMetadata('ReplaceVersion'))">
<SourceGroup>None</SourceGroup>
<SourceFile>%(Identity)</SourceFile>
<VersionedFile>$([System.IO.Path]::Combine($(IntermediateOutputPath),%(Identity)))</VersionedFile>
<PackagePath>$([MSBuild]::ValueOrDefault('%(None.PackagePath)', '%(Identity)'))</PackagePath>
</_Temporary>
<_Temporary Include="@(Content->HasMetadata('ReplaceVersion'))">
<SourceGroup>Content</SourceGroup>
<SourceFile>%(Identity)</SourceFile>
<VersionedFile>$([System.IO.Path]::Combine($(IntermediateOutputPath),%(Identity)))</VersionedFile>
<PackagePath>$([MSBuild]::ValueOrDefault('%(Content.PackagePath)', 'content\%(Identity)'))</PackagePath>
</_Temporary>
</ItemGroup>
<Message Text="%(_Temporary.Identity)" Importance="high" />
<WriteLinesToFile
File="%(_Temporary.VersionedFile)"
Lines="$([System.IO.File]::ReadAllText('%(_Temporary.SourceFile)').Replace('$version$','$(Version)'))"
Overwrite="true"
Encoding="Unicode"/>
<ItemGroup>
<None Remove="@(_Temporary->WithMetadataValue('SourceGroup','None'))" />
<None Include="@(_Temporary->WithMetadataValue('SourceGroup','None')->'%(VersionedFile)')" />

<Content Remove="@(_Temporary->WithMetadataValue('SourceGroup','Content'))" />
<Content Include="@(_Temporary->WithMetadataValue('SourceGroup','Content')->'%(VersionedFile)')" />
</ItemGroup>
</Target>

</Project>
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ When using an MSBuild Project SDK obtained via NuGet (such as the SDKs in this r
Either append the version to the package name:

```xml
<Project Sdk="MSBuild.SDK.SystemWeb/4.0.88">
<Project Sdk="MSBuild.SDK.SystemWeb/4.0.xx">
...
```

Expand All @@ -50,11 +50,13 @@ Or omit the version from the SDK attribute and specify it in the version in `glo
```json
{
"msbuild-sdks": {
"MSBuild.SDK.SystemWeb" : "4.0.88"
"MSBuild.SDK.SystemWeb" : "4.0.xx"
}
}
```

Where `xx` is the latest release available on [nuget.org](https://nuget.org/packages/MSBuild.SDK.SystemWeb)

Since MSBuild 15.6, SDKs are downloaded as NuGet packages automatically. Earlier versions of MSBuild 15 required SDKs to be installed.

For more information, [read the documentation](https://docs.microsoft.com/visualstudio/msbuild/how-to-use-project-sdk).
Expand Down
6 changes: 4 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ When using an MSBuild Project SDK obtained via NuGet (such as the SDKs in this r
Either append the version to the package name:

```xml
<Project Sdk="MSBuild.SDK.SystemWeb/4.0.88">
<Project Sdk="MSBuild.SDK.SystemWeb/4.0.xx">
...
```

Expand All @@ -45,11 +45,13 @@ Or omit the version from the SDK attribute and specify it in the version in `glo
```json
{
"msbuild-sdks": {
"MSBuild.SDK.SystemWeb" : "4.0.88"
"MSBuild.SDK.SystemWeb" : "4.0.xx"
}
}
```

Where `xx` is the latest release available on [nuget.org](https://nuget.org/packages/MSBuild.SDK.SystemWeb)

Since MSBuild 15.6, SDKs are downloaded as NuGet packages automatically. Earlier versions of MSBuild 15 required SDKs to be installed.

For more information, [read the documentation](https://docs.microsoft.com/visualstudio/msbuild/how-to-use-project-sdk).
Expand Down
6 changes: 4 additions & 2 deletions docs/RazorLibrary.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ When using an MSBuild Project SDK obtained via NuGet (such as the SDKs in this r
Either append the version to the package name:

```xml
<Project Sdk="MSBuild.SDK.SystemWeb.RazorLibrary/4.0.88">
<Project Sdk="MSBuild.SDK.SystemWeb.RazorLibrary/4.0.xx">
...
```

Expand All @@ -23,11 +23,13 @@ Or omit the version from the SDK attribute and specify it in the version in `glo
```json
{
"msbuild-sdks": {
"MSBuild.SDK.SystemWeb.RazorLibrary" : "4.0.88"
"MSBuild.SDK.SystemWeb.RazorLibrary" : "4.0.xx"
}
}
```

Where `xx` is the latest release available on [nuget.org](https://nuget.org/packages/MSBuild.SDK.SystemWeb.RazorLibrary)

You can also use the [templates](../MSBuild.SDK.SystemWeb.Templates) to easily create new projects.

## Documentation
Expand Down
6 changes: 4 additions & 2 deletions docs/SDK.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ When using an MSBuild Project SDK obtained via NuGet (such as the SDKs in this r
Either append the version (as shown in the nuget shield above) to the package name:

```xml
<Project Sdk="MSBuild.SDK.SystemWeb/4.0.88">
<Project Sdk="MSBuild.SDK.SystemWeb/4.0.xx">
...
```

Expand All @@ -22,13 +22,15 @@ Or omit the version from the SDK attribute and specify it in the version in `glo
```json
{
"msbuild-sdks": {
"MSBuild.SDK.SystemWeb" : "4.0.88"
"MSBuild.SDK.SystemWeb" : "4.0.xx"
}
}
```

You can also use the [templates](Templates.md) to easily create new projects.

Where `xx` is the latest release available on [nuget.org](https://nuget.org/packages/MSBuild.SDK.SystemWeb)

## Properties

### Common Properties
Expand Down
4 changes: 2 additions & 2 deletions src/MSBuild.SDK.SystemWeb.RazorLibrary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ When using an MSBuild Project SDK obtained via NuGet (such as the SDKs in this r
Either append the version to the package name:

```xml
<Project Sdk="MSBuild.SDK.SystemWeb.RazorLibrary/4.0.88">
<Project Sdk="MSBuild.SDK.SystemWeb.RazorLibrary/$version$">
...
```

Expand All @@ -23,7 +23,7 @@ Or omit the version from the SDK attribute and specify it in the version in `glo
```json
{
"msbuild-sdks": {
"MSBuild.SDK.SystemWeb.RazorLibrary" : "4.0.88"
"MSBuild.SDK.SystemWeb.RazorLibrary" : "$version$"
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,8 @@
</ItemGroup>

<ItemGroup>
<Content Remove="templates\RazorLibrary.SystemWeb.CS\App_Start\RazorGeneratorMvcStart.cs" />
<Content Remove="templates\RazorLibrary.SystemWeb.VB\App_Start\RazorGeneratorMvcStart.vb" />
</ItemGroup>

<ItemGroup>
<Compile Include="templates\RazorLibrary.SystemWeb.CS\App_Start\RazorGeneratorMvcStart.cs" />
<Compile Include="templates\RazorLibrary.SystemWeb.VB\App_Start\RazorGeneratorMvcStart.vb" />
<Content Update="templates\**\*.vbproj" ReplaceVersion="true" />
<Content Update="templates\**\*.csproj" ReplaceVersion="true" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.SDK.SystemWeb/4.0.88">
<Project Sdk="MSBuild.SDK.SystemWeb/$version$">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.SDK.SystemWeb/4.0.88">
<Project Sdk="MSBuild.SDK.SystemWeb/$version$">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.SDK.SystemWeb/4.0.88">
<Project Sdk="MSBuild.SDK.SystemWeb/$version$">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<Copyright>Copyright © (copyrightYear)</Copyright>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.SDK.SystemWeb/4.0.88">
<Project Sdk="MSBuild.SDK.SystemWeb/$version$">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<Copyright>Copyright © (copyrightYear)</Copyright>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.SDK.SystemWeb.RazorLibrary/4.0.88">
<Project Sdk="MSBuild.SDK.SystemWeb.RazorLibrary/$version$">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.SDK.SystemWeb.RazorLibrary/4.0.88">
<Project Sdk="MSBuild.SDK.SystemWeb.RazorLibrary/$version$">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
Expand Down
Binary file modified src/MSBuild.SDK.SystemWeb/README.md
Binary file not shown.