Skip to content

Commit

Permalink
Merge branch 'main' into SolutionSupportsAllProjects
Browse files Browse the repository at this point in the history
  • Loading branch information
MichielOda committed Dec 11, 2024
2 parents 61dc696 + 6729e0e commit b625dd4
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 132 deletions.
5 changes: 1 addition & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ updates:
- package-ecosystem: "nuget" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
interval: "daily"
groups:
mstest:
patterns:
- "MSTest.*"
skyline-cicd:
patterns:
- "Skyline.DataMiner.CICD.*"
25 changes: 7 additions & 18 deletions Parsers.Automation/Parsers.Automation.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Skyline.DataMiner.CICD.Parsers.Automation</AssemblyName>
<RootNamespace>Skyline.DataMiner.CICD.Parsers.Automation</RootNamespace>
Expand All @@ -14,28 +13,18 @@
<PackageProjectUrl>https://skyline.be/</PackageProjectUrl>
<PackageTags>Skyline;DataMiner;CICD</PackageTags>
<Description>Library providing methods to parse DataMiner AutomationScript XML files.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/SkylineCommunications/Skyline.DataMiner.CICD.Parsers</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/SkylineCommunications/Skyline.DataMiner.CICD.Parsers</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\LICENSE.txt">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\README.md" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\icon.png" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Parsers.Common\Parsers.Common.csproj" />
</ItemGroup>

