Skip to content

Commit

Permalink
Merge pull request #57 from EvotecIT/Bump-versions
Browse files Browse the repository at this point in the history
Bump DLL's to most recent versions before 2.0
  • Loading branch information
PrzemyslawKlys authored Oct 18, 2024
2 parents 57b4159 + 3d0b340 commit 0c726e4
Show file tree
Hide file tree
Showing 37 changed files with 273 additions and 8 deletions.
23 changes: 21 additions & 2 deletions Build/Manage-Mailozaurr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ Build-Module -ModuleName 'Mailozaurr' {
# Keep in mind it has it's limits when "copying" functions such as it should not depend on DLLs or other external files
New-ConfigurationModule -Type ApprovedModule -Name 'PSSharedGoods', 'PSWriteColor', 'Connectimo', 'PSUnifi', 'PSWebToolbox', 'PSMyPassword'

New-ConfigurationModuleSkip -IgnoreModuleName 'Microsoft.Graph.Authentication'
New-ConfigurationModuleSkip -IgnoreModuleName 'Microsoft.Graph.Authentication' -IgnoreFunc @(
'Resolve-DnsName'
)

$ConfigurationFormat = [ordered] @{
RemoveComments = $false
Expand Down Expand Up @@ -83,7 +85,24 @@ Build-Module -ModuleName 'Mailozaurr' {

New-ConfigurationImportModule -ImportSelf #-ImportRequiredModules

New-ConfigurationBuild -DotSourceLibraries -DotSourceClasses -MergeModuleOnBuild -Enable -SignModule -DeleteTargetModuleBeforeBuild -CertificateThumbprint '483292C9E317AA13B07BB7A96AE9D1A5ED9E7703' -MergeFunctionsFromApprovedModules
$newConfigurationBuildSplat = @{
Enable = $true
SignModule = $true
MergeModuleOnBuild = $true
MergeFunctionsFromApprovedModules = $true
CertificateThumbprint = '483292C9E317AA13B07BB7A96AE9D1A5ED9E7703'
ResolveBinaryConflicts = $true
ResolveBinaryConflictsName = 'Mailozaurr.PowerShell'
NETProjectName = 'Mailozaurr.PowerShell'
NETConfiguration = 'Release'
NETFramework = 'net6.0', 'net472'
NETHandleAssemblyWithSameName = $true
DotSourceLibraries = $true
DotSourceClasses = $true
DeleteTargetModuleBeforeBuild = $true
}

New-ConfigurationBuild @newConfigurationBuildSplat

New-ConfigurationArtefact -Type Unpacked -Enable -Path "$PSScriptRoot\..\Artefacts" -RequiredModulesPath "$PSScriptRoot\..\Artefacts\Modules"
New-ConfigurationArtefact -Type Packed -Enable -Path "$PSScriptRoot\..\Releases" -IncludeTagName
Expand Down
Binary file removed Lib/Core/BouncyCastle.Crypto.dll
Binary file not shown.
Binary file modified Lib/Core/DnsClient.dll
Binary file not shown.
Binary file modified Lib/Core/EmailValidation.dll
Binary file not shown.
Binary file modified Lib/Core/Google.Apis.Auth.dll
Binary file not shown.
Binary file modified Lib/Core/Google.Apis.Core.dll
Binary file not shown.
Binary file modified Lib/Core/Google.Apis.dll
Binary file not shown.
Binary file modified Lib/Core/MailKit.dll
Binary file not shown.
Binary file modified Lib/Core/Microsoft.Identity.Client.dll
Binary file not shown.
Binary file modified Lib/Core/MimeKit.dll
Binary file not shown.
Binary file removed Lib/Core/System.Text.Encoding.CodePages.dll
Binary file not shown.
Binary file removed Lib/Core/System.Threading.Tasks.Extensions.dll
Binary file not shown.
Binary file removed Lib/Default/BouncyCastle.Crypto.dll
Binary file not shown.
Binary file modified Lib/Default/DnsClient.dll
Binary file not shown.
Binary file modified Lib/Default/EmailValidation.dll
Binary file not shown.
Binary file modified Lib/Default/Google.Apis.Auth.dll
Binary file not shown.
Binary file modified Lib/Default/Google.Apis.Core.dll
Binary file not shown.
Binary file modified Lib/Default/Google.Apis.dll
Binary file not shown.
Binary file modified Lib/Default/MailKit.dll
Binary file not shown.
Binary file modified Lib/Default/Microsoft.Identity.Client.dll
Binary file not shown.
Binary file modified Lib/Default/MimeKit.dll
Binary file not shown.
Binary file modified Lib/Default/Newtonsoft.Json.dll
Binary file not shown.
Binary file modified Lib/Default/System.Memory.dll
Binary file not shown.
Binary file removed Lib/Default/System.Net.Http.dll
Binary file not shown.
Binary file modified Lib/Default/System.Runtime.CompilerServices.Unsafe.dll
Binary file not shown.
Binary file removed Lib/Default/System.Text.Encoding.CodePages.dll
Binary file not shown.
Binary file removed Lib/Default/netstandard.dll
Binary file not shown.
12 changes: 6 additions & 6 deletions Mailozaurr.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
CmdletsToExport = @()
CompanyName = 'Evotec'
CompatiblePSEditions = @('Desktop', 'Core')
Copyright = '(c) 2011 - 2023 Przemyslaw Klys @ Evotec. All rights reserved.'
Copyright = '(c) 2011 - 2024 Przemyslaw Klys @ Evotec. All rights reserved.'
Description = 'Mailozaurr is a PowerShell module that aims to provide SMTP, POP3, IMAP and few other ways to interact with Email. Underneath it uses MimeKit and MailKit and EmailValidation libraries written by Jeffrey Stedfast. '
FunctionsToExport = @('Connect-IMAP', 'Connect-oAuthGoogle', 'Connect-oAuthO365', 'Connect-POP', 'ConvertTo-GraphCredential', 'ConvertTo-OAuth2Credential', 'ConvertTo-SendGridCredential', 'Disconnect-IMAP', 'Disconnect-POP', 'Find-DKIMRecord', 'Find-DMARCRecord', 'Find-DNSBL', 'Find-MxRecord', 'Find-SPFRecord', 'Get-IMAPFolder', 'Get-IMAPMessage', 'Get-MailFolder', 'Get-MailMessage', 'Get-POPMessage', 'Resolve-DnsQuery', 'Resolve-DnsQueryRest', 'Save-MailMessage', 'Save-POPMessage', 'Send-EmailMessage', 'Test-EmailAddress')
GUID = '2b0ea9f1-3ff1-4300-b939-106d5da608fa'
ModuleVersion = '1.0.2'
ModuleVersion = '1.0.3'
PowerShellVersion = '5.1'
PrivateData = @{
PSData = @{
Tags = @('Windows', 'MacOS', 'Linux', 'Mail', 'Email', 'MX', 'SPF', 'DMARC', 'DKIM', 'GraphApi', 'SendGrid', 'Graph', 'IMAP', 'POP3')
ExternalModuleDependencies = @('Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.Management', 'Microsoft.PowerShell.Security')
IconUri = 'https://evotec.xyz/wp-content/uploads/2020/07/MailoZaurr.png'
ProjectUri = 'https://github.com/EvotecIT/MailoZaurr'
ExternalModuleDependencies = @('Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.Management', 'Microsoft.PowerShell.Security')
Tags = @('Windows', 'MacOS', 'Linux', 'Mail', 'Email', 'MX', 'SPF', 'DMARC', 'DKIM', 'GraphApi', 'SendGrid', 'Graph', 'IMAP', 'POP3')
}
}
RequiredModules = @(@{
ModuleName = 'PSSharedGoods'
ModuleVersion = '0.0.264'
Guid = 'ee272aa8-baaa-4edf-9f45-b6d6f7d844fe'
ModuleName = 'PSSharedGoods'
ModuleVersion = '0.0.297'
}, 'Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.Management', 'Microsoft.PowerShell.Security')
RootModule = 'Mailozaurr.psm1'
}
69 changes: 69 additions & 0 deletions Sources/Mailozaurr.PowerShell/Mailozaurr.PowerShell.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Company>Evotec</Company>
<Authors>Przemyslaw Klys</Authors>
<VersionPrefix>1.0.0</VersionPrefix>
<TargetFrameworks>net472;netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<AssemblyName>Mailozaurr.PowerShell</AssemblyName>

<Copyright>(c) 2011 - 2024 Przemyslaw Klys @ Evotec. All rights reserved.</Copyright>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Mailozaurr\Mailozaurr.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" PrivateAssets="all" />
<PackageReference Include="System.Management" Version="7.0.2" PrivateAssets="all" />
</ItemGroup>

<!-- Make sure the output DLL's from library are included in the output -->
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<!-- We need to remove PowerShell conflicting libraries as it will break output -->
<!-- <Target Name="RemoveFilesAfterBuild" AfterTargets="Build;Publish">
<Delete Files="$(OutDir)System.Management.Automation.dll" />
<Delete Files="$(OutDir)System.Management.dll" />
<Delete Files="$(OutDir)runtimes/win/lib/net6.0/System.Management.dll" />
</Target> -->

<!-- <ItemGroup>
<None Update="runtimes/win/lib/net6.0/System.Management.dll">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<ExcludeFromPublish>true</ExcludeFromPublish>
</None>
<None Update="runtimes\win\lib\net6.0\System.Management.dll">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<ExcludeFromPublish>true</ExcludeFromPublish>
</None>
</ItemGroup> -->

<!-- <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="System.Management" Version="7.0.2" PrivateAssets="all" />
</ItemGroup> -->

<PropertyGroup Condition=" '$(TargetFramework)' == 'net472' ">
<DefineConstants>$(DefineConstants);FRAMEWORK</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Using Include="Mailozaurr" />
<Using Include="System.Collections" />
<Using Include="System.Management.Automation" PrivateAssets="all" />
<Using Include="System.Management" PrivateAssets="all" />
<Using Include="System.Threading.Tasks" />
<Using Include="System.Collections.Concurrent" />
<Using Include="System.Threading" />
<Using Include="System" />
<Using Include="System.Collections.Generic" />
<Using Include="System.Linq" />
<Using Include="System.Text" />
<Using Include="System.IO" />
<Using Include="System.Net" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=communication/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=definitions/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
25 changes: 25 additions & 0 deletions Sources/Mailozaurr.PowerShell/Mailozaurr.PowerShell.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mailozaurr.PowerShell", "Mailozaurr.PowerShell.csproj", "{F0AD2194-830B-49A2-85BE-87A18F6C3E4C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F0AD2194-830B-49A2-85BE-87A18F6C3E4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0AD2194-830B-49A2-85BE-87A18F6C3E4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0AD2194-830B-49A2-85BE-87A18F6C3E4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0AD2194-830B-49A2-85BE-87A18F6C3E4C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F343B4D3-FF83-4CD2-A765-FCB55459F16F}
EndGlobalSection
EndGlobal
54 changes: 54 additions & 0 deletions Sources/Mailozaurr.PowerShell/OnImportAndRemove.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System;
using System.IO;
using System.Management.Automation;
using System.Reflection;

public class OnModuleImportAndRemove : IModuleAssemblyInitializer, IModuleAssemblyCleanup {
public void OnImport() {
if (IsNetFramework()) {
AppDomain.CurrentDomain.AssemblyResolve += MyResolveEventHandler;
}
}

public void OnRemove(PSModuleInfo module) {
if (IsNetFramework()) {
AppDomain.CurrentDomain.AssemblyResolve -= MyResolveEventHandler;
}
}

private static Assembly MyResolveEventHandler(object sender, ResolveEventArgs args) {
//This code is used to resolve the assemblies
//Console.WriteLine($"Resolving {args.Name}");
var directoryPath = Path.GetDirectoryName(typeof(OnModuleImportAndRemove).Assembly.Location);
var filesInDirectory = Directory.GetFiles(directoryPath);

foreach (var file in filesInDirectory) {
var fileName = Path.GetFileName(file);
var assemblyName = Path.GetFileNameWithoutExtension(file);

if (args.Name.StartsWith(assemblyName)) {
//Console.WriteLine($"Loading {args.Name} assembly {fileName}");
return Assembly.LoadFile(file);
}
}
return null;
}

private bool IsNetFramework() {
// Get the version of the CLR
Version clrVersion = System.Environment.Version;
// Check if the CLR version is 4.x.x.x
return clrVersion.Major == 4;
}

private bool IsNetCore() {
return System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.OrdinalIgnoreCase);
}

private bool IsNet5OrHigher() {
return System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith(".NET 5", StringComparison.OrdinalIgnoreCase) ||
System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith(".NET 6", StringComparison.OrdinalIgnoreCase) ||
System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith(".NET 7", StringComparison.OrdinalIgnoreCase) ||
System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith(".NET 8", StringComparison.OrdinalIgnoreCase);
}
}
34 changes: 34 additions & 0 deletions Sources/Mailozaurr.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32804.467
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mailozaurr.PowerShell", "Mailozaurr.PowerShell\Mailozaurr.PowerShell.csproj", "{EEF3BFAD-C8A5-474C-BA52-5C20E66EF0F9}"
ProjectSection(ProjectDependencies) = postProject
{74FF5540-DB31-4031-BBE1-1A471A17CCFC} = {74FF5540-DB31-4031-BBE1-1A471A17CCFC}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mailozaurr", "Mailozaurr\Mailozaurr.csproj", "{74FF5540-DB31-4031-BBE1-1A471A17CCFC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EEF3BFAD-C8A5-474C-BA52-5C20E66EF0F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEF3BFAD-C8A5-474C-BA52-5C20E66EF0F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEF3BFAD-C8A5-474C-BA52-5C20E66EF0F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEF3BFAD-C8A5-474C-BA52-5C20E66EF0F9}.Release|Any CPU.Build.0 = Release|Any CPU
{74FF5540-DB31-4031-BBE1-1A471A17CCFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{74FF5540-DB31-4031-BBE1-1A471A17CCFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74FF5540-DB31-4031-BBE1-1A471A17CCFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74FF5540-DB31-4031-BBE1-1A471A17CCFC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F37BB785-3AB1-4498-8102-689C0E4C3924}
EndGlobalSection
EndGlobal
3 changes: 3 additions & 0 deletions Sources/Mailozaurr.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mailozaurr/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=personalizations/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
44 changes: 44 additions & 0 deletions Sources/Mailozaurr/Mailozaurr.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Company>Evotec</Company>
<Authors>Przemyslaw Klys</Authors>
<VersionPrefix>1.0.0</VersionPrefix>
<TargetFrameworks>net472;netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<AssemblyName>Mailozaurr</AssemblyName>
<Copyright>(c) 2011 - 2024 Przemyslaw Klys @ Evotec. All rights reserved.</Copyright>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DnsClient" Version="1.8.0" />
<PackageReference Include="EmailValidation" Version="1.2.0" />
<PackageReference Include="Google.Apis.Auth" Version="1.68.0" />
<PackageReference Include="MailKit" Version="4.8.0" />
<PackageReference Include="MimeKit" Version="4.8.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
</ItemGroup>

<ItemGroup>
<Using Include="MailKit" />
<Using Include="MailKit.Net.Smtp" />
<Using Include="MailKit.Security" />
<Using Include="MailKit.Net.Pop3" />
<Using Include="MailKit.Net.Imap" />
<Using Include="MailKit.Net" />
<Using Include="MimeKit" />
<Using Include="MimeKit.Cryptography" />
<Using Include="System" />
<Using Include="System.Net" />
<Using Include="System.Net.Http" />
<Using Include="System.Text" />
<Using Include="System.Collections" />
<Using Include="System.Collections.Generic" />
<Using Include="System.IO" />
<Using Include="System.Linq" />
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions Sources/Mailozaurr/Mailozaurr.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=authentication/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=definitions/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=enums/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=helpers/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=logging/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=mailgun/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=microsoftgraph/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=sendgrid/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=smtp/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
4 changes: 4 additions & 0 deletions Sources/Mailozaurr/Temporary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace Mailozaurr;

internal class Temporary {
}

0 comments on commit 0c726e4

Please sign in to comment.