Skip to content

Commit

Permalink
Net8 support (#69)
Browse files Browse the repository at this point in the history
net8 support
  • Loading branch information
obiwanjacobi authored Mar 9, 2024
1 parent 07ab74f commit 1994445
Show file tree
Hide file tree
Showing 109 changed files with 4,543 additions and 4,582 deletions.
1 change: 1 addition & 0 deletions Source/Code/Jacobi.Vst.CLI/CommandLineArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ internal sealed class CommandLineArgs
Arguments = new[] {
new ArgumentInfo { Property = nameof(PublishCommand.FilePath), Description="The file to publish." },
new ArgumentInfo { Property = nameof(PublishCommand.DeployPath), Name = "-o", Description="The output directory that will receive all the files." },
new ArgumentInfo { Property = nameof(PublishCommand.Platform), Name = "-p", Description="The CPU architecture platform (x64/x86)." },
}
}
};
Expand Down
62 changes: 29 additions & 33 deletions Source/Code/Jacobi.Vst.CLI/FindFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,33 @@ internal sealed class FindFiles
// scan dependency files for these framework monikers. [hack]
private static readonly string[] TargetFrameworkMonikers =
{
"net6.0",
"net5.0",
"netcoreapp3.1",
"net8.0-windows",
"net7.0-windows",
"net6.0-windows",
//"net5.0",
//"netcoreapp3.1",
"netstandard2.1",
"netstandard2.0",
"netstandard1.6",
"netstandard1.5",
"netstandard1.4",
"netstandard1.3",
"netstandard1.2",
"netstandard1.1",
"netstandard1.0"
//"netstandard1.6",
//"netstandard1.5",
//"netstandard1.4",
//"netstandard1.3",
//"netstandard1.2",
//"netstandard1.1",
//"netstandard1.0"
};

private readonly string _nugetPath;
private readonly string _binPath;

public string Platform { get; set; }

public FindFiles(string nugetPath, string binPath)
{
_nugetPath = nugetPath ?? throw new ArgumentNullException(nameof(nugetPath));
_binPath = binPath ?? throw new ArgumentNullException(nameof(binPath));
}

public ProcessorArchitecture ProcessorArchitecture { get; set; }

public IEnumerable<string> GetFilePaths(TargetName targetName)
{
var paths = new List<string>();
Expand Down Expand Up @@ -77,14 +79,15 @@ public IEnumerable<string> GetFilePaths(TargetName targetName)
}
else
{
var platform = ToString(ProcessorArchitecture);
var dependencies = FindDependencyFiles(kvp.Key, platform);
var dependencies = FindDependencyFiles(kvp.Key, Platform);
paths.AddRange(dependencies);

var rt = kvp.Value.RuntimeTargets?.Keys.FirstOrDefault(rt => rt.Contains(platform));
var rt = kvp.Value.RuntimeTargets?.Keys.FirstOrDefault(rt => rt.Contains(Platform));
if (rt != null)
{
paths.Add(Path.Combine(_nugetPath, kvp.Key, rt));
var path = Path.Combine(_nugetPath, kvp.Key, rt);
if (File.Exists(path))
paths.Add(path);
}
}
}
Expand All @@ -109,29 +112,22 @@ private IEnumerable<string> FindDependencyFiles(string dependency, string platfo
if (files.Any())
return files;
}
path = Path.Combine(path, platform);
if (Directory.Exists(path))

if (!String.IsNullOrEmpty(platform))
{
var files = Directory.EnumerateFiles(path, fileExt);
if (files.Any())
return files;
path = Path.Combine(path, platform);
if (Directory.Exists(path))
{
var files = Directory.EnumerateFiles(path, fileExt);
if (files.Any())
return files;
}
}
}

ConsoleOutput.Warning(
$"No library files (*.dll) could be found for: {dependency}!");
$"No library files (*.dll) could be found for: '{dependency}' ({platform})!");
return Enumerable.Empty<string>();
}

