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

Make it possible to change when client code generation runs #4924

Closed
dougbu opened this issue Oct 7, 2018 · 1 comment
Closed

Make it possible to change when client code generation runs #4924

dougbu opened this issue Oct 7, 2018 · 1 comment
Assignees
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one

Comments

@dougbu
Copy link
Member

dougbu commented Oct 7, 2018

Is this a Bug or Feature request?

Enhancement that's part of #4896

Description of the problem

Currently, any project that references the Microsoft.Extensions.ApiDescription.Client will have the ServiceFileReferenceGenerator and related targets run unconditionally before the BeforeCompile target. Make this conditional so that users can configure the targets to run elsewhere in the build pipeline. For example, use $(BuildDependsOn), $(CoreBuildDependsOn), $(CompileDependsOn) or $(CoreCompileDependsOn) and make it conditional on a documented property.

Not positive where hook should land but prepending it into $(BuildDependsOn) seems better than current spot because the code generation targets do not rely on other Build or Compile work.

Version of Microsoft.AspNetCore.Mvc or Microsoft.AspNetCore.App or Microsoft.AspNetCore.All

See the features/client.code.generation branch. That work is intended for the 2.2 Preview 3 milestone.

@dougbu dougbu self-assigned this Oct 7, 2018
@aspnet-hello aspnet-hello transferred this issue from aspnet/Mvc Dec 14, 2018
@aspnet-hello aspnet-hello assigned dougbu and unassigned dougbu Dec 14, 2018
@aspnet-hello aspnet-hello added this to the ClientCodeGen milestone Dec 14, 2018
@aspnet-hello aspnet-hello added 1 - Ready area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates enhancement This issue represents an ask for new feature or an enhancement to an existing one labels Dec 14, 2018
@mkArtakMSFT mkArtakMSFT modified the milestones: ClientCodeGen, 3.0.0-preview4 Feb 6, 2019
@dougbu dougbu modified the milestones: 3.0.0-preview5, 3.0.0-preview6 Apr 18, 2019
@mkArtakMSFT mkArtakMSFT modified the milestones: 3.0.0-preview6, Backlog Apr 19, 2019
@dougbu dougbu added Working and removed 1 - Ready labels May 29, 2019
dougbu added a commit that referenced this issue May 30, 2019
- `$(OpenApiGenerateBeforeCompile)` controls if targets run before compile targets
  - #4924
  - also correct multiple invocations when project has multiple target frameworks
- `$(OpenApiBuildReferencedProjects)` controls whether `@(OpenApiProjectReference)` items build automatically
  - #6582

also:
- add symbols for Microsoft.Extensions.ApiDescription.Client task assembly
  - #10508
- unconditionally run `OpenApiGetDocuments` target in referenced projects
  - corrects compilation in design-time builds
  - no longer uses `@(ProjectReferenceWithConfiguration)`; referenced project chooses all property values

nits:
- don't remove `$(TargetFrameworks)` when invoking `OpenApiGetDocuments` target (not necessary)
- consolidate into a single `$(GenerateOpenApiReferenceCodeDependsOn)` property
- rename task assembly and namespaces in Microsoft.Extensions.ApiDesription.Client to match the project
- allow `OpenApiGetDocuments` targets to run in parallel if `$(BuildInParallel)` is enabled
- remove `$(OpenApiDefaultOutputDirectory)` normalization; never concatenated with anything else
- remove dangling `GenerateServiceFileReferenceCode` names
@mkArtakMSFT mkArtakMSFT modified the milestones: Backlog, 3.0.0-preview6 May 30, 2019
dougbu added a commit that referenced this issue May 31, 2019
- `$(OpenApiGenerateBeforeCompile)` controls if targets run before compile targets
  - #4924
  - also correct multiple invocations when project has multiple target frameworks
- `$(OpenApiBuildReferencedProjects)` controls whether `@(OpenApiProjectReference)` items build automatically
  - #6582

also:
- add symbols for Microsoft.Extensions.ApiDescription.Client task assembly
  - #10508
- unconditionally run `OpenApiGetDocuments` target in referenced projects
  - corrects compilation in design-time builds
  - no longer uses `@(ProjectReferenceWithConfiguration)`; referenced project chooses all property values

