Adding readme to source package and changing the nested file path. (dotnet/corefx...
authorJose Perez Rodriguez <joperezr@microsoft.com>
Wed, 6 Feb 2019 00:18:14 +0000 (16:18 -0800)
committerGitHub <noreply@github.com>
Wed, 6 Feb 2019 00:18:14 +0000 (16:18 -0800)
* Adding readme to source package and changing the nested file path.

* Address feedback and add README.md to None

* Adding new class to descriptions.json

Commit migrated from https://github.com/dotnet/corefx/commit/92eda9e19a886cbf7f8c7e97680df42a3ca1a2be

src/libraries/System.Text.Json/Directory.Build.props
src/libraries/System.Text.Json/pkg/Microsoft.Bcl.Json.Sources.pkgproj
src/libraries/System.Text.Json/src/System.Text.Json.csproj
src/libraries/pkg/descriptions.json

index efdc2a5d029452faede1f451c7266c574320cb36..8c36c9f7347ba0ddaec02e97b6848b5e0209d91f 100644 (file)
@@ -6,5 +6,9 @@
     <StrongNameKeyId>Open</StrongNameKeyId>
     <IsNETCoreApp>true</IsNETCoreApp>
     <IsUAP>true</IsUAP>
+
+    <!-- Properties for source package -->
+    <_sourcePackageName>Microsoft.Bcl.Json.Sources</_sourcePackageName>
+    <_packagePathToSources>contentFiles/cs/netstandard2.0/$(_sourcePackageName)</_packagePathToSources>
   </PropertyGroup>
 </Project>
index 31a52411784818647bb75ec723d2f12fc4407a89..e86f20ac4adfca283e653238c82b1a8b6a538429 100644 (file)
@@ -6,6 +6,8 @@
   <PropertyGroup>
     <!-- We need to make sure that all of the surface area on the sources gets rewritten as internal. -->
     <GenerateInternalTypesSource>true</GenerateInternalTypesSource>
+    <!-- We need to disable package file check as the sdk targets will flag README.md file as it is not a known extension. -->
+    <SkipPackageFileCheck>true</SkipPackageFileCheck>
   </PropertyGroup>
 
   <!-- Given that System.Text.Json has Resources, we need to make sure we include them (and the SR.cs from Common) 
index 90667746b77a430f97fafa8d23c12b805c212454..fa73ef91c07774b10a4a3992d2621d78620e13a6 100644 (file)
   <Target Name="GetSourcesToPackage" Returns="@(_sourceToPackage)" DependsOnTargets="Compile">
 
       <PropertyGroup>
+        <_sourcePackageName>Microsoft.Bcl.Json.Sources</_sourcePackageName>
         <_sourcePackageTargetLines><![CDATA[<?xml version="1.0" encoding="utf-8"?>
 <Project>
   <ItemGroup Condition="'%24(ExcludeEmbeddedResourceFromPackage)' != 'true'">@(EmbeddedResource->'
-    <EmbeddedResource Include="%24(MSBuildThisFileDirectory)%(FileName)%(Extension)" Link="System/Text/Json/%(FileName)%(Extension)" ManifestResourceName="%(ManifestResourceName)" />', '')
+    <EmbeddedResource Include="%24(MSBuildThisFileDirectory)%(FileName)%(Extension)" Link="$(_sourcePackageName)/%(FileName)%(Extension)" ManifestResourceName="%(ManifestResourceName)" />', '')
+  </ItemGroup>
+
+  <ItemGroup>
+    <None Include="%24(MSBuildThisFileDirectory)README.md" Link="$(_sourcePackageName)/README.md" Visible="true" />
   </ItemGroup>
 </Project>]]>
         </_sourcePackageTargetLines>
-        <_targetsFileName>Microsoft.Bcl.Json.Sources.targets</_targetsFileName>
+        <_targetsFileName>$(_sourcePackageName).targets</_targetsFileName>
         <_generatedSourcePackageTargetPath>$(IntermediateOutputPath)/$(_targetsFileName)</_generatedSourcePackageTargetPath>
       </PropertyGroup>
 
 
       <ItemGroup>
         <_sourceToExclude Include="@(Compile)" Condition="$([System.String]::Copy('%(Compile.Identity)').ToLower().EndsWith('assemblyinfo.cs'))" />
-        <_sourceToPackage Include="@(Compile->'%(FullPath)')" PackagePath="contentFiles/cs/netstandard2.0/System/Text/Json/%(FileName)%(Extension)" Exclude="@(_sourceToExclude)"/>
+        <_sourceToPackage Include="@(Compile->'%(FullPath)')" PackagePath="contentFiles/cs/netstandard2.0/$(_sourcePackageName)/%(FileName)%(Extension)" Exclude="@(_sourceToExclude)"/>
         <_sourceToPackage Condition="'%(Extension)' == '.resx'" Include="@(EmbeddedResource->'%(FullPath)')"  PackagePath="build/netstandard2.0/%(FileName)%(Extension)" />
         <_sourceToPackage Include="$(_generatedSourcePackageTargetPath)" PackagePath="build/netstandard2.0/$(_targetsFileName)" />
+        <_sourceToPackage Include="$(MSBuildThisFileDirectory)../source_package/README.md" PackagePath="build/netstandard2.0/README.md" />
       </ItemGroup>
   </Target>
 </Project>
index 6e189a7ae0ff878d011542b96e8fe90d69b19ee7..0512d12459de27cd81f351c041b839aefe9ace86 100644 (file)
     "Description": "Provides the source code implementation of System.Text.Json as internal types. This package is only required for projects targeting .NET Framework 4.6.1+ or .NET Core 2.x; and is not for projects that can target .NET Core 3.0 and higher. For guidance on consuming the source pacakge, visit: https://aka.ms/json-source-package-guide.",
     "CommonTypes": [
       "System.Text.Json.Utf8JsonReader",
-      "System.Text.Json.Utf8JsonWriter"
+      "System.Text.Json.Utf8JsonWriter",
+      "System.Text.Json.JsonDocument"
     ]
   },
   {