Skip to content

Commit bd4b237

Browse files
authored
Merge pull request #38 from AzureCosmosDB/develop
Fixing extension publishing; combining settings for multiple operations
2 parents 8750f31 + 586a182 commit bd4b237

File tree

6 files changed

+55
-45
lines changed

6 files changed

+55
-45
lines changed

Core/Cosmos.DataTransfer.Core/RunCommand.cs

+13-3
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,21 @@ public async Task<int> InvokeAsync(InvocationContext context)
9898
foreach (var operationConfig in operations)
9999
{
100100
var operationSource = operationConfig.GetSection("SourceSettings");
101+
var sourceBuilder = new ConfigurationBuilder().AddConfiguration(sourceConfig);
102+
if (operationSource.Exists())
103+
{
104+
sourceBuilder.AddConfiguration(operationSource);
105+
}
101106
var operationSink = operationConfig.GetSection("SinkSettings");
107+
var sinkBuilder = new ConfigurationBuilder().AddConfiguration(sinkConfig);
108+
if (operationSink.Exists())
109+
{
110+
sinkBuilder.AddConfiguration(operationSink);
111+
}
102112
await ExecuteDataTransferOperation(source,
103-
operationSource.Exists() ? operationSource : sourceConfig,
113+
sourceBuilder.Build(),
104114
sink,
105-
operationSink.Exists() ? operationSink : sinkConfig,
115+
sinkBuilder.Build(),
106116
cancellationToken);
107117
}
108118
}
@@ -114,7 +124,7 @@ await ExecuteDataTransferOperation(source,
114124
return 0;
115125
}
116126

117-
private async Task ExecuteDataTransferOperation(IDataSourceExtension source, IConfigurationSection sourceConfig, IDataSinkExtension sink, IConfigurationSection sinkConfig, CancellationToken cancellationToken)
127+
private async Task ExecuteDataTransferOperation(IDataSourceExtension source, IConfiguration sourceConfig, IDataSinkExtension sink, IConfiguration sinkConfig, CancellationToken cancellationToken)
118128
{
119129
_logger.LogDebug("Loaded {SettingCount} settings for source {SourceName}:\n\t\t{SettingList}",
120130
sourceConfig.AsEnumerable().Count(),

Extensions/AzureTableAPI/Cosmos.DataTransfer.AzureTableAPIExtension/Properties/PublishProfiles/PublishToExtensionsFolder.pubxml

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
https://go.microsoft.com/fwlink/?LinkID=208121.
44
-->
55
<Project>
6-
<PropertyGroup>
7-
<Configuration>Debug</Configuration>
8-
<Platform>Any CPU</Platform>
9-
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Debug\net6.0\Extensions</PublishDir>
10-
<PublishProtocol>FileSystem</PublishProtocol>
11-
<_TargetId>Folder</_TargetId>
12-
<TargetFramework>net6.0</TargetFramework>
13-
<SelfContained>false</SelfContained>
14-
</PropertyGroup>
15-
<PropertyGroup>
6+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
7+
<Configuration>Debug</Configuration>
8+
<Platform>Any CPU</Platform>
9+
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Debug\net6.0\Extensions</PublishDir>
10+
<PublishProtocol>FileSystem</PublishProtocol>
11+
<_TargetId>Folder</_TargetId>
12+
<TargetFramework>net6.0</TargetFramework>
13+
<SelfContained>false</SelfContained>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)' != 'Debug' ">
1616
<Configuration>Release</Configuration>
1717
<Platform>Any CPU</Platform>
1818
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Release\net6.0\Extensions</PublishDir>

Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/Properties/PublishProfiles/PublishToExtensionsFolder.pubxml

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
https://go.microsoft.com/fwlink/?LinkID=208121.
44
-->
55
<Project>
6-
<PropertyGroup>
7-
<Configuration>Debug</Configuration>
8-
<Platform>Any CPU</Platform>
9-
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Debug\net6.0\Extensions</PublishDir>
10-
<PublishProtocol>FileSystem</PublishProtocol>
11-
<_TargetId>Folder</_TargetId>
12-
<TargetFramework>net6.0</TargetFramework>
13-
<SelfContained>false</SelfContained>
14-
</PropertyGroup>
15-
<PropertyGroup>
6+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
7+
<Configuration>Debug</Configuration>
8+
<Platform>Any CPU</Platform>
9+
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Debug\net6.0\Extensions</PublishDir>
10+
<PublishProtocol>FileSystem</PublishProtocol>
11+
<_TargetId>Folder</_TargetId>
12+
<TargetFramework>net6.0</TargetFramework>
13+
<SelfContained>false</SelfContained>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)' != 'Debug' ">
1616
<Configuration>Release</Configuration>
1717
<Platform>Any CPU</Platform>
1818
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Release\net6.0\Extensions</PublishDir>

