Skip to content

Commit

Permalink
Explicit version elements
Browse files Browse the repository at this point in the history
  • Loading branch information
sieukrem committed Oct 3, 2024
1 parent 2b5bfba commit 46dd1c3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- name: Build with MSBuild
run: |
msbuild jN.vcxproj /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:VersionDefinitions="VERSION_MA=${{steps.nbgv.outputs.VersionMajor}}3 VERSION_MI=${{steps.nbgv.outputs.VersionMinor}} REVISION=${{steps.nbgv.outputs.BuildNumber}} VERSION_REVISION=${{steps.nbgv.outputs.VersionRevision}}"
msbuild jN.vcxproj /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:VersionMajor=${{steps.nbgv.outputs.VersionMajor}} /p:VersionMinor=${{steps.nbgv.outputs.VersionMinor}} /p:BuildNumberF=${{steps.nbgv.outputs.BuildNumber}} /p:VersionRevision=${{steps.nbgv.outputs.VersionRevision}}"
- name: Create zip file
run: |
Expand Down
8 changes: 4 additions & 4 deletions VersionInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VERSION_MI 2
#endif

#ifndef REVISION
// increment revision in case of modification
#define REVISION 185
#ifndef BUILD_NUMBER
// increment BUILD_NUMBER in case of modification
#define BUILD_NUMBER 185
#endif

#ifndef VERSION_REVISION
Expand All @@ -35,5 +35,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#define xstr(s) str(s)
#define str(s) #s
#define _VERSION_STR VERSION_MA ## . ## VERSION_MI ## . ## REVISION
#define _VERSION_STR VERSION_MA ## . ## VERSION_MI ## . ## BUILD_NUMBER ## . ## VERSION_REVISION

15 changes: 9 additions & 6 deletions jN.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
<ProjectGuid>{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}</ProjectGuid>
<RootNamespace>NppPluginTemplate</RootNamespace>
<Keyword>Win32Proj</Keyword>
<VersionDefinitions2>$(VersionDefinitions.replace(' ',';'))</VersionDefinitions2>
<VersionMajor>0</VersionMajor>
<VersionMinor>0</VersionMinor>
<BuildNumber>0</BuildNumber>
<VersionRevision>0</VersionRevision>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
Expand Down Expand Up @@ -68,7 +71,7 @@
<Optimization>MaxSpeed</Optimization>
<WholeProgramOptimization>true</WholeProgramOptimization>
<AdditionalIncludeDirectories>.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;_USRDLL;NPPPLUGINTEMPLATE_EXPORTS;UNICODE;%(PreprocessorDefinitions);$(VersionDefinitions2)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WINDOWS;_USRDLL;NPPPLUGINTEMPLATE_EXPORTS;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader />
Expand Down Expand Up @@ -106,7 +109,7 @@
<Optimization>MaxSpeed</Optimization>
<WholeProgramOptimization>true</WholeProgramOptimization>
<AdditionalIncludeDirectories>.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;_USRDLL;NPPPLUGINTEMPLATE_EXPORTS;UNICODE;%(PreprocessorDefinitions);$(VersionDefinitions2)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WINDOWS;_USRDLL;NPPPLUGINTEMPLATE_EXPORTS;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
Expand Down Expand Up @@ -143,7 +146,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NPPPLUGINTEMPLATE_EXPORTS;UNICODE;%(PreprocessorDefinitions);$(VersionDefinitions2)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NPPPLUGINTEMPLATE_EXPORTS;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
Expand Down Expand Up @@ -179,7 +182,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NPPPLUGINTEMPLATE_EXPORTS;UNICODE;%(PreprocessorDefinitions);$(VersionDefinitions2)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NPPPLUGINTEMPLATE_EXPORTS;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
Expand Down Expand Up @@ -240,7 +243,7 @@
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res.rc">
<PreprocessorDefinitions>%(PreprocessorDefinitions);$(VersionDefinitions2)</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);VERSION_MA=$(VersionMajor);VERSION_MI=$(VersionMinor);BUILD_NUMBER=$(BuildNumber);VERSION_REVISION=$(VersionRevision)</PreprocessorDefinitions>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions res.rc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ BEGIN
END

1 VERSIONINFO
FILEVERSION VERSION_MA,VERSION_MI,REVISION,VERSION_REVISION
PRODUCTVERSION VERSION_MA,VERSION_MI,REVISION,VERSION_REVISION
FILEVERSION VERSION_MA,VERSION_MI,BUILD_NUMBER,VERSION_REVISION
PRODUCTVERSION VERSION_MA,VERSION_MI,BUILD_NUMBER,VERSION_REVISION
FILEOS 0x40004
FILETYPE 0x1
{
Expand Down

0 comments on commit 46dd1c3

Please sign in to comment.