forked from Ivasoft/DllExports
Optional assembly signing key
This commit is contained in:
10
.drone.yml
10
.drone.yml
@@ -14,7 +14,7 @@ steps:
|
||||
- dotnet pack --configuration Release DllExports.MSBuild/DllExports.MSBuild.csproj
|
||||
## Following is based on build.ps1
|
||||
- apt update && apt install -y zip unzip
|
||||
- unzip -d DllExports.MSBuild/bin/Release/nupkg DllExports.MSBuild/bin/Release/IvDllExports.0.1.1.nupkg
|
||||
- unzip -d DllExports.MSBuild/bin/Release/nupkg DllExports.MSBuild/bin/Release/IvDllExports.0.1.1.2.nupkg
|
||||
- cp -r DllExports.MSBuild/bin/Release/nupkg/lib DllExports.MSBuild/bin/Release/nupkg/tasks
|
||||
- find DllExports.MSBuild/bin/Release/nupkg/lib ! -name 'DllExports.dll' -type f -exec rm -f {} +
|
||||
# Tasks are not supported on netstandard2.0
|
||||
@@ -24,8 +24,8 @@ steps:
|
||||
- rm -rf DllExports.MSBuild/bin/Release/nupkg/lib/net5.0
|
||||
- sed -i -E '/(NETFramework4.7.2|net5.0)/d' DllExports.MSBuild/bin/Release/nupkg/IvDllExports.nuspec
|
||||
# Re-pack
|
||||
- rm DllExports.MSBuild/bin/Release/IvDllExports.0.1.1.nupkg
|
||||
- (cd DllExports.MSBuild/bin/Release/nupkg; zip -r ../IvDllExports.0.1.1.nupkg ./)
|
||||
- rm DllExports.MSBuild/bin/Release/IvDllExports.0.1.1.2.nupkg
|
||||
- (cd DllExports.MSBuild/bin/Release/nupkg; zip -r ../IvDllExports.0.1.1.2.nupkg ./)
|
||||
# Cli
|
||||
- dotnet build --configuration Release DllExports.Cli/DllExports.Cli.csproj
|
||||
- dotnet pack --configuration Release DllExports.Cli/DllExports.Cli.csproj
|
||||
@@ -37,7 +37,7 @@ steps:
|
||||
from_secret: drone_release
|
||||
nuget_uri: https://git.ivasoft.cz/api/packages/Ivasoft/nuget/index.json
|
||||
commands:
|
||||
- dotnet nuget push DllExports.MSBuild/bin/Release/IvDllExports.0.1.1.nupkg --api-key $$PLUGIN_NUGET_APIKEY --source $$PLUGIN_NUGET_URI --skip-duplicate
|
||||
- dotnet nuget push DllExports.Cli/bin/Release/IvDllExports-Cli.0.1.1.nupkg --api-key $$PLUGIN_NUGET_APIKEY --source $$PLUGIN_NUGET_URI --skip-duplicate
|
||||
- dotnet nuget push DllExports.MSBuild/bin/Release/IvDllExports.0.1.1.2.nupkg --api-key $$PLUGIN_NUGET_APIKEY --source $$PLUGIN_NUGET_URI --skip-duplicate
|
||||
- dotnet nuget push DllExports.Cli/bin/Release/IvDllExports-Cli.0.1.1.2.nupkg --api-key $$PLUGIN_NUGET_APIKEY --source $$PLUGIN_NUGET_URI --skip-duplicate
|
||||
when:
|
||||
event: tag
|
||||
@@ -65,6 +65,9 @@ class A
|
||||
else
|
||||
options.RemoveInputFile = a;
|
||||
break;
|
||||
case "keyfile":
|
||||
options.KeyFile = args[++i];
|
||||
break;
|
||||
|
||||
default:
|
||||
Console.Error.WriteLine($"Unknown option '{arg}'.");
|
||||
|
||||
@@ -47,6 +47,12 @@ namespace DllExports.MSBuild
|
||||
set => options.RemoveInputFile = value;
|
||||
}
|
||||
|
||||
public string KeyFile
|
||||
{
|
||||
get => options.KeyFile;
|
||||
set => options.KeyFile = value;
|
||||
}
|
||||
|
||||
public override bool Execute()
|
||||
{
|
||||
if (!Enabled)
|
||||
|
||||
@@ -54,7 +54,8 @@ namespace DllExports.MSBuild
|
||||
options.OutputFile,
|
||||
options.Architectures,
|
||||
options.ArchitectureNameFormat,
|
||||
options.RemoveInputFile
|
||||
options.RemoveInputFile,
|
||||
options.KeyFile
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,8 @@ namespace DllExports.MSBuild
|
||||
options.OutputFile,
|
||||
options.Architectures,
|
||||
options.ArchitectureNameFormat,
|
||||
options.RemoveInputFile
|
||||
options.RemoveInputFile,
|
||||
options.KeyFile
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,8 @@ namespace DllExports.MSBuild
|
||||
(string) arr[2],
|
||||
(string[]) arr[3],
|
||||
(string) arr[4],
|
||||
(bool) arr[5]
|
||||
(bool) arr[5],
|
||||
(string) arr[6]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace DllExports
|
||||
|
||||
public bool RemoveInputFile { get; set; }
|
||||
|
||||
public string KeyFile { get; set; }
|
||||
|
||||
internal (string Path, string Name, bool? Is32Bit)[] CalculateOutputFiles()
|
||||
{
|
||||
var outputFile = GetOutputFileName();
|
||||
|
||||
@@ -23,7 +23,8 @@ namespace DllExports
|
||||
string outputFile,
|
||||
string[] architectures,
|
||||
string architectureNameFormat,
|
||||
bool removeInputFile)
|
||||
bool removeInputFile,
|
||||
string keyFile)
|
||||
{
|
||||
var options = new ExportOptions
|
||||
{
|
||||
@@ -32,7 +33,8 @@ namespace DllExports
|
||||
OutputFile = outputFile,
|
||||
Architectures = architectures,
|
||||
ArchitectureNameFormat = architectureNameFormat,
|
||||
RemoveInputFile = removeInputFile
|
||||
RemoveInputFile = removeInputFile,
|
||||
KeyFile = keyFile
|
||||
};
|
||||
|
||||
var moduleContext = ModuleDef.CreateModuleContext();
|
||||
@@ -124,6 +126,8 @@ namespace DllExports
|
||||
foreach (var output in outputFiles)
|
||||
{
|
||||
var moduleOptions = GetModuleOptions(module, output.Is32Bit);
|
||||
if (!string.IsNullOrEmpty(options.KeyFile))
|
||||
moduleOptions.StrongNameKey = new StrongNameKey(options.KeyFile);
|
||||
|
||||
var dir = Path.GetDirectoryName(output.Path);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>0.1.1</Version>
|
||||
<Version>0.1.1.2</Version>
|
||||
<AssemblyVersion>0.1.0.0</AssemblyVersion>
|
||||
<FileVersion>0.1.1.0</FileVersion>
|
||||
<InformationalVersion>0.1.1</InformationalVersion>
|
||||
<FileVersion>0.1.1.2</FileVersion>
|
||||
<InformationalVersion>0.1.1.2</InformationalVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user