Ship two json schema files.. One that reference others, and a CMS one (#13123)

* Ship two json schema files.. One that reference others, and a CMS one

* git ignore

* Build schema files sepearately
This commit is contained in:
Bjarke Berg
2022-10-05 12:42:21 +02:00
committed by GitHub
parent 6dc874147f
commit 46da0b07a8
10 changed files with 250 additions and 147 deletions

View File

@@ -17,6 +17,15 @@
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
</ItemGroup>
<ItemGroup>
<Content Update="appsettings.*.json">
<DependentUpon>appsettings.json</DependentUpon>
</Content>
<Content Update="appsettings-schema.*.json">
<DependentUpon>appsettings-schema.json</DependentUpon>
</Content>
</ItemGroup>
<PropertyGroup>
<!-- Razor files are needed for the backoffice to work correctly -->
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
@@ -37,4 +46,25 @@
<Message Text="Copying appsettings.Development.template.json to appsettings.Development.json because it doesn't exist" Importance="high" />
<Copy SourceFiles="appsettings.Development.template.json" DestinationFiles="appsettings.Development.json" />
</Target>
<PropertyGroup>
<JsonSchemaPath>$(ProjectDir)appsettings-schema.json</JsonSchemaPath>
<JsonSchemaCmsPath>$(ProjectDir)appsettings-schema.umbraco.json</JsonSchemaCmsPath>
<JsonSchemaProjectPath>$(ProjectDir)../JsonSchema/</JsonSchemaProjectPath>
</PropertyGroup>
<Target Name="CheckPreconditions" BeforeTargets="Build">
<Message Text="-CheckPreconditions-" Importance="high" />
<Message Text="JsonSchemaPath: $(JsonSchemaPath)" Importance="high" />
<Message Text="JsonSchemaCmsPath: $(JsonSchemaCmsPath)" Importance="high" />
<CallTarget Targets="JsonSchemaBuild" Condition="!(Exists('$(JsonSchemaPath)') AND Exists('$(JsonSchemaCmsPath)')) and '$(UmbracoBuild)' == ''" />
<CallTarget Targets="AppsettingsBuild" Condition="!Exists('appsettings.json')" />
<CallTarget Targets="AppsettingsDevBuild" Condition="!Exists('appsettings.Development.json')" />
</Target>
<Target Name="JsonSchemaBuild">
<Exec Command="dotnet run -c Release --project $(JsonSchemaProjectPath) --mainOutputFile &quot;$(ProjectDir)appsettings-schema.json&quot; --cmsOutputFile &quot;$(ProjectDir)appsettings-schema.umbraco.json&quot;" />
</Target>
</Project>