Граф коммитов

22 Коммитов

Автор SHA1 Сообщение Дата
Doug Bunting 6949d439be
Restore `pushd` and `popd` (#397)
- oops, needed on TeamCity to find global.json
- left this unconditional, mostly for the odd local build from another folder
2023-03-07 16:39:29 -08:00
Doug Bunting 2da072a141
Use `msbuild` from VS 2022 if available (#395)
* Use `msbuild` from VS 2022 if available
  - should ease local and TeamCity builds
  - make `%InstallDir%` unquoted (unlike `%vswhere%`)
    - shorten `%Path%` slightly
  - nits:
    - use script location more; no need to change directories

* React to new build issues
  - follow up to #396
    (unsure why new FxCop and "spelling" errors didn't fail that PR)

* Put `PortReserver` users into an xUnit collection
2023-03-06 22:07:37 -08:00
Doug Bunting 0f4c62480b
Test Formatting assemblies w/ `net6.0` (#384)
- expand our text matrix to include a modern (and LTS) TFM
- change how Formatting test assemblies are found
  - `netcoreapp` is no longer the only relevant folder prefix
- use the latest .NET 6 SDK
  - install the 2.1.x runtime in the pipeline
- don't require .NET in VS
  - will use binplaced `msbuild` instead
  - have `git` ignore the new .msbuild/ folder
- react to new `Exception.Message`s in `netcoreapp3.1`
  - handle different formatting of argument info in `ArgumentException.Message`s
  - handle slightly greater `decimal` precision in a `JsonReaderException.Message`
- react to new `Exception.Message`s and other changes in `net6.0`
  - handle different `Message` in `InvalidOperationException`s about invalid request URIs
- react to other changes in `net6.0`
  - handle inability to mock a `Stream` if a writer passes a `ReadOnlySpan<byte>` in `net6.0`
    - see moq/moq4#829, moq/moq4#979, and dotnet/runtime#45152 about the issue
  - skip tests failing due to `HttpResponseMessage` changes
    - see #386 and dotnet/runtime@b48900f3b3 (which introduced this)
    - fix coming **Real Soon Now™️** 😁
- nits:
  - simplify define use now that `NETCOREAPP3_1_OR_GREATER` and so on are available
  - clean up .gitignore
  - clean up a few comments and tighten scripting up
2023-02-13 12:39:52 -08:00
Doug Bunting fc1cf70d82
Use latest 2.1.x .NET SDK (#381)
- noticed CI builds were using old 2.1.500
  - `UseDotNet@2` seems to ignore `rollForward` when using global.json :frown:
- nits:
  - quiet `dotnet` in CI (where `dotnet` is always new)
  - complain about all potentially missing components when VS isn't found
  - add a missing blank line
2023-01-24 15:42:49 -08:00
Doug Bunting c98af896fc
Build w/ VS 2019; restore w/ `msbuild` (#375)
- handle both SDK-style and legacy projects in one way
  - set `$(RestorePackagesConfig)` to cover both project types
- allow newer .NET SDKs to align w/ VS components
- make a few `<import/>`s conditional to avoid problems in `Restore` target evaluation
- restore global packages.config before building to make StyleCop available
- move second copies of packages.config packages into packages/ folder
- update FxCop TFM
  - .NET 4.0 not supported because current FxCopSdk is built against .NET 4.7.2
- suppress new warnings about old FxCop approach and not using `IFormatProvider`
2022-12-12 11:16:33 -08:00
Doug Bunting b943c83b3f
Autodetect CI environment (#373)
- check for CI environment variables in build.cmd
2022-12-11 21:22:19 -08:00
Doug Bunting 06589fb442
Do not fail tests immediately (#368)
- combine `RegexReplace` into `PrintTestRunSummary` task
  - remove unused `WarnOnNoMatch` parameter; inline other parameters
  - capture test summary in `msbuild` logs
    - avoid `System.Console` use in the task
  - fail task if any tests fail
- collect `xunit` task exit codes in case of catastrophic problems (not test failures)
  - fail build if `PrintTestRunSummary` doesn't but errors occurred

also:
- do not test assemblies in parallel; reduce port contention issues
- avoid `CallTarget` task

nits:
- clean some trailing whitespace in C# sources
  - mostly files I expect to update soon
- reduce `NuGet.exe restore` verbosity; no longer debugging that
- add console summary when using build.cmd
- reduce duplication in `RestorePackages` target
  - only restore NetCore projects when `$(BuildPortable)` is `true`
  - restore src NetStandard project transitively through NetStandard.Test project
- pass more properties w/ `Restore` target invocation
2022-11-23 17:07:19 -08:00
Doug Bunting 0b0f6bf068
Enable public Azure DevOps builds (#366)
- add azure-pipelines.yml
  - clean workspace when checking out the repo
  - build about the same matrix as we have on TeamCity in Main.Integration builds
    - run tests only in Release job by default
  - do component governance work only in Release job
  - do not inject CodeQL3000 tasks (when building main)
  - publish test results
  - jobs usually take less than 10 minutes
- change build.cmd to enable overrides of its command line parameters

nits:
- touch up .codeql.yml to avoid test code and include portable projects
2022-11-22 14:33:37 -08:00
Doug Bunting eae5661279
Ease builds on CI and locally (#364)
react to a smallish breaking change in newer Owin packages
  - add new test of `%` decoding to URI
- do not restore RuntimePortable.sln directly
  - NuGet.exe is no longer happy w/ that solution
- ignore binary logs
- ensure the .NET Core 2.1 VS component is installed
  - allow use of any 2.1.5xx .NET SDK
- add a few words to code analysis dictionary
- exclude files generated for `net45` legacy projects don't cause problems when compiling for `netstandard2.0`
- handle additional `ReflectionTypeLoadException`s when using the xUnit `msbuild` runner

nits:
- capitalize "MSBuild" consistently
- reduce indentation slightly
2022-11-19 15:32:34 -08:00
Doug Bunting f9577cbbda
Fix build on systems where VS 2017 isn't latest on the system (#210)
- no need to get things working where VS 2019 preview is the only build available
- start using .NET Core SDK 2.1.403
  - confirmed AppVeyor and wsr-tc agents both have this SDK
- correct ordering issue with restore of System.Net.Http.Formatting.NetCore project
2018-11-20 12:20:00 -08:00
Doug Bunting 634c9d2863 Move to MSBuild v15.0 and latest xUnit MSBuild runner
- change `CultureUtilTest` to use `Thread.CurrentThread`
  - when hosted in latest MSBuild, changing `thread.CurrentThread` changes `Thread.CurrentThread` instead
- find current Microsoft.Build.Tasks assembly in WebStack.tasks.targets, not just the WebApiHelpPage project
- add `$(TestInParallel)`
  - allows user to e.g. build in parallel but test assemblies serially
  - default remains doing everything in parallel
- change build.cmd to set %ErrorLevel% when exiting
- add empty top-level Directory.Build.* files

Use only VS 2017 or later
- ensure same MSBuild features are available in command-line and VS builds
- move `$(MinimumVisualStudioVersion)` project settings to global location and bump required version up

Use Microsoft.NET.Sdk and `<PackageReference/>`s in .NET Standard project
- create a "real" .NET Standard 1.1 assembly, not .NET Portable v5.0

Move to latest version of the xUnit MSBuild runner
- v2.3.0 has a few bugs related to XML results files e.g. xunit/xunit#1515
- switch to current XML results format (required with v2.3.0 but doesn't hurt with later versions)
- make runner discovery version-independent
- add support for `msbuild /t:test` in test project directories
2017-10-23 08:55:04 -07:00
Doug Bunting f830808d8f Create a .NET Standard 1.1 version of System.Net.Http.Formatting.dll
- bring System.Net.Http in from .NET Standard Library
- use .NET Standard version of Newtonsoft.Json
- bring other dependencies in transitively
- create initial test project, mostly a duplicate of existing "NetCore" one

nits:
- write detailed information to msbuild.log
- clean up trailing whitespace in a couple of test classes
2016-12-12 17:36:00 -08:00
Doug Bunting ddf07644e0 Build s/ latest MSBuild / Visual Studio installed
- #12
- find `MSBuild.exe` and `Microsoft.Build.Tasks.*.dll` for v14.0 before v12.0
- avoid code analysis warnings (about `static`) the latest compiler detects
- correct suppression check ids
- suppress MW1201 FxCop rule for `UriExtensions.TryReadQueryAs()` to avoid #16

nits:
- add solution for tools
- ignore .vs directory
2016-08-10 12:29:04 -07:00
dougbu fd2f238846 Remove build.cmd fallback to v4 version of MSBuild.exe
- we don't support .NET 4.0 and shouldn't build or test using the older
  target framework
- testing is particularly problematic since some unit tests fail due to
  .NET 4.0 quirks (legacy System.Uri behavior in particular)
- part 1 of fixes for #1960
2014-05-23 11:20:41 -07:00
dougbu 1e55e5173c Add comment for %MSBuild% setting
- CR follow-up
2013-11-12 20:54:27 -08:00
davidmatson 1a9445aa27 Run VS2013-compatible FxCop rules on VS2013. 2013-11-08 16:12:25 -08:00
dougbu 1bfee49f63 Get build working in any command window
- Prefer VS 2013 (v12.0) version of MSBuild.exe and fallback to v4.0 when necessary
- Do not rely on %Path% since that limits us to VS developer cmd windows
- Match Microsoft.Build.Tasks*.dll version to MSBuild.exe, not type of cmd window
- Have tested building in VS 2013, VS 2013 dev cmd window, and bare cmd window

Requires either a FxCopCmd.exe.config binding redirect or David's "VS2013 FxCop
compatibility" change for full VS 2013 support.
2013-11-08 16:06:26 -08:00
davidmatson 0f37426c4a Create separate CodeAnalysis configuration.
Remove SuppressMessage attributes from Release configuration.
Also, cleanup project file settings/make consistent.
2012-11-08 14:20:29 -08:00
davidmatson 45c1223c1d Report build failure, not success, when MSBuild returns a negative exit code. 2012-10-11 14:59:26 -07:00
anurse c7c349dda0 Added explicit Platform=Any CPU option to build.cmd to ease builds in x64 environments 2012-06-01 10:52:21 -07:00
bradwilson 1c4d4c9351 Setting /nr:false for build.cmd, will stop MSBUILD.exe from sticking around after builds are finished. 2012-04-04 14:39:59 -07:00
bradwilson 0f8c45fe03 Initial revision. 2012-03-11 10:17:56 -07:00