Skip to content

Commit

Permalink
Merge pull request #4 from molsonkiko/rdipardo-refactor/unmanaged-exp…
Browse files Browse the repository at this point in the history
…orts

Rdipardo refactor/unmanaged exports
  • Loading branch information
molsonkiko committed Feb 27, 2024
2 parents d9eee3d + 9e80383 commit c5e3895
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 65 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/CI_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
uses: microsoft/setup-msbuild@v2.0.0

- name: MSBuild of solution
run: msbuild NppCSharpPluginPack/NppCSharpPluginPack.sln /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /m /verbosity:minimal
run: >
msbuild /t:Restore NppCSharpPluginPack/NppCSharpPluginPack.sln;
msbuild NppCSharpPluginPack/NppCSharpPluginPack.sln /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /m /verbosity:minimal
- name: Archive artifacts for x64
if: matrix.build_platform == 'x64' && matrix.build_configuration == 'Release'
Expand Down
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Change Log
All [notable changes](#002---2024-02-06) to this project will be documented in this file.
All [notable changes](#003---2024-02-26) to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
Expand All @@ -22,7 +22,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Avoid plugin crash when too-large int values are entered in the selection-remembering form.
- Holding down `Enter` in a multiline textbox does not add multiple new lines; it only adds one newline on keyup.

## [0.0.3] - (UNRELEASED) YYYY-MM-DD
## [0.0.3] - 2024-02-26

### Added

1. Added new `Allocate indicators demo`, demonstrating how to allocate and use indicators to style text.
2. Demo on the `SCN_MODIFIED` and `NPPN_GLOBALMODIFIED` notifications, which are used to track when a document is modified.

### Changed

1. Update method of building a DLL to [remove a dependency on .NET Framework 3.5](https://github.com/molsonkiko/NppCSharpPluginPack/pull/4).
- This also allows the user the specify whatever Notepad++ directory they wish, using the `NppPath32` (to specify 32-bit Notepad++ directory) and `NppPath64` (to specify 64-bit directory) variables from the command line like so: `msbuild /p:NppPath32="D:\portable\npp\x86";NppPath64="somewhere\else\x64" ...`

### Fixed

Expand All @@ -35,8 +45,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

1. Ported over (from kbilsted's old template) the [ToolsForMaintainersOfTheProjectTemplate](/ToolsForMaintainersOfTheProjectTemplate/) folder for updating some of the [PluginInfrastructure](/NppCSharpPluginPack/PluginInfrastructure/) files to stay up to date with Notepad++.
2. Added new [PopupDialog form](/docs/README.md#popup-dialog), which demonstrates how to configure a pop-up dialog that has select-able fields like textboxes or buttons.
3. Added new `Allocate indicators demo`, demonstrating how to allocate and use indicators to style text.
4. Demo on the `SCN_MODIFIED` and `NPPN_GLOBALMODIFIED` notifications, which are used to track when a document is modified.

### Changed

Expand Down
49 changes: 40 additions & 9 deletions NppCSharpPluginPack/NppCSharpPluginPack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,20 @@
<PropertyGroup>
<!-- Default values for debugging so it start correct version of Notepad++
$(ProgramW6432) and $(MSBuildProgramFiles32) points to the 64 and 32 bit "Program Files" directories -->
<NppPath64 Condition="'$(NppPath64)' == ''">$(ProgramW6432)\Notepad++</NppPath64>
<NppPath32 Condition="'$(NppPath32)' == ''">$(MSBuildProgramFiles32)\Notepad++</NppPath32>
<StartAction>Program</StartAction>
<StartProgram Condition="'$(Platform)'=='x64'">$(ProgramW6432)\Notepad++\notepad++.exe</StartProgram>
<StartProgram Condition="'$(Platform)'=='x86'">$(MSBuildProgramFiles32)\Notepad++\notepad++.exe</StartProgram>
<StartProgram Condition="'$(Platform)'=='x64'">$(NppPath64)\notepad++.exe</StartProgram>
<StartProgram Condition="'$(Platform)'=='x86'">$(NppPath32)\notepad++.exe</StartProgram>
</PropertyGroup>
<PropertyGroup>
<RestorePackagesPath>$(MSBuildProjectDirectory)\packages</RestorePackagesPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="UnmanagedExports.Repack.Upgrade" Version="1.2.1" GeneratePathProperty="true">
<ExcludeAssets>all</ExcludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<!-- forms -->
<Compile Include="Forms\NppFormHelper.cs" />
Expand Down Expand Up @@ -181,16 +191,37 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildProjectDirectory)\PluginInfrastructure\DllExport\NppPlugin.DllExport.targets" />
<Import Condition="Exists($(PkgUnmanagedExports_Repack_Upgrade))"
Project="$(PkgUnmanagedExports_Repack_Upgrade)\build\UnmanagedExports.Repack.Upgrade.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 Name="CopyTestFiles" BeforeTargets="Build">
-->
<Target Name="CopyBin" DependsOnTargets="Build" AfterTargets="Build" >
<!-- copy over the appropriate DLL and test files to the Notepad++ directory.
Otherwise Notepad++ will just load without the plugin. -->
<ItemGroup>
<TESTFILES Include="testfiles\**\*.*" />
<NPP64BIT Include="$(NppPath64)\plugins\CSharpPluginPack" />
<NPP32BIT Include="$(NppPath32)\plugins\CSharpPluginPack" />
</ItemGroup>
<Copy SourceFiles="@(TESTFILES)" DestinationFolder="$(ProgramW6432)\Notepad++\plugins\CSharpPluginPack\%(RecursiveDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(TESTFILES)" DestinationFolder="$(MSBuildProgramFiles32)\Notepad++\plugins\CSharpPluginPack\%(RecursiveDir)" SkipUnchangedFiles="true" />
<MakeDir Directories="@(NPP64BIT)"
Condition=" '$(Platform)' == 'x64' " />
<MakeDir Directories="@(NPP32BIT)"
Condition=" '$(Platform)' == 'x86' " />
<Copy SourceFiles="bin\Release-x64\CSharpPluginPack.dll"
Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "
DestinationFolder="@(NPP64BIT)"
SkipUnchangedFiles="true" />
<Copy SourceFiles="bin\Release\CSharpPluginPack.dll"
Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "
DestinationFolder="@(NPP32BIT)"
SkipUnchangedFiles="true" />
<Copy SourceFiles="bin\Debug-x64\CSharpPluginPack.dll"
Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "
DestinationFolder="@(NPP64BIT)"
SkipUnchangedFiles="true" />
<Copy SourceFiles="bin\Debug\CSharpPluginPack.dll"
Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "
DestinationFolder="@(NPP32BIT)"
SkipUnchangedFiles="true" />
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
using System;
using System.Runtime.InteropServices;

namespace NppPlugin.DllExport
namespace RGiesecke.DllExport
{
/// <summary>
/// The fully qualified type name must be <c>RGiesecke.DllExport.DllExportAttribute</c> in order to work with the pre-configured task in <c>UnmanagedExports.Repack.Upgrade.targets</c>.
/// This implementation could be avoided if we referenced the <c>RGiesecke.DllExport.Metadata</c> assembly, but then it will look like a runtime dependency, and be copied to the build output directory.
/// <para>
/// See <seealso href="https://github.com/stevenengland/UnmanagedExports.Repack.Upgrade/blob/master/nuget/build/UnmanagedExports.Repack.Upgrade.targets"/>
/// </para>
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
partial class DllExportAttribute : Attribute
{
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System;
using System.Runtime.InteropServices;
using Kbg.NppPluginNET.PluginInfrastructure;
using NppPlugin.DllExport;
using RGiesecke.DllExport;

namespace Kbg.NppPluginNET
{
Expand Down
4 changes: 2 additions & 2 deletions NppCSharpPluginPack/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.0.2.4")]
[assembly: AssemblyFileVersion("0.0.2.4")]
[assembly: AssemblyVersion("0.0.3.0")]
[assembly: AssemblyFileVersion("0.0.3.0")]
Binary file modified NppCSharpPluginPack/Release_x64.zip
Binary file not shown.
Binary file modified NppCSharpPluginPack/Release_x86.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you have any issues, see if [updating to the latest release](https://github.c

[Read the docs.](/docs/README.md)

[Read information about the plugin architecture (some of this may be out of date)](/PluginPackArchitecture.md)
[Read information about the plugin architecture (*some of this may be out of date*)](/PluginPackArchitecture.md)

[View past changes.](/CHANGELOG.md)

Expand Down

0 comments on commit c5e3895

Please sign in to comment.