Skip to content

Commit 4d4640c

Browse files
committed
Prepare to release 1.0.1
1 parent 80ef3b5 commit 4d4640c

File tree

6 files changed

+84
-4
lines changed

6 files changed

+84
-4
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.1] - 2021-01-10
9+
10+
### Changed
11+
12+
- Debug symbols are no longer in the NuGet package and are now published to the NuGet symbol location that is built in to Visual Studio. See the readme to load debug symbols for prerelease builds from MyGet.
13+
14+
## [1.0.0] - 2020-02-01
15+
16+
### Added
17+
18+
- Initial release, targeting .NET Standard 2.0. Ability to track a `Task`, invoke a `Func<Task>`, post a synchronous or async callback to the current or specified synchronization context, and wait for all of the above.

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright © 2019–2020 Technology Solutions Associates, LLC
3+
Copyright © 2019–2021 Technology Solutions Associates, LLC
44

55
All rights reserved.
66

Readme.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# AmbientTasks [![NuGet badge](https://img.shields.io/nuget/v/AmbientTasks)](https://www.nuget.org/packages/AmbientTasks/ "NuGet (releases)") [![MyGet badge](https://img.shields.io/myget/ambienttasks/vpre/AmbientTasks.svg?label=myget)](https://www.myget.org/feed/ambienttasks/package/nuget/AmbientTasks "MyGet (prereleases)") [![Gitter badge](https://img.shields.io/gitter/room/Techsola/AmbientTasks)](https://gitter.im/Techsola/AmbientTasks "Chat on Gitter") [![Build status badge](https://github.com/Techsola/AmbientTasks/workflows/CI/badge.svg)](https://github.com/Techsola/AmbientTasks/actions?query=workflow%3ACI "Build status") [![codecov badge](https://codecov.io/gh/Techsola/AmbientTasks/branch/master/graph/badge.svg)](https://codecov.io/gh/Techsola/AmbientTasks "Test coverage")
1+
# AmbientTasks [![NuGet badge](https://img.shields.io/nuget/v/AmbientTasks)](https://www.nuget.org/packages/AmbientTasks/ "NuGet (releases)") [![MyGet badge](https://img.shields.io/myget/ambienttasks/vpre/AmbientTasks.svg?label=myget)](https://www.myget.org/feed/ambienttasks/package/nuget/AmbientTasks "MyGet (prereleases)") [![Gitter badge](https://img.shields.io/gitter/room/Techsola/AmbientTasks)](https://gitter.im/Techsola/AmbientTasks "Chat on Gitter") [![Build status badge](https://dev.azure.com/Techsola/AmbientTasks/_apis/build/status/AmbientTasks%20CI?branchName=master)](https://dev.azure.com/Techsola/AmbientTasks/_build/latest?definitionId=1&branchName=master "Build status") [![codecov badge](https://codecov.io/gh/Techsola/AmbientTasks/branch/master/graph/badge.svg)](https://codecov.io/gh/Techsola/AmbientTasks "Test coverage")
2+
3+
All notable changes are documented in [CHANGELOG.md](CHANGELOG.md).
24

35
Enables scoped completion tracking and error handling of tasks as an alternative to fire-and-forget and `async void`. Easy to produce and consume, and test-friendly.
46

@@ -156,3 +158,15 @@ private void SomeEventHandler(object sender, EventArgs e)
156158
Finally, await `AmbientTasks.WaitAllAsync()` in your test code whenever `AmbientTasks.Add` is used. This gets the timing right and routes any background exceptions to the responsible test.
157159

158160
It could potentially make sense to delay the application exit until `AmbientTasks.WaitAllAsync()` completes, too, depending on your needs.
161+
162+
## Debugging into AmbientTasks source
163+
164+
Stepping into AmbientTasks source code, pausing the debugger while execution is inside AmbientTasks code and seeing the source, and setting breakpoints in AmbientTasks all require loading symbols for AmbientTasks. To do this in Visual Studio:
165+
166+
1. Go to Debug > Options, and uncheck ‘Enable Just My Code.’ (It’s a good idea to reenable this as soon as you’re finished with the task that requires debugging into a specific external library.)
167+
*Before* doing this, because Visual Studio can become unresponsive when attempting to load symbols for absolutely everything, I recommend going to Debugging > Symbols within the Options window and selecting ‘Load only specified modules.’
168+
169+
2. If you are using a version that was released to nuget.org, enable the built-in ‘NuGet.org Symbol Server’ symbol location.
170+
If you are using a prerelease version of AmbientTasks package, go to Debugging > Symbols within the Options window and add this as a new symbol location: `https://www.myget.org/F/ambienttasks/api/v2/symbolpackage/`
171+
172+
3. If ‘Load only specified modules’ is selected in Options > Debugging > Symbols, you will have to explicitly tell Visual Studio to load symbols for AmbientTasks. One way to do this while debugging is to go to Debug > Windows > Modules and right-click on AmbientTasks. Select ‘Load Symbols’ if you only want to do it for the current debugging session. Select ‘Always Load Automatically’ if you want to load symbols now and also add the file name to a list so that Visual Studio loads AmbientTasks symbols in all future debug sessions when Just My Code is disabled.

