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

XML transformation of config files #409

Draft
wants to merge 5 commits into
base: pxapi2/master
Choose a base branch
from
Draft
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
134 changes: 77 additions & 57 deletions PxWeb/PxWeb.csproj
Original file line number Diff line number Diff line change
@@ -1,57 +1,77 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>disabled</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<Compile Remove="App_Data\**" />
<Compile Remove="logs\**" />
<Content Remove="App_Data\**" />
<Content Remove="logs\**" />
<EmbeddedResource Remove="App_Data\**" />
<EmbeddedResource Remove="logs\**" />
<None Remove="App_Data\**" />
<None Remove="logs\**" />
</ItemGroup>

<ItemGroup>
<Content Remove="databases.config" />
<Content Remove="setting.config" />
</ItemGroup>

<ItemGroup>
<None Include="wwwroot\README.md" />
<None Include="wwwroot\web.config" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="6.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="PCAxis.Menu.ConfigDatamodelMenu" Version="1.0.6" />
<PackageReference Include="PcAxis.Sql" Version="1.2.0" />
<PackageReference Include="PxWeb.Api2.Server" Version="0.0.2-alpha.0.25" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.4.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<Folder Include="Code\PxDatabase\" />
<Folder Include="wwwroot\Database\" />
<Folder Include="wwwroot\Languages\" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Px.Abstractions\Px.Abstractions.csproj" />
<ProjectReference Include="..\Px.Search.Lucene\Px.Search.Lucene.csproj" />
<ProjectReference Include="..\Px.Search\Px.Search.csproj" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>disabled</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<Compile Remove="App_Data\**" />
<Compile Remove="logs\**" />
<Content Remove="App_Data\**" />
<Content Remove="logs\**" />
<EmbeddedResource Remove="App_Data\**" />
<EmbeddedResource Remove="logs\**" />
<None Remove="App_Data\**" />
<None Remove="logs\**" />
</ItemGroup>

<ItemGroup>
<Content Remove="databases.config" />
<Content Remove="setting.config" />
<Content Remove="SqlDb.Release.config" />
</ItemGroup>

<ItemGroup>
<None Include="SqlDb.Release.config">
<IsTransformFile>true</IsTransformFile>
<DependentUpon>SqlDb.config</DependentUpon>
</None>
<None Include="wwwroot\README.md" />
<None Include="wwwroot\web.config" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="6.1.0" />
<PackageReference Include="Microsoft.VisualStudio.SlowCheetah" Version="4.0.30">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="PCAxis.Menu.ConfigDatamodelMenu" Version="1.0.6" />
<PackageReference Include="PcAxis.Sql" Version="1.2.0" />
<PackageReference Include="PxWeb.Api2.Server" Version="0.0.2-alpha.0.25" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.4.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
<PackageReference Include="Microsoft.Web.Xdt" Version="3.1.0" />
</ItemGroup>

<ItemGroup>
<Folder Include="Code\PxDatabase\" />
<Folder Include="wwwroot\Database\" />
<Folder Include="wwwroot\Languages\" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Px.Abstractions\Px.Abstractions.csproj" />
<ProjectReference Include="..\Px.Search.Lucene\Px.Search.Lucene.csproj" />
<ProjectReference Include="..\Px.Search\Px.Search.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="app.config">
<TransformOnBuild>true</TransformOnBuild>
</None>
<None Include="app.Release.config">
<DependentUpon>app.config</DependentUpon>
<IsTransformFile>True</IsTransformFile>
</None>
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions PxWeb/SqlDb.Release.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<SqlDbConfig version="2008" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SqlDbConfig.xsd">
<SqlDbConfig version="2008" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SqlDbConfig.xsd" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">

<Database id="#{DATABASEID}#" metaModel="#{METAMODEL}#">
<Database id="#{DATABASEID}#" metaModel="#{METAMODEL}#" xdt:Transform="Replace">
<Descriptions>
#{DESCRIPTIONS}#
</Descriptions>
Expand Down
22 changes: 22 additions & 0 deletions PxWeb/app.Release.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<configSections>
<sectionGroup name="pcaxis">
<sectionGroup name="paxiom">
<section name="localization" type="PCAxis.Paxiom.Configuration.Sections.LocalizationSection, PCAxis.Core"/>
<!--<section name="grouping" type="PCAxis.Paxiom.Configuration.Sections.GroupingSection, PCAxis.Core"/>-->
</sectionGroup>
</sectionGroup>
</configSections>
<pcaxis>
<paxiom>
<localization filespath="#{LANGUAGE_FOLDER}#" basefile="pxlang" xdt:Transform="Replace"/>
<!--<grouping filespath="..\..\Resources\Aggregations"/>-->
</paxiom>
</pcaxis>
<appSettings>
<add key="dbconfigFile" value="SqlDb.config" />
<!-- Do get internal loginformation for log4net when troubleshooting faild logging uncumment the line below -->
<!--<add key="log4net.Internal.Debug" value="true"/>-->
</appSettings>
</configuration>