Extensions/Json/Cosmos.DataTransfer.JsonExtension/Properties/PublishProfiles/PublishToExtensionsFolder.pubxml

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
https://go.microsoft.com/fwlink/?LinkID=208121.
44
-->
55
<Project>
6-
<PropertyGroup>
7-
<Configuration>Debug</Configuration>
8-
<Platform>Any CPU</Platform>
9-
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Debug\net6.0\Extensions</PublishDir>
10-
<PublishProtocol>FileSystem</PublishProtocol>
11-
<_TargetId>Folder</_TargetId>
12-
<TargetFramework>net6.0</TargetFramework>
13-
<SelfContained>false</SelfContained>
14-
</PropertyGroup>
15-
<PropertyGroup>
6+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
7+
<Configuration>Debug</Configuration>
8+
<Platform>Any CPU</Platform>
9+
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Debug\net6.0\Extensions</PublishDir>
10+
<PublishProtocol>FileSystem</PublishProtocol>
11+
<_TargetId>Folder</_TargetId>
12+
<TargetFramework>net6.0</TargetFramework>
13+
<SelfContained>false</SelfContained>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)' != 'Debug' ">
1616
<Configuration>Release</Configuration>
1717
<Platform>Any CPU</Platform>
1818
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Release\net6.0\Extensions</PublishDir>

Extensions/Mongo/Cosmos.DataTransfer.MongoExtension/Properties/PublishProfiles/PublishToExtensionsFolder.pubxml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
https://go.microsoft.com/fwlink/?LinkID=208121.
44
-->
55
<Project>
6-
<PropertyGroup>
6+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
77
<Configuration>Debug</Configuration>
88
<Platform>Any CPU</Platform>
99
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Debug\net6.0\Extensions</PublishDir>
@@ -12,7 +12,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
1212
<TargetFramework>net6.0</TargetFramework>
1313
<SelfContained>false</SelfContained>
1414
</PropertyGroup>
15-
<PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)' != 'Debug' ">
1616
<Configuration>Release</Configuration>
1717
<Platform>Any CPU</Platform>
1818
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Release\net6.0\Extensions</PublishDir>

Extensions/SqlServer/Cosmos.DataTransfer.SqlServerExtension/Properties/PublishProfiles/PublishToExtensionsFolder.pubxml

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
https://go.microsoft.com/fwlink/?LinkID=208121.
44
-->
55
<Project>
6-
<PropertyGroup>
7-
<Configuration>Debug</Configuration>
8-
<Platform>Any CPU</Platform>
9-
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Debug\net6.0\Extensions</PublishDir>
10-
<PublishProtocol>FileSystem</PublishProtocol>
11-
<_TargetId>Folder</_TargetId>
12-
<TargetFramework>net6.0</TargetFramework>
13-
<SelfContained>false</SelfContained>
14-
</PropertyGroup>
15-
<PropertyGroup>
6+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
7+
<Configuration>Debug</Configuration>
8+
<Platform>Any CPU</Platform>
9+
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Debug\net6.0\Extensions</PublishDir>
10+
<PublishProtocol>FileSystem</PublishProtocol>
11+
<_TargetId>Folder</_TargetId>
12+
<TargetFramework>net6.0</TargetFramework>
13+
<SelfContained>false</SelfContained>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)' != 'Debug' ">
1616
<Configuration>Release</Configuration>
1717
<Platform>Any CPU</Platform>
1818
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Release\net6.0\Extensions</PublishDir>

0 commit comments

Comments
 (0)