Skip to content

Commit

Permalink
Produce NuGet package on build
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillOsenkov committed Dec 23, 2023
1 parent caebef5 commit 57a75d7
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
23 changes: 23 additions & 0 deletions ILRepack.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>ILRepack</id>
<version>2.0.19</version>
<title>ILRepack - Open-source alternative to ILMerge</title>
<authors>Francois Valdy</authors>
<owners>Francois Valdy, Kirill Osenkov</owners>
<language>en-US</language>
<license type="expression">Apache-2.0</license>
<projectUrl>https://github.com/gluck/il-repack</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>ILRepack is meant at replacing ILMerge / Mono.Merge.
The former being closed-source, impossible to customize, slow, resource consuming and many more. The later being deprecated, unsupported, and based on an old version of Mono.Cecil.</description>
<summary>ILRepack is a utility that can be used to merge multiple .NET assemblies into a single assembly</summary>
<tags>ILRepack ILMerge dotnet IL</tags>
<copyright>Copyright Francois Valdy 2011-2015</copyright>
</metadata>
<files>
<file src="ILRepack.props" target="build" />
<file src="ILRepack.exe" target="tools" />
</files>
</package>
5 changes: 2 additions & 3 deletions ILRepack.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup>
<ILRepack>$(MSBuildThisFileDirectory)..\tools\ILRepack.exe</ILRepack>
<ILRepack>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\tools\ILRepack.exe'))</ILRepack>
</PropertyGroup>
</Project>
29 changes: 29 additions & 0 deletions ILRepack/ILRepack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</PropertyGroup>
<ItemGroup>
<None Include="ILRepack.snk" />
<None Include="$(MSBuildThisFileDirectory)..\ILRepack.props" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
Expand All @@ -31,4 +32,32 @@
<ItemGroup>
<EmbeddedResource Include="$(PkgSourceLink)\tools\pdbstr.exe" />
</ItemGroup>

<Target Name="PrepareNupkgInfo">
<PropertyGroup>
<NuspecPath>$(MSBuildThisFileDirectory)..\ILRepack.nuspec</NuspecPath>
<NupkgPath>$(OutDir)ILRepack.nupkg</NupkgPath>
</PropertyGroup>
</Target>

<Target Name="PackNuGet"
AfterTargets="Build"
DependsOnTargets="PrepareNupkgInfo"
Condition="$(Configuration) == 'Release'">
<MakeDir Directories="Repacked" />
<Exec
Command="&quot;$(TargetPath)&quot; /log /wildcards /internalize /ndebug /out:Repacked\ILRepack.exe BamlParser.dll Fasterflect.dll Mono.Cecil.dll Mono.Posix.dll"
WorkingDirectory="$(OutDir)"
ConsoleToMSBuild="True" />
<PackTask
PackItem="$(NuspecPath)"
NuspecFile="$(NuspecPath)"
NuspecBasePath="$(OutDir)"
NuspecOutputPath="$(NuspecOutputPath)"
PackageOutputPath="$(OutDir)"
RestoreOutputPath="$(RestoreOutputPath)"
SymbolPackageFormat="snupkg"
/>
</Target>

</Project>

0 comments on commit 57a75d7

Please sign in to comment.