private static string ToString(ProcessorArchitecture processorArchitecture)
{
return processorArchitecture switch
{
ProcessorArchitecture.Amd64 => "x64",
ProcessorArchitecture.X86 => "x86",
ProcessorArchitecture.MSIL => "AnyCPU",
_ => string.Empty
};
}
}
}
8 changes: 5 additions & 3 deletions Source/Code/Jacobi.Vst.CLI/Jacobi.Vst.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net6.0-windows;net7.0-windows;net8.0-windows</TargetFrameworks>
<LangVersion>latest</LangVersion>
<AssemblyName>vstnet</AssemblyName>
<Version>2.0.2</Version>
<Version>2.0.3</Version>
<Authors>Marc Jacobi</Authors>
<Company>Jacobi Software</Company>
<Product>VST.NET</Product>
<Description>VST.NET 2 Command Line Interface</Description>
<Copyright>Copyright © 2008-2021 Jacobi Software</Copyright>
<Copyright>Copyright © 2008-2024 Jacobi Software</Copyright>
<PackageTags>vst vstnet cli</PackageTags>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageLicenseExpression>LGPL-2.1-only</PackageLicenseExpression>
Expand All @@ -19,6 +20,7 @@
<PackageId>VST.NET2-CLI</PackageId>
<AssemblyVersion>2.0.3.0</AssemblyVersion>
<FileVersion>2.0.3.0</FileVersion>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

<PropertyGroup Condition="Exists('../../../../../../_keyfile/Jacobi.snk')">
Expand Down
2 changes: 1 addition & 1 deletion Source/Code/Jacobi.Vst.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private static void DisplayVersion()
var assembly = Assembly.GetExecutingAssembly();

ConsoleOutput.Information($"VST.NET Command Line Interface. Version {assembly.GetName().Version}.");
ConsoleOutput.Information("Copyright © 2008-2021 Jacobi Software.");
ConsoleOutput.Information("Copyright © 2008-2024 Jacobi Software.");
ConsoleOutput.NewLine();
}
}
Expand Down
15 changes: 7 additions & 8 deletions Source/Code/Jacobi.Vst.CLI/PublishCommand.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.Json;

namespace Jacobi.Vst.CLI
Expand All @@ -27,7 +26,8 @@ public bool Execute()
DeployPath = @".\deploy";
}
FileExtensions.EnsureDirectoryExists(DeployPath);
DeployBinPath = Path.Combine(DeployPath, "bin");
//DeployBinPath = Path.Combine(DeployPath, "bin");
DeployBinPath = DeployPath;
FileExtensions.EnsureDirectoryExists(DeployBinPath);

var depsFile = GetDepsFile();
Expand All @@ -40,18 +40,16 @@ public bool Execute()
var plugin = GetPluginFile();
var host = GetHostFile();

var assemblyName = AssemblyName.GetAssemblyName(plugin ?? host);

if (host != null)
{
CopyDependencies(depsFile, DeployPath, assemblyName.ProcessorArchitecture);
CopyDependencies(depsFile, DeployPath);
PublishHost(host);
return true;
}

if (plugin != null)
{
CopyDependencies(depsFile, DeployBinPath, assemblyName.ProcessorArchitecture);
CopyDependencies(depsFile, DeployBinPath);
PublishPlugin(plugin);
return true;
}
Expand All @@ -64,16 +62,17 @@ public bool Execute()
public string DeployPath { get; set; }
public string DeployBinPath { get; set; }
public string FilePath { get; set; }
public string Platform { get; set; }

