Skip to content

Fix a typo and address remaining service reference TODO items #13364

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

Merged
merged 2 commits into from
Aug 23, 2019
Merged
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.Build.Framework;
Expand All @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.ApiDescription.Client
/// <summary>
/// Restore <see cref="ITaskItem"/>s from given property value.
/// </summary>
public class GetCurrentItems : Task
public class GetCurrentOpenApiReference : Task
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one's for you @rynowak 😺

{
/// <summary>
/// The property value to deserialize.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
Expand All @@ -13,7 +13,7 @@ namespace Microsoft.Extensions.ApiDescription.Client
/// Adds or corrects ClassName, FirstForGenerator, Namespace, and OutputPath metadata in OpenApiReference items.
/// Also stores final metadata as SerializedMetadata.
/// </summary>
public class GetFileReferenceMetadata : Task
public class GetOpenApiReferenceMetadata : Task
{
private const string TypeScriptLanguageName = "TypeScript";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Do not complain about lack of lib folder. -->
<NoPackageAnalysis>true</NoPackageAnalysis>
Expand All @@ -9,7 +9,7 @@
<PackageId>$(MSBuildProjectName)</PackageId>
<PackageTags>Build Tasks;MSBuild;Swagger;OpenAPI;code generation;Web API client;service reference</PackageTags>
<IsShippingPackage>true</IsShippingPackage>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<DevelopmentDependency>true</DevelopmentDependency>
<HasReferenceAssembly>false</HasReferenceAssembly>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="2.8">
$CommonMetadataElements$
Expand All @@ -7,7 +7,6 @@
<files>
<file src="build\*" target="build" />
<file src="buildMultiTargeting\*" target="buildMultiTargeting" />
<file src="$baseOutputPath$\$configuration$\net461\Microsoft.Extensions.ApiDescription.Client.*" target="tasks\net461" />
<file src="$baseOutputPath$\$configuration$\netstandard2.0\Microsoft.Extensions.ApiDescription.Client.*" target="tasks\netstandard2.0" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project>
<PropertyGroup>
<_ApiDescriptionClientAssemblyTarget
Condition="'$(MSBuildRuntimeType)' == 'Core'">netstandard2.0</_ApiDescriptionClientAssemblyTarget>
<_ApiDescriptionClientAssemblyTarget
Condition="'$(MSBuildRuntimeType)' != 'Core'">net461</_ApiDescriptionClientAssemblyTarget>
<_ApiDescriptionClientAssemblyPath>$(MSBuildThisFileDirectory)/../tasks/$(_ApiDescriptionClientAssemblyTarget)/Microsoft.Extensions.ApiDescription.Client.dll</_ApiDescriptionClientAssemblyPath>
<_ApiDescriptionClientAssemblyTarget />
<_ApiDescriptionClientAssemblyPath>$(MSBuildThisFileDirectory)/../tasks/netstandard2.0/Microsoft.Extensions.ApiDescription.Client.dll</_ApiDescriptionClientAssemblyPath>
</PropertyGroup>
<UsingTask TaskName="GetCurrentItems" AssemblyFile="$(_ApiDescriptionClientAssemblyPath)" />
<UsingTask TaskName="GetFileReferenceMetadata" AssemblyFile="$(_ApiDescriptionClientAssemblyPath)" />
<UsingTask TaskName="GetCurrentOpenApiReference" AssemblyFile="$(_ApiDescriptionClientAssemblyPath)" />
<UsingTask TaskName="GetOpenApiReferenceMetadata" AssemblyFile="$(_ApiDescriptionClientAssemblyPath)" />

<!--
Settings users may update as they see fit.
Expand Down Expand Up @@ -98,6 +93,13 @@

<!-- OpenApiProjectReference items may include all OpenApiReference metadata. -->
<OpenApiProjectReference>
<!--
Semicolon-separated list of global properties to remove in a @(ProjectReference) item created for this
@(OpenApiProjectReference). These properties, along with Configuration, Platform, RuntimeIdentifier and
TargetFrameworks, are also removed when invoking the 'OpenApiGetDocuments' target in the referenced project.
-->
<GlobalPropertiesToRemove>TargetFramework</GlobalPropertiesToRemove>

<!--
Name of the class to generate. Defaults to match filename in %(OutputPath). To avoid compilation errors,
override only if the referenced project has a single registered document.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project>
<!-- Internal settings. Not intended for customization. -->
<PropertyGroup>
Expand All @@ -25,7 +25,6 @@
@(OpenApiProjectReference) items.
-->
<ProjectReference Include="@(OpenApiProjectReference)" Exclude="@(ProjectReference)">
<GlobalPropertiesToRemove>TargetFramework</GlobalPropertiesToRemove>
<Private>false</Private>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
Expand All @@ -44,7 +43,7 @@
BuildInParallel="$(BuildInParallel)"
Projects="@(OpenApiProjectReference)"
RebaseOutputs="true"
RemoveProperties="Configuration;Platform;RuntimeIdentifier;TargetFramework;TargetFrameworks">
RemoveProperties="RuntimeIdentifier;TargetFrameworks;%(OpenApiProjectReference.GlobalPropertiesToRemove)">
<Output TaskParameter="TargetOutputs" ItemName="_Temporary" />
</MSBuild>

Expand All @@ -61,12 +60,12 @@
<_Temporary Remove="@(_Temporary)" />
</ItemGroup>

<GetFileReferenceMetadata Inputs="@(OpenApiReference)"
<GetOpenApiReferenceMetadata Inputs="@(OpenApiReference)"
Extension="$(DefaultLanguageSourceExtension)"
Namespace="$(RootNamespace)"
OutputDirectory="$(OpenApiCodeDirectory)">
<Output TaskParameter="Outputs" ItemName="_Temporary" />
</GetFileReferenceMetadata>
</GetOpenApiReferenceMetadata>

<ItemGroup>
<OpenApiReference Remove="@(OpenApiReference)" />
Expand All @@ -76,9 +75,9 @@
</Target>

<Target Name="_GetCurrentOpenApiReference">
<GetCurrentItems Input="$(GeneratorMetadata)">
<GetCurrentOpenApiReference Input="$(GeneratorMetadata)">
<Output TaskParameter="Outputs" ItemName="CurrentOpenApiReference" />
</GetCurrentItems>
</GetCurrentOpenApiReference>
</Target>

<Target Name="_InnerGenerateOpenApiCode" DependsOnTargets="_GetCurrentOpenApiReference;$(GeneratorTarget)" />
Expand Down Expand Up @@ -132,7 +131,7 @@
</Compile>

<FileWrites Exclude="@(FileWrites)"
Include="@(_Files);@(_Directories -> '%(Identity)/**/*.ts;%(Identity)/**/*.tsx;%(Identity)/**/*.$(DefaultLanguageSourceExtension)'" />
Include="@(_Files);@(_Directories -> '%(Identity)/**/*.ts;%(Identity)/**/*.tsx;%(Identity)/**/*.$(DefaultLanguageSourceExtension)')" />

<_Files Remove="@(_Files)" />
<_Directories Remove="@(_Directories)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<!-- Unless this is an inner build or default timing is disabled, tie document retrieval into the build. -->

<Target Name="_GenerateOpenApiDocuments"
AfterTargets="Build"
BeforeTargets="Build"
Condition=" '$(OpenApiGenerateDocumentsOnBuild)' == 'true' AND ('$(TargetFramework)' == '' OR '$(TargetFrameworks)' == '') "
DependsOnTargets="GenerateOpenApiDocuments" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project>
<ItemGroup>
<_OpenApiGenerateDocumentsTFMs Remove="@(_OpenApiGenerateDocumentsTFMs)" />
<_OpenApiGenerateDocumentsTFMs Include="$(TargetFrameworks)" Exclude="netcoreapp1.0;netcoreapp1.1;netcoreapp2.0" />
</ItemGroup>

<PropertyGroup>
<!-- Default value may lead to an inner build error if $(OpenApiGenerateDocuments) is explicitly set to 'true'. -->
<_OpenApiGenerateDocumentsTFM>$(TargetFrameworks.Trim(';').Split(';')[0])</_OpenApiGenerateDocumentsTFM>

<!-- Prefer first TFM of those the tool supports. -->
<_Temporary>$(@(_OpenApiGenerateDocumentsTFMs).Trim(';'))</_Temporary>
<_Temporary>$(TargetFrameworks
.Replace('netcoreapp1.0', '')
.Replace('netcoreapp1.1', '')
.Replace('netcoreapp2.0', '')
.Trim(';'))</_Temporary>
<_OpenApiGenerateDocumentsTFM
Condition=" '$(_Temporary)' != '' ">$(_Temporary.Split(';')[0])</_OpenApiGenerateDocumentsTFM>

Expand All @@ -34,7 +33,7 @@
</Target>

<Target Name="_GenerateOpenApiDocuments"
AfterTargets="Build"
BeforeTargets="Build"
Condition=" '$(OpenApiGenerateDocumentsOnBuild)' == 'true' "
DependsOnTargets="GenerateOpenApiDocuments" />

Expand Down
2 changes: 1 addition & 1 deletion src/Tools/GetDocumentInsider/src/GetDocumentInsider.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<Reference Include="Microsoft.Extensions.HostFactoryResolver.Sources" />
</ItemGroup>

<Target Name="BuildX86" AfterTargets="Build" Condition=" '$(TargetFramework)' == 'net461' And '$(Platform)' != 'x86' ">
<Target Name="BuildX86" BeforeTargets="Build" Condition=" '$(TargetFramework)' == 'net461' And '$(Platform)' != 'x86' ">
<MSBuild Projects="$(MSBuildProjectFullPath)" Properties="TargetFramework=$(TargetFramework);Platform=x86" Targets="Build" />
</Target>
</Project>