diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d8427da --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: Build Visual Studio Project + +on: [push] + +jobs: + build: + runs-on: windows-latest + strategy: + matrix: + platform: [x86, x64] + configuration: [Debug, Release] + + steps: + - name: Checkout code + uses: actions/checkout@v4.2.0 + with: + fetch-depth: 0 # avoid shallow clone so nbgv can do its work. + + - uses: dotnet/nbgv@master + id: nbgv + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + + - name: Build with MSBuild + run: | + msbuild jN.vcxproj /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:VersionMajor=${{steps.nbgv.outputs.VersionMajor}} /p:VersionMinor=${{steps.nbgv.outputs.VersionMinor}} /p:BuildNumber=${{steps.nbgv.outputs.BuildNumber}} /p:VersionRevision=${{steps.nbgv.outputs.VersionRevision}} + + - name: Create zip file + run: | + if ("${{ matrix.platform }}" -eq "x64"){ + Copy-Item ${{ matrix.platform}}/${{ matrix.configuration }}/*.dll ./deploy/ + } else { + Copy-Item ${{ matrix.configuration }}/*.dll ./deploy/ + } + + cd ./deploy + 7z a ../jN_${{ steps.nbgv.outputs.SemVer2 }}_${{ matrix.platform }}.zip * + + - name: Upload artifacts + uses: actions/upload-artifact@v4.4.0 + with: + name: Build artifacts ${{ matrix.platform }} ${{ matrix.configuration }} + path: | + jN_*.zip + ${{ matrix.configuration }}/*.dll + ${{ matrix.configuration }}/*.pdb + ${{ matrix.platform }}/${{ matrix.configuration }}/*.dll + ${{ matrix.platform }}/${{ matrix.configuration }}/*.pdb + + retention-days: 3 \ No newline at end of file diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..1faebc4 --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,106 @@ +name: Create Release + +on: + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + strategy: + matrix: + platform: [x86, x64] + configuration: [Release] + + steps: + - name: Checkout code + uses: actions/checkout@v4.2.0 + with: + fetch-depth: 0 # avoid shallow clone so nbgv can do its work. + + - uses: dotnet/nbgv@master + id: nbgv + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + + - name: Build with MSBuild + run: | + msbuild jN.vcxproj /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:VersionMajor=${{steps.nbgv.outputs.VersionMajor}} /p:VersionMinor=${{steps.nbgv.outputs.VersionMinor}} /p:BuildNumber=${{steps.nbgv.outputs.BuildNumber}} /p:VersionRevision=${{steps.nbgv.outputs.VersionRevision}} + + - name: Create zip file + run: | + if ("${{ matrix.platform }}" -eq "x64"){ + Copy-Item ${{ matrix.platform}}/${{ matrix.configuration }}/*.dll ./deploy/ + } else { + Copy-Item ${{ matrix.configuration }}/*.dll ./deploy/ + } + + cd ./deploy + 7z a ../jN_${{ steps.nbgv.outputs.SemVer2 }}_${{ matrix.platform }}.zip * + + - name: Upload artifacts + uses: actions/upload-artifact@v4.4.0 + with: + name: Build artifacts + path: | + jN_*.zip + ${{ matrix.configuration }}/*.dll + ${{ matrix.configuration }}/*.pdb + ${{ matrix.platform }}/${{ matrix.configuration }}/*.dll + ${{ matrix.platform }}/${{ matrix.configuration }}/*.pdb + + retention-days: 3 + + release: + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4.2.0 + with: + fetch-depth: 0 # avoid shallow clone so nbgv can do its work. + + - uses: dotnet/nbgv@master + id: nbgv + + - name: Create Tag + run: git tag ${{ steps.nbgv.outputs.SemVer2 }} + + - name: Push Tag + run: git push origin ${{ steps.nbgv.outputs.SemVer2 }} + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.nbgv.outputs.SemVer2 }} + release_name: ${{ steps.nbgv.outputs.SemVer2 }} + draft: true + prerelease: false + + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: Build artifacts + + - name: Upload x64 + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: jN_${{ steps.nbgv.outputs.SemVer2 }}_x64.zip + asset_name: jN_${{ steps.nbgv.outputs.SemVer2 }}_x64.zip + asset_content_type: application/zip + + - name: Upload x86 + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: jN_${{ steps.nbgv.outputs.SemVer2 }}_x86.zip + asset_name: jN_${{ steps.nbgv.outputs.SemVer2 }}_x86.zip + asset_content_type: application/zip \ No newline at end of file diff --git a/Readme.md b/Readme.md index 4a9f0a4..bd21e99 100644 --- a/Readme.md +++ b/Readme.md @@ -1,12 +1,29 @@ # jN Npp Plugin -[![Build status](https://ci.appveyor.com/api/projects/status/80mwe62vnmtkjy7o/branch/master?svg=true)](https://ci.appveyor.com/project/sieukrem/jn-npp-plugin/branch/master) -jN (JavaScript for Notepad++) allows you to extend Notepad++ by using JavaScript. +`jN Npp Plugin` is a plugin for Notepad++, which allows you to extend Notepad++ by writing JavaScript code. ## Technology -jN uses the built-in javascript engine of Microsoft Windows. This powerful engine allows to access a lot of ActiveX base + +`jN` uses the built-in javascript engine of Microsoft Windows. This powerful engine allows to access a lot of ActiveX based services like Shell, WMI of operating system. -Due to automate Notepad++ jN wraps the Notepad++ API into ActiveX interfaces accessible via global objects *Editor* and *System*. -## Getting Started -You will find the features list and examples in [wiki](https://github.com/sieukrem/jn-npp-plugin/wiki). +`jN` wraps the native Notepad++ API into ActiveX interfaces accessible via global objects `Editor` and `System` in your JavaScript code. + +## How to Use - Getting Started + +You will find the feature list and examples in [wiki](https://github.com/sieukrem/jn-npp-plugin/wiki). + +## For Developers + +### Folder Structure + +- `common` - implementation of Notepad++ independent ActiveX elements (e.g. Dialog, Menu, WinApi, System, ...). +- `editor` - implementation of Notepad++ related ActiveX elements (e.g. DockableDialog, View, ViewLine). +- `npp` - copy-in files from original Notepad++ plugin template project. +- `deploy` - collection of JavaScript files, which were meant to show capabilities of `jN`, but contain also some useful functions like XML, Grep, Zen Coding, SmartHighlighter. + +### Building + +Open `jN.sln` in Visual Studio and build solution. + +> Rebuild entire solution every time you modified any of `*.idl` files! diff --git a/VersionInfo.h b/VersionInfo.h index fefd822..ad469a1 100644 --- a/VersionInfo.h +++ b/VersionInfo.h @@ -16,12 +16,24 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#ifndef VERSION_MA #define VERSION_MA 2 -#define VERSION_MI 2 +#endif -// increment revision in case of modification -#define REVISION 185 - #define xstr(s) str(s) - #define str(s) #s -#define _VERSION_STR VERSION_MA ## . ## REVISION +#ifndef VERSION_MI +#define VERSION_MI 2 +#endif + +#ifndef BUILD_NUMBER +// increment BUILD_NUMBER in case of modification +#define BUILD_NUMBER 185 +#endif + +#ifndef VERSION_REVISION +#define VERSION_REVISION 0 +#endif + +#define xstr(s) str(s) +#define str(s) #s +#define _VERSION_STR VERSION_MA ## . ## VERSION_MI ## . ## BUILD_NUMBER ## . ## VERSION_REVISION diff --git a/VersionInfo_tmpl.h b/VersionInfo_tmpl.h deleted file mode 100644 index 5a9d6b6..0000000 --- a/VersionInfo_tmpl.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -This file is part of jN, a plugin for Notepad++ -Copyright (C)2013 Eugen Kremer - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#define VERSION_MA 2 -#define VERSION_MI 0 - -// increment revision in case of modification -#define REVISION $WCREV$ - #define xstr(s) str(s) - #define str(s) #s -#define _VERSION_STR VERSION_MA ## . ## REVISION - diff --git a/appveyor.yml b/appveyor.disabled.yml similarity index 100% rename from appveyor.yml rename to appveyor.disabled.yml diff --git a/build.xml b/build.xml deleted file mode 100644 index d58382b..0000000 --- a/build.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/jN.2015.sln b/jN.2015.sln deleted file mode 100644 index c109133..0000000 --- a/jN.2015.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Express 14 for Windows Desktop -VisualStudioVersion = 14.0.23107.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jN", "jN.vcxproj", "{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x64.ActiveCfg = Debug|Win32 - {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x86.ActiveCfg = Debug|Win32 - {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x86.Build.0 = Debug|Win32 - {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x64.ActiveCfg = Release|Win32 - {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x86.ActiveCfg = Release|Win32 - {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/jN.9.sln b/jN.sln similarity index 100% rename from jN.9.sln rename to jN.sln diff --git a/jN.vcproj b/jN.vcproj deleted file mode 100644 index 9fff1b5..0000000 --- a/jN.vcproj +++ /dev/null @@ -1,571 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jN.vcxproj b/jN.vcxproj index b1a34f3..14ee26e 100644 --- a/jN.vcxproj +++ b/jN.vcxproj @@ -22,6 +22,10 @@ {1590D7CD-7D3A-4AB7-A355-EE02F7FB987D} NppPluginTemplate Win32Proj + 0 + 0 + 0 + 0 @@ -238,7 +242,9 @@ - + + %(PreprocessorDefinitions);VERSION_MA=$(VersionMajor);VERSION_MI=$(VersionMinor);BUILD_NUMBER=$(BuildNumber);VERSION_REVISION=$(VersionRevision) + diff --git a/readme.txt b/readme.txt deleted file mode 100644 index 337c3af..0000000 --- a/readme.txt +++ /dev/null @@ -1 +0,0 @@ -******** Rebuild entire solution after every *.idl modifying!!! \ No newline at end of file diff --git a/res.rc b/res.rc index 5415afa..918ebff 100644 --- a/res.rc +++ b/res.rc @@ -7,12 +7,12 @@ STRINGTABLE BEGIN -1 "jN Plugin for Notepad++\n© Eugen Kremer, 2023\ngithub.com/sieukrem/jn-npp-plugin" +1 "jN Plugin for Notepad++\n© Eugen Kremer, 2024\ngithub.com/sieukrem/jn-npp-plugin" END 1 VERSIONINFO -FILEVERSION VERSION_MA,VERSION_MI,REVISION,10 -PRODUCTVERSION VERSION_MA,VERSION_MI,REVISION,10 +FILEVERSION VERSION_MA,VERSION_MI,BUILD_NUMBER,VERSION_REVISION +PRODUCTVERSION VERSION_MA,VERSION_MI,BUILD_NUMBER,VERSION_REVISION FILEOS 0x40004 FILETYPE 0x1 { @@ -21,10 +21,10 @@ BLOCK "StringFileInfo" BLOCK "040904b0" { VALUE "CompanyName", "Eugen Kremer" - VALUE "FileDescription", "jN Plugin for Notepad++ that allows you to automate certain Tasks with JavaScript" + VALUE "FileDescription", "jN Plugin for Notepad++ that allows you to automate tasks with JavaScript" VALUE "FileVersion", xstr(_VERSION_STR) VALUE "InternalName", "jN.dll" - VALUE "LegalCopyright", "Copyleft 2023 by Eugen Kremer" + VALUE "LegalCopyright", "Copyleft 2024 by Eugen Kremer" VALUE "OriginalFilename", "jN.dll" VALUE "ProductName", "jN" VALUE "ProductVersion", xstr(_VERSION_STR) diff --git a/version.json b/version.json new file mode 100644 index 0000000..fe7e7f0 --- /dev/null +++ b/version.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", + "version": "2.2", + "versionHeightOffset": 186, + "publicReleaseRefSpec": [ + "^refs/heads/master$", + "^refs/heads/main$", + "^master$", + "^main$" + ] +} \ No newline at end of file