</Project>
10 changes: 4 additions & 6 deletions Parsers.AutomationTests/Parsers.AutomationTests.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
<PackageReference Include="FluentAssertions" Version="7.0.0" />
<PackageReference Include="MSTest" Version="3.6.4" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
88 changes: 40 additions & 48 deletions Parsers.Common/Parsers.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,56 +1,48 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Skyline.DataMiner.CICD.Parsers.Common</AssemblyName>
<RootNamespace>Skyline.DataMiner.CICD.Parsers.Common</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>SkylineCommunications</Authors>
<Company>Skyline Communications</Company>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://skyline.be/</PackageProjectUrl>
<PackageTags>Skyline;DataMiner;CICD</PackageTags>
<Description>Library providing Common methods to parse DataMiner XML files.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/SkylineCommunications/Skyline.DataMiner.CICD.Parsers</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Skyline.DataMiner.CICD.Parsers.Common</AssemblyName>
<RootNamespace>Skyline.DataMiner.CICD.Parsers.Common</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>SkylineCommunications</Authors>
<Company>Skyline Communications</Company>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://skyline.be/</PackageProjectUrl>
<PackageTags>Skyline;DataMiner;CICD</PackageTags>
<Description>Library providing Common methods to parse DataMiner XML files.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/SkylineCommunications/Skyline.DataMiner.CICD.Parsers</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\LICENSE.txt">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\icon.png" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NuGet.Frameworks" Version="6.6.1" />
<PackageReference Include="Skyline.DataMiner.CICD.FileSystem" Version="1.0.3" />
<PackageReference Include="Skyline.DataMiner.CICD.Loggers" Version="1.0.3" />
<PackageReference Include="System.Reflection.Metadata" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NuGet.Frameworks" Version="6.6.1" />
<PackageReference Include="Skyline.DataMiner.CICD.FileSystem" Version="1.0.6" />
<PackageReference Include="Skyline.DataMiner.CICD.Loggers" Version="1.0.3" />
<PackageReference Include="System.Reflection.Metadata" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<SonarQubeSetting Include="sonar.exclusions">
<Value>Xml/**, XmlEdit/**</Value>
</SonarQubeSetting>
</ItemGroup>
<ItemGroup>
<SonarQubeSetting Include="sonar.exclusions">
<Value>Xml/**, XmlEdit/**</Value>
</SonarQubeSetting>
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Skyline.DataMiner.CICD.Parsers.Protocol" />
<InternalsVisibleTo Include="Assemblers.AutomationTests" />
<InternalsVisibleTo Include="Assemblers.ProtocolTests" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="Skyline.DataMiner.CICD.Parsers.Protocol" />
<InternalsVisibleTo Include="Assemblers.AutomationTests" />
<InternalsVisibleTo Include="Assemblers.ProtocolTests" />
<InternalsVisibleTo Include="Parsers.CommonTests" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion Parsers.Common/VisualStudio/Projects/LegacyStyleParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Linq;
Expand Down Expand Up @@ -194,7 +195,7 @@ public IEnumerable<ProjectFile> GetCompileFiles()

if (!FileSystem.File.Exists(absolutePath))
{
continue;
throw new FileNotFoundException($"File '{relativePath}' was not found. Please add the file or remove it from the project.");
}

yield return new ProjectFile(relativePath, FileSystem.File.ReadAllText(FileSystem.Path.GetFullPath(absolutePath), Encoding.UTF8));
Expand Down
2 changes: 1 addition & 1 deletion Parsers.Common/VisualStudio/Projects/SdkStyleParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public string GetTargetFrameworkMoniker()

foreach (XElement propertyGroup in propertyGroups)
{
var targetFrameworkElement = propertyGroup.Element("TargetFramework");
var targetFrameworkElement = propertyGroup.Element("TargetFramework") ?? propertyGroup.Element("TargetFrameworks");

if (targetFrameworkElement == null)
{
Expand Down
10 changes: 4 additions & 6 deletions Parsers.CommonTests/Parsers.CommonTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -16,11 +16,9 @@
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="7.0.0" />
<PackageReference Include="MSTest" Version="3.6.4" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
namespace Parsers.CommonTests.VisualStudio.Projects
{
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Linq;

using FluentAssertions;

using Microsoft.VisualStudio.TestTools.UnitTesting;

using Skyline.DataMiner.CICD.Parsers.Common.VisualStudio.Projects;

[TestClass]
public class LegacyStyleParserTests
{
[TestMethod]
public void GetCompileFilesTest()
{
// Arrange
string path = Path.GetFullPath(@".\VisualStudio\TestFiles\ProjectsForTesting\Files\Files_UnknownFile.csproj");
string projectDir = Path.GetDirectoryName(path);
var xmlContent = File.ReadAllText(path, Encoding.UTF8);
var document = XDocument.Parse(xmlContent);
LegacyStyleParser legacyStyleParser = new LegacyStyleParser(document, projectDir);

// Act
Action action = () => _ = legacyStyleParser.GetCompileFiles().ToList();

// Assert
action.Should().Throw<FileNotFoundException>();
}
}
}
1 change: 0 additions & 1 deletion Parsers.CommonTests/VisualStudio/Projects/ProjectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public void Load_TargetFrameWorkMoniker(string fileName, string expectedResult)
[TestMethod]
[DataRow("Files_Valid.csproj", 2)]
[DataRow("Files_NoFiles.csproj", 0)]
[DataRow("Files_UnknownFile.csproj", 0)]
[DataRow("SharedProject.projitems", 2)]
[DataRow("SharedProject.shproj", 2)]
[DataRow("Files_ValidSharedProject.csproj", 4)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
<Content Include=".editorconfig" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SpecialChar_1.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
71 changes: 31 additions & 40 deletions Parsers.Protocol/Parsers.Protocol.csproj
Original file line number Diff line number Diff line change
@@ -1,47 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Skyline.DataMiner.CICD.Parsers.Protocol</AssemblyName>
<RootNamespace>Skyline.DataMiner.CICD.Parsers.Protocol</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>SkylineCommunications</Authors>
<Company>Skyline Communications</Company>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://skyline.be/</PackageProjectUrl>
<PackageTags>Skyline;DataMiner;CICD</PackageTags>
<Description>Library providing methods to parse DataMiner Protocol XML files.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/SkylineCommunications/Skyline.DataMiner.CICD.Parsers</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Skyline.DataMiner.CICD.Parsers.Protocol</AssemblyName>
<RootNamespace>Skyline.DataMiner.CICD.Parsers.Protocol</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>SkylineCommunications</Authors>
<Company>Skyline Communications</Company>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://skyline.be/</PackageProjectUrl>
<PackageTags>Skyline;DataMiner;CICD</PackageTags>
<Description>Library providing methods to parse DataMiner Protocol XML files.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/SkylineCommunications/Skyline.DataMiner.CICD.Parsers</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<ItemGroup>
<None Include="..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\_NuGetItems\LICENSE.txt">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\icon.png" Pack="true" PackagePath="" />
<None Include="..\_NuGetItems\LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Parsers.Common\Parsers.Common.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Parsers.Common\Parsers.Common.csproj" />
</ItemGroup>

<ItemGroup>
<SonarQubeSetting Include="sonar.exclusions">
<Value>Xml/**</Value>
</SonarQubeSetting>
</ItemGroup>
<ItemGroup>
<SonarQubeSetting Include="sonar.exclusions">
<Value>Xml/**</Value>
</SonarQubeSetting>
</ItemGroup>

</Project>
10 changes: 4 additions & 6 deletions Parsers.ProtocolTests/Parsers.ProtocolTests.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<TargetFrameworks>net48;net6.0;net8.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
<PackageReference Include="MSTest" Version="3.6.4" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
<PackageReference Include="XMLUnit.Core" Version="2.9.2" />
<PackageReference Include="XMLUnit.Core" Version="2.10.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -29,5 +27,5 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>

0 comments on commit b625dd4

Please sign in to comment.