Skip to content

Upgrade to .NET 8 and replace ILMerge with single-file deployment #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.user
*.userosscache
*.sln.docstates
launchSettings.json

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down Expand Up @@ -130,10 +131,6 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# NuGet Packages
*.nupkg
Expand Down
10 changes: 6 additions & 4 deletions DocxMerge/DocxMerge.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
# Visual Studio Version 17
VisualStudioVersion = 17.11.35312.102
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocxMerge", "DocxMerge\DocxMerge.csproj", "{97EC5023-46FC-4027-BF4E-33A5E8890FA0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocxMerge", "DocxMerge\DocxMerge.csproj", "{97EC5023-46FC-4027-BF4E-33A5E8890FA0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -19,4 +18,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {876BE244-2A1E-4AF6-A521-50518B1C60A4}
EndGlobalSection
EndGlobal
6 changes: 0 additions & 6 deletions DocxMerge/DocxMerge/App.config

This file was deleted.

96 changes: 16 additions & 80 deletions DocxMerge/DocxMerge/DocxMerge.csproj
Original file line number Diff line number Diff line change
@@ -1,87 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSBuild.ILMerge.Task.1.0.3-rc2\build\MSBuild.ILMerge.Task.props" Condition="Exists('..\packages\MSBuild.ILMerge.Task.1.0.3-rc2\build\MSBuild.ILMerge.Task.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{97EC5023-46FC-4027-BF4E-33A5E8890FA0}</ProjectGuid>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DocxMerge</RootNamespace>
<AssemblyName>DocxMerge</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<AssemblyTitle>DocxMerge</AssemblyTitle>
<Description>Simple command line program to merge word documents</Description>
<Product>DocxMerge</Product>
<Copyright>Copyright © James Santiago 2015</Copyright>
<AssemblyVersion>2.0.0</AssemblyVersion>
<FileVersion>2.0.0</FileVersion>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PropertyGroup>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
<SelfContained>false</SelfContained>
<PublishDir>bin\publish\$(TargetFramework)_$(RuntimeIdentifier)</PublishDir>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommandLine, Version=2.0.275.0, Culture=neutral, PublicKeyToken=de6f01bd326f8c32, processorArchitecture=MSIL">
<HintPath>..\packages\CommandLineParser.2.0.275-beta\lib\net45\CommandLine.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\DocumentFormat.OpenXml.2.5\lib\DocumentFormat.OpenXml.dll</HintPath>
<Private>True</Private>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Options.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="ILMerge.props" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="ILMergeOrder.txt" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="DocumentFormat.OpenXml" Version="3.1.1" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSBuild.ILMerge.Task.1.0.3-rc2\build\MSBuild.ILMerge.Task.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuild.ILMerge.Task.1.0.3-rc2\build\MSBuild.ILMerge.Task.props'))" />
<Error Condition="!Exists('..\packages\MSBuild.ILMerge.Task.1.0.3-rc2\build\MSBuild.ILMerge.Task.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuild.ILMerge.Task.1.0.3-rc2\build\MSBuild.ILMerge.Task.targets'))" />
</Target>
<Import Project="..\packages\MSBuild.ILMerge.Task.1.0.3-rc2\build\MSBuild.ILMerge.Task.targets" Condition="Exists('..\packages\MSBuild.ILMerge.Task.1.0.3-rc2\build\MSBuild.ILMerge.Task.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
28 changes: 0 additions & 28 deletions DocxMerge/DocxMerge/ILMerge.props

This file was deleted.

4 changes: 0 additions & 4 deletions DocxMerge/DocxMerge/ILMergeOrder.txt

This file was deleted.

35 changes: 14 additions & 21 deletions DocxMerge/DocxMerge/Options.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommandLine;
using CommandLine.Text;
using CommandLine;

namespace DocxMerge
namespace DocxMerge;

class Options
{
class Options
{
[Option('i', "input", Required = true, HelpText = "A list of docx files to merge in order")]
public IEnumerable<string> InputFiles { get; set; }
[Option('i', "input", Required = true, HelpText = "A list of docx files to merge in order")]
public IEnumerable<string> InputFiles { get; set; }

[Option('o', "output", Required = false, HelpText = "Output file [Default: output.docx]")]
public string Output { get; set; }
[Option('o', "output", Required = false, HelpText = "Output file [Default: output.docx]")]
public string Output { get; set; }

[Option('f', "Force", Required = false, HelpText = "Replace output if already exists")]
public bool Force { get; set; }
[Option('f', "Force", Required = false, HelpText = "Replace output if already exists")]
public bool Force { get; set; }

[Option('r', "Repair-Spacing", Required = false, HelpText = "Replace single spacing after sentences removed from pandoc")]
public bool RepairSpacing { get; set; }
[Option('r', "Repair-Spacing", Required = false, HelpText = "Replace single spacing after sentences removed from pandoc")]
public bool RepairSpacing { get; set; }

[Option('v', "Verbose", Required = false, HelpText = "Show more information when executing")]
public bool Verbose { get; set; }
}
[Option('v', "Verbose", Required = false, HelpText = "Show more information when executing")]
public bool Verbose { get; set; }
}
Loading