Skip to content

Commit 8a68d97

Browse files
committed
Allow multiple FileDataSourceAttribute to be used
Simply updating `FileDataSourceAttribute` will allow plugins to support multiple different file extensions. WPA already has the support for it as WPA always processes `FileDataSourceAttribute` in an `IEnumerable`. Even in this repo we have tests for multiple extensions (`TryGetFileExtensions_FileDataSources_ReturnsExtensions`)
1 parent 96a4a3c commit 8a68d97

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

documentation/Using-the-SDK/Creating-your-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Please refer to the links above to download and install the necessary requiremen
4747
1) Launch Visual Studio
4848
2) Click "Create new project"
4949
![VS2019_Create_New_Project.PNG](./.attachments/VS2019_CreateProject_Markup.png)
50-
3) Select .NET Standard on the left, and choose "Class Library (.NET Standard)." Make sure that you are using .NET Standard 2.0, or a .NET version that supports .NET Standard 2.0 (such as .NET Core 3.1, .NET 6, etc.).
50+
3) Select .NET Standard on the left, and choose "Class Library (.NET Standard)." Make sure that you are using .NET Standard 2.0, or a .NET version that supports .NET Standard 2.0 (such as .NET 8). The .NET version cannot be higher than WPA's .NET version (.NET 8).
5151
![VS2019_New_DotNetStandard_20_Project.PNG](./.attachments/VS2019_CreateProject_ClassLibrary_Markup.png)
5252
4) Name your project
5353
5) Click "Create"

samples/SimpleDataSource/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ See `SampleTextFile.txt` for an example of a file with this format.
1515
2. [.NET Standard 2.0](https://dotnet.microsoft.com/download/visual-studio-sdks)
1616

1717
# Instructions
18-
Please refer to [Using the SDK/Creating a Simple SDK Plugin](../../documentaiton/Using-the-SDK/Creating-a-simple-sdk-plugin.md) for details
18+
Please refer to [Using the SDK/Creating a Simple SDK Plugin](../../documentation/Using-the-SDK/Creating-a-simple-sdk-plugin.md) for details
1919
on how to implement this source code.

samples/SimpleDataSource/SampleAddIn.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.Performance.SDK" Version="1.0.14-rc1" />
8+
<PackageReference Include="Microsoft.Performance.SDK" Version="1.4.7-preview2" />
99
</ItemGroup>
1010

1111
</Project>

src/Microsoft.Performance.SDK.Runtime.Tests/ProcessingSourceReferenceTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
using System.Reflection;
99
using System.Threading;
1010
using System.Threading.Tasks;
11-
using Microsoft.Performance.SDK.Options;
1211
using Microsoft.Performance.SDK.Options.Definitions;
1312
using Microsoft.Performance.SDK.Processing;
1413
using Microsoft.Performance.SDK.Processing.DataSourceGrouping;
15-
using Microsoft.Performance.SDK.Runtime.Options;
1614
using Microsoft.Performance.Testing;
1715
using Microsoft.Performance.Testing.SDK;
1816
using Microsoft.VisualStudio.TestTools.UnitTesting;
@@ -634,7 +632,8 @@ public void DisposeProcessor(ICustomDataProcessor processor)
634632
}
635633

636634
[ProcessingSource("{2D5E3373-88DA-4640-BD19-99FA8C437EB1}", "What", "Test")]
637-
[FileDataSource("ext")]
635+
[FileDataSource("ext1")]
636+
[FileDataSource("ext2")]
638637
[ExtensionlessFileDataSource("No description")]
639638
[DirectoryDataSource("No description")]
640639
public class MultiDataSourceCds

src/Microsoft.Performance.SDK/Processing/FileDataSourceAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.Performance.SDK.Processing
1212
/// files of a specific type. This is used to instruct callers to route files
1313
/// with a given extension to the decorated <see cref="IProcessingSource"/> for processing.
1414
/// </summary>
15-
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
15+
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
1616
public sealed class FileDataSourceAttribute
1717
: DataSourceAttribute,
1818
IEquatable<FileDataSourceAttribute>

src/SDK.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.0.31410.414
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.0.11217.181
55
MinimumVisualStudioVersion = 15.0.26124.0
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Performance.SDK", "Microsoft.Performance.SDK\Microsoft.Performance.SDK.csproj", "{D6C6BE8C-6D62-44A9-AA99-E6B1CDC835F6}"
77
EndProject

0 commit comments

Comments
 (0)