private void CopyDependencies(string depsFile, string deployPath, ProcessorArchitecture processorArchitecture)
private void CopyDependencies(string depsFile, string deployPath)
{
ConsoleOutput.Progress($"Copying dependencies to: {deployPath}");
using var stream = File.OpenRead(depsFile);
var json = Parse(stream);

var finder = new FindFiles(NuGetPath, Path.GetDirectoryName(FilePath))
{
ProcessorArchitecture = processorArchitecture
Platform = Platform
};
var paths = finder.GetFilePaths(json.Targets.First().Value);

Expand Down
19 changes: 13 additions & 6 deletions Source/Code/Jacobi.Vst.Core/Jacobi.Vst.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
<Version>2.0.0</Version>
<TargetFrameworks>net6.0-windows;net7.0-windows;net8.0-windows</TargetFrameworks>
<LangVersion>latest</LangVersion>
<AssemblyVersion>2.0.1.0</AssemblyVersion>
<FileVersion>2.0.1.0</FileVersion>
<Version>2.0.1</Version>
<Authors>Marc Jacobi</Authors>
<Company>Jacobi Software</Company>
<Product>VST.NET</Product>
<Platforms>x64;x86</Platforms>
<Nullable>enable</Nullable>
<Copyright>Jacobi Software © 2008-2021</Copyright>
<Copyright>Copyright © 2008-2024 Jacobi Software</Copyright>
<PackageLicenseExpression>LGPL-2.1-only</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/obiwanjacobi/vst.net</PackageProjectUrl>
<RepositoryUrl>https://github.com/obiwanjacobi/vst.net</RepositoryUrl>
Expand Down Expand Up @@ -45,9 +46,15 @@
<DocumentationFile>Jacobi.Vst.Core.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0-windows'">
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net7.0-windows'">
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0-windows'">
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
Expand Down
2 changes: 1 addition & 1 deletion Source/Code/Jacobi.Vst.Core/Jacobi.Vst.Core.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions Source/Code/Jacobi.Vst.Deployment/.gitignore

This file was deleted.

8 changes: 4 additions & 4 deletions Source/Code/Jacobi.Vst.Deployment/VstNetDeploy.targets
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VstNetCliExe Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">"$(MSBuildThisFileDirectory)/../tools/net6.0/vstnet.exe"</VstNetCliExe>
<VstNetCliExe Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">"$(MSBuildThisFileDirectory)..\tools\$(TargetFramework)\vstnet.exe"</VstNetCliExe>
<DeployOutput>"$(TargetDir)deploy"</DeployOutput>
</PropertyGroup>

<Target Name="DeployVstNet" AfterTargets="AfterBuild">
<Error Text="VST.NET2 targets .NET 6 only." Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
<Exec Command="$(VstNetCliExe) publish &quot;$(TargetPath)&quot; -o $(DeployOutput)" />
<Error Text="VST.NET2 targets .NET 6, 7 or 8 for Windows only." Condition="('$(TargetFrameworkIdentifier)' != '.NETCoreApp' or '$(OS)' != 'Windows_NT')" />
<Exec Command="$(VstNetCliExe) publish &quot;$(TargetPath)&quot; -o $(DeployOutput) -p $(Platform)" />
</Target>

<Target Name="CleanDeployVstNet" BeforeTargets="CoreClean" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<Target Name="CleanDeployVstNet" AfterTargets="CoreClean" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<Message Text="Cleaning VST.NET deploy folder." />
<ItemGroup>
<FilesToDelete Include="$(DeployOutput)\*"/>
Expand Down
76 changes: 56 additions & 20 deletions Source/Code/Jacobi.Vst.Deployment/host/VST.NET-Host.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,81 @@
<metadata>
<id>VST.NET2-Host</id>
<title>VST.NET 2.0 Library for Hosts</title>
<version>2.1.0</version>
<version>2.1.1</version>
<authors>Marc Jacobi</authors>
<owners>Jacobi Software</owners>
<license type="expression">LGPL-2.1-only</license>
<projectUrl>https://github.com/obiwanjacobi/vst.net</projectUrl>
<repository type="git" url="https://github.com/obiwanjacobi/vst.net" />
<!--<icon></icon>-->
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>VST.NET dotnet 6 primary assemblies for building a VST2 host application.</description>
<releaseNotes>
</releaseNotes>
<copyright>Copyright © 2008-2022 Jacobi Software</copyright>
<description>VST.NET dotnet 6, 7 and 8 primary assemblies for building a VST2 host application in Windows.</description>
<releaseNotes></releaseNotes>
<copyright>Copyright © 2008-2024 Jacobi Software</copyright>
<tags>vst vstnet</tags>
<dependencies>
<group targetFramework="net6.0">
<group targetFramework="net6.0-windows">
<dependency id="Microsoft.Extensions.Configuration.Json" version="6.0.0" />
</group>
<group targetFramework="net7.0-windows">
<dependency id="Microsoft.Extensions.Configuration.Json" version="7.0.0" />
</group>
<group targetFramework="net8.0-windows">
<dependency id="Microsoft.Extensions.Configuration.Json" version="8.0.0" />
</group>
</dependencies>
</metadata>
<files>
<file src="VST.NET2-Host.targets" target="build"></file>
<file src="VST.NET2-Host.props" target="build"></file>
<file src="..\VstNetDeploy.targets" target="build"></file>

<file src="..\..\x86\Release\Host\ijwhost.dll" target="runtimes\win-x86\native"></file>
<file src="..\..\x64\Release\Host\ijwhost.dll" target="runtimes\win-x64\native"></file>

<!-- dotnet 6 -->
<file src="..\..\x86\Release\Host\Jacobi.Vst.Host.Interop.dll" target="lib\net6.0-windows\x86"></file>
<file src="..\..\x86\Release\Host\Jacobi.Vst.Host.Interop.xml" target="lib\net6.0-windows\x86"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x86\Release\net6.0-windows\Jacobi.Vst.Core.dll" target="lib\net6.0-windows\x86"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x86\Release\net6.0-windows\Jacobi.Vst.Core.xml" target="lib\net6.0-windows\x86"></file>

<file src="..\..\x86\Release\Host\Jacobi.Vst.Host.Interop.dll" target="lib\net6.0\x86"></file>
<file src="..\..\x86\Release\Host\Jacobi.Vst.Host.Interop.xml" target="lib\net6.0\x86"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x86\Release\net6.0\Jacobi.Vst.Core.dll" target="lib\net6.0\x86"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x86\Release\net6.0\Jacobi.Vst.Core.xml" target="lib\net6.0\x86"></file>

<file src="..\..\x64\Release\Host\Jacobi.Vst.Host.Interop.dll" target="lib\net6.0\x64"></file>
<file src="..\..\x64\Release\Host\Jacobi.Vst.Host.Interop.xml" target="lib\net6.0\x64"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x64\Release\net6.0\Jacobi.Vst.Core.dll" target="lib\net6.0\x64"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x64\Release\net6.0\Jacobi.Vst.Core.xml" target="lib\net6.0\x64"></file>
<file src="..\..\x64\Release\Host\Jacobi.Vst.Host.Interop.dll" target="lib\net6.0-windows\x64"></file>
<file src="..\..\x64\Release\Host\Jacobi.Vst.Host.Interop.xml" target="lib\net6.0-windows\x64"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x64\Release\net6.0-windows\Jacobi.Vst.Core.dll" target="lib\net6.0-windows\x64"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x64\Release\net6.0-windows\Jacobi.Vst.Core.xml" target="lib\net6.0-windows\x64"></file>

<file src="..\..\x86\Release\Host\ijwhost.dll" target="runtimes\win10-x86\native"></file>
<file src="..\..\x64\Release\Host\ijwhost.dll" target="runtimes\win10-x64\native"></file>
<file src="..\..\Jacobi.Vst.CLI\bin\Release\net6.0-windows\vstnet.exe" target="tools\net6.0-windows"></file>
<file src="..\..\Jacobi.Vst.CLI\bin\Release\net6.0-windows\vstnet.dll" target="tools\net6.0-windows"></file>
<file src="..\..\Jacobi.Vst.CLI\bin\Release\net6.0-windows\vstnet.runtimeconfig.json" target="tools\net6.0-windows"></file>

<!-- dotnet 7 -->
<file src="..\..\x86\Release\Host\Jacobi.Vst.Host.Interop.dll" target="lib\net7.0-windows\x86"></file>
<file src="..\..\x86\Release\Host\Jacobi.Vst.Host.Interop.xml" target="lib\net7.0-windows\x86"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x86\Release\net7.0-windows\Jacobi.Vst.Core.dll" target="lib\net7.0-windows\x86"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x86\Release\net7.0-windows\Jacobi.Vst.Core.xml" target="lib\net7.0-windows\x86"></file>

<file src="..\..\x64\Release\Host\Jacobi.Vst.Host.Interop.dll" target="lib\net7.0-windows\x64"></file>
<file src="..\..\x64\Release\Host\Jacobi.Vst.Host.Interop.xml" target="lib\net7.0-windows\x64"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x64\Release\net7.0-windows\Jacobi.Vst.Core.dll" target="lib\net7.0-windows\x64"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x64\Release\net7.0-windows\Jacobi.Vst.Core.xml" target="lib\net7.0-windows\x64"></file>

<file src="..\..\Jacobi.Vst.CLI\bin\Release\net7.0-windows\vstnet.exe" target="tools\net7.0-windows"></file>
<file src="..\..\Jacobi.Vst.CLI\bin\Release\net7.0-windows\vstnet.dll" target="tools\net7.0-windows"></file>
<file src="..\..\Jacobi.Vst.CLI\bin\Release\net7.0-windows\vstnet.runtimeconfig.json" target="tools\net7.0-windows"></file>

<!-- dotnet 8 -->
<file src="..\..\x86\Release\Host\Jacobi.Vst.Host.Interop.dll" target="lib\net8.0-windows\x86"></file>
<file src="..\..\x86\Release\Host\Jacobi.Vst.Host.Interop.xml" target="lib\net8.0-windows\x86"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x86\Release\net8.0-windows\Jacobi.Vst.Core.dll" target="lib\net8.0-windows\x86"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x86\Release\net8.0-windows\Jacobi.Vst.Core.xml" target="lib\net8.0-windows\x86"></file>

<file src="..\..\x64\Release\Host\Jacobi.Vst.Host.Interop.dll" target="lib\net8.0-windows\x64"></file>
<file src="..\..\x64\Release\Host\Jacobi.Vst.Host.Interop.xml" target="lib\net8.0-windows\x64"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x64\Release\net8.0-windows\Jacobi.Vst.Core.dll" target="lib\net8.0-windows\x64"></file>
<file src="..\..\Jacobi.Vst.Core\bin\x64\Release\net8.0-windows\Jacobi.Vst.Core.xml" target="lib\net8.0-windows\x64"></file>

<file src="..\..\Jacobi.Vst.CLI\bin\Release\net6.0\vstnet.exe" target="tools\net6.0"></file>
<file src="..\..\Jacobi.Vst.CLI\bin\Release\net6.0\vstnet.dll" target="tools\net6.0"></file>
<file src="..\..\Jacobi.Vst.CLI\bin\Release\net6.0\vstnet.runtimeconfig.json" target="tools\net6.0"></file>
<file src="..\..\Jacobi.Vst.CLI\bin\Release\net8.0-windows\vstnet.exe" target="tools\net8.0-windows"></file>
<file src="..\..\Jacobi.Vst.CLI\bin\Release\net8.0-windows\vstnet.dll" target="tools\net8.0-windows"></file>
<file src="..\..\Jacobi.Vst.CLI\bin\Release\net8.0-windows\vstnet.runtimeconfig.json" target="tools\net8.0-windows"></file>
</files>
</package>
Loading

0 comments on commit 1994445

Please sign in to comment.