build.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ if ($SigningCertThumbprint) {
4141
# Pack
4242
Remove-Item -Recurse -Force $packagesDir -ErrorAction Ignore
4343

44+
. build\ValidateMetadata.ps1
45+
ValidateMetadata $versionInfo.ProductVersion -Release:$Release
46+
4447
dotnet pack --no-build --output $packagesDir /bl:"$logsDir\pack.binlog" @dotnetArgs
4548
if ($LastExitCode) { exit 1 }
4649

build/ValidateMetadata.ps1

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
function ValidateMetadata(
2+
[Parameter(Mandatory=$true)] [string] $ProductVersion,
3+
[switch] $Release
4+
) {
5+
$lastReleasedVersion = XmlPeek src\AmbientTasks\AmbientTasks.csproj '/Project/PropertyGroup/Version/text()'
6+
7+
if ($Release) {
8+
$productVersionWithoutBuildMetadata = $ProductVersion.Substring(0, $ProductVersion.IndexOf('+'))
9+
if ($lastReleasedVersion -ne $productVersionWithoutBuildMetadata) {
10+
throw 'The version must be updated in the .csproj to do a release build.'
11+
}
12+
}
13+
14+
$changelogHeaderLines = Select-String -Path CHANGELOG.md -Pattern ('## [' + $lastReleasedVersion + ']') -SimpleMatch
15+
if ($changelogHeaderLines.Count -ne 1) {
16+
throw "There must be exactly one entry in CHANGELOG.md for version $lastReleasedVersion."
17+
}
18+
19+
$urlAnchor = $changelogHeaderLines[0].Line.Substring('## '.Length).Replace(' ', '-') -replace '[^-\w]', ''
20+
$requiredReleaseNotesLink = "https://github.com/Techsola/AmbientTasks/blob/v$lastReleasedVersion/CHANGELOG.md#$urlAnchor"
21+
$packageReleaseNotes = XmlPeek src\AmbientTasks\AmbientTasks.csproj '/Project/PropertyGroup/PackageReleaseNotes/text()'
22+
23+
if (-not $packageReleaseNotes.Contains($requiredReleaseNotesLink)) {
24+
throw 'Package release notes in .csproj must contain this URL: ' + $requiredReleaseNotesLink
25+
}
26+
27+
if ($packageReleaseNotes.Length -ne $packageReleaseNotes.Trim().Length) {
28+
throw 'Package release notes must not begin or end with whitespace.'
29+
}
30+
31+
foreach ($line in $packageReleaseNotes.Split(@("`r`n", "`r", "`n"), [StringSplitOptions]::None)) {
32+
if ([string]::IsNullOrWhiteSpace($line)) {
33+
if ($line.Length -ne 0) {
34+
throw 'Package release notes must not have whitespace-only lines.'
35+
}
36+
} elseif ($line.Length -ne $line.TrimEnd().Length -and $line.Length -ne $line.TrimEnd().Length + 2) {
37+
throw 'Package release notes must not have trailing whitespace.'
38+
} elseif ($line.Length -ne $line.TrimStart().Length) {
39+
throw 'Package release notes must not be indented.'
40+
}
41+
}
42+
}

src/AmbientTasks/AmbientTasks.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
<SignAssembly>true</SignAssembly>
88
<AssemblyOriginatorKeyFile>..\AmbientTasks.snk</AssemblyOriginatorKeyFile>
99

10-
<Version>1.0.0</Version>
10+
<Version>1.0.1</Version>
11+
<PackageReleaseNotes>Debug symbols are no longer in the NuGet package and are now published to the NuGet symbol location that is built in to Visual Studio. See the readme to load debug symbols for prerelease builds from MyGet.
12+
13+
(https://github.com/Techsola/AmbientTasks/blob/v1.0.1/CHANGELOG.md#101---2021-01-10)</PackageReleaseNotes>
1114
<Authors>Technology Solutions Associates</Authors>
12-
<Copyright>Copyright © 2019–2020 Technology Solutions Associates</Copyright>
15+
<Copyright>Copyright © 2019–2021 Technology Solutions Associates</Copyright>
1316
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1417
<PackageProjectUrl>https://github.com/Techsola/AmbientTasks</PackageProjectUrl>
1518
<RepositoryUrl>https://github.com/Techsola/AmbientTasks</RepositoryUrl>

0 commit comments

Comments
 (0)