nits:
- don't remove `$(TargetFrameworks)` when invoking `OpenApiGetDocuments` target (not necessary)
- consolidate into a single `$(GenerateOpenApiReferenceCodeDependsOn)` property
- rename task assembly and namespaces in Microsoft.Extensions.ApiDesription.Client to match the project
- allow `OpenApiGetDocuments` targets to run in parallel if `$(BuildInParallel)` is enabled
- remove `$(OpenApiDefaultOutputDirectory)` normalization; never concatenated with anything else
- remove dangling `GenerateServiceFileReferenceCode` names
dougbu added a commit that referenced this issue Jun 1, 2019
- `$(OpenApiGenerateBeforeCompile)` controls if targets run before compile targets
  - #4924
  - also correct multiple invocations when project has multiple target frameworks
- `$(OpenApiBuildReferencedProjects)` controls whether `@(OpenApiProjectReference)` items build automatically
  - #6582

also:
- add symbols for Microsoft.Extensions.ApiDescription.Client task assembly
  - #10508
- unconditionally run `OpenApiGetDocuments` target in referenced projects
  - corrects compilation in design-time builds
  - no longer uses `@(ProjectReferenceWithConfiguration)`; referenced project chooses all property values

nits:
- don't remove `$(TargetFrameworks)` when invoking `OpenApiGetDocuments` target (not necessary)
- consolidate into a single `$(GenerateOpenApiReferenceCodeDependsOn)` property
- rename task assembly and namespaces in Microsoft.Extensions.ApiDesription.Client to match the project
- allow `OpenApiGetDocuments` targets to run in parallel if `$(BuildInParallel)` is enabled
- remove `$(OpenApiDefaultOutputDirectory)` normalization; never concatenated with anything else
- remove dangling `GenerateServiceFileReferenceCode` names
dougbu added a commit that referenced this issue Jun 3, 2019
- `$(OpenApiGenerateBeforeCompile)` controls if targets run before compile targets
  - #4924
  - also correct multiple invocations when project has multiple target frameworks
- `$(OpenApiBuildReferencedProjects)` controls whether `@(OpenApiProjectReference)` items build automatically
  - #6582

also:
- add symbols for Microsoft.Extensions.ApiDescription.Client task assembly
  - #10508
- unconditionally run `OpenApiGetDocuments` target in referenced projects
  - corrects compilation in design-time builds
  - no longer uses `@(ProjectReferenceWithConfiguration)`; referenced project chooses all property values

nits:
- don't remove `$(TargetFrameworks)` when invoking `OpenApiGetDocuments` target (not necessary)
- consolidate into a single `$(GenerateOpenApiReferenceCodeDependsOn)` property
- rename task assembly and namespaces in Microsoft.Extensions.ApiDesription.Client to match the project
- allow `OpenApiGetDocuments` targets to run in parallel if `$(BuildInParallel)` is enabled
- remove `$(OpenApiDefaultOutputDirectory)` normalization; never concatenated with anything else
- remove dangling `GenerateServiceFileReferenceCode` names
dougbu added a commit that referenced this issue Jun 3, 2019
…0641)

- `$(OpenApiGenerateCodeOnBuild)` controls if targets run before compile targets
  - #4924
  - also correct multiple invocations when project has multiple target frameworks
- `$(OpenApiBuildReferencedProjects)` controls whether `@(OpenApiProjectReference)` items build automatically
  - #6582
- rename a few other properties and targets

also:
- add symbols for Microsoft.Extensions.ApiDescription.Client task assembly
  - #10508
- unconditionally run `OpenApiGetDocuments` target in referenced projects
  - corrects compilation in design-time builds
  - no longer uses `@(ProjectReferenceWithConfiguration)`; referenced project chooses all property values

nits:
- consolidate into a single `$(GenerateOpenApiCodeDependsOn)` property
- rename task assembly and namespaces in Microsoft.Extensions.ApiDesription.Client to match the project
- allow `OpenApiGetDocuments` targets to run in parallel if `$(BuildInParallel)` is enabled
- remove `$(OpenApiCodeDirectory)` normalization; never concatenated with anything else
@dougbu
Copy link
Member Author

dougbu commented Jun 3, 2019

2567233

@dougbu dougbu closed this as completed Jun 3, 2019
@dougbu dougbu added Done This issue has been fixed and removed Working labels Jun 3, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one
Projects
None yet
Development

No branches or pull requests

3 participants