Commit Graph

6 Commits

Author SHA1 Message Date
Doug Bunting 37e562902f Support single `IDocumentProvider` method signature
- #8593
- also find `IDocumentProvider` using a more-laborious process
  - `Type.GetType(string)` requires an assembly-qualified name and we don't know the assembly
- default method name now `GenerateAsync`
- only supported signature is `public Task GenerateAsync(string, TextWriter)`

also:
- handle more error cases in the tool's inside man
- avoid an empty document file if `IDocumentProvider.GenerateAsync(...)` fails
- unwrap an `AggregateException`

nits:
- remove duplicate comments
- change `GetDocumentCommandWorker.TryProcess(...)` to return `false` on failure
  - minor because return value is currently ignored
- rename `GetDocumentCommandContext.Output` -> `OutputPath`
- reflect recent change to `dotnet-getdocument`'s `Resources.resx` file in its designer file
2018-10-27 15:27:33 -07:00
Doug Bunting 5cd86977ed
Rename client code generation components
- #8523
- main project / package --> `Microsoft.Extensions.ApiDescription.Design`
- tasks assembly and namespace --> `Microsoft.Extensions.ApiDescription.Tasks`
- tool namespace --> `Microsoft.Extensions.ApiDescription.Tool`
- targets --> verbs e.g. `GenerateTypeScriptNSwag` and `GenerateDocumentDefault`
- `@(ServiceProjectReference)` metadata -> align with common MSBuild project properties
  - exception: `$(MSBuildProjectExtensionsPath)`; it's readonly and `%(ProjectExtensionsPath)` is unambiguous
    - use `%(ProjectExtensionsPath)`
  - also add `%(Targets)` metadata and remove unused `%(ProjectRuntimeIdentifier)`
- `@(<ServiceProjectReferenceMetadata)` metadata -> align with MSBuild project properties
  - exceptions: `$(MSBuildProjectDirectory)`, `$(MSBuildProjectExtensionsPath)` and `$(MSBuildProjectName)`
    - readonly properties and names already unambiguous
2018-10-10 14:52:57 -07:00
Doug Bunting d3442f3590
Create a single Microsoft.Extensions.ApiDescription.Client package
- #8428
- add signing-related and PackageVerifier configuration for new package
- remove packaging configuration from dotnet-getdocument project
- adjust `dotnet-getdocument` invocation to its new location
- remove use of nonexistent (ignored) `dotnet-getdocument --no-build` option

Remove `--uri` feature from `dotnet-getdocument`
- reduce dependencies from Microsoft.AspNetCore.TestHost to Microsoft.AspNetCore.Hosting.Abstractions
  - assume web site depends on that
- merge `DownloadFileCore` into `DownloadFile`
- remove other unecessary code e.g. `WrappedException` was never `throw`n

Correct issues in `DownloadFile`
- e.g. dispose of `responseStream`, use `await` more, support FIPS-compliant machines

nits:
- clean up `Project` and the metadata it fetches
- remove unnecessary `.props` and `.targets` files
2018-10-10 14:52:56 -07:00
Doug Bunting 6ffcf3571e
Remove T4 custom tool
- use same generator as most other projects in aspnet repos
  - were not using named arguments to resource methods anyhow
- update resources to use regular (numbered) format parameters
- adjust to new `Resources` namespace; no need for separate `using`
- use `Format...(...)` methods as necessary
2018-10-10 14:52:54 -07:00
Doug Bunting 25d0916b49
Use one namespace for the three client code generation projects
- also cleared out most uses of `GetDocument` and `GenerationTasks` in MSBuild and strings
- temporarily fixed up T4 templates, adding Resources.tt (will remove custom generation soon)
2018-10-10 14:52:53 -07:00
Doug Bunting 95b4dc8ca0
Add first cut of Microsoft.Extensions.ApiDescription.Client package / project
- WIP in a number of ways
2018-10-10 14:52:36 -07:00