Skip to content

Commit

Permalink
增加自动添加版本宏的功能,不需要用户再手动添加
Browse files Browse the repository at this point in the history
  • Loading branch information
songbaoming committed Feb 3, 2018
1 parent 135a11c commit a5b483f
Show file tree
Hide file tree
Showing 8 changed files with 283 additions and 157 deletions.
16 changes: 7 additions & 9 deletions IncBuildVer/IncBuildVer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "stdafx.h"
#include "Shellapi.h"
#include "IncBuildVer.h"
#include "VerFile.h"
#include "VersionManager.h"



Expand All @@ -24,15 +24,13 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
// 获取命令行参数数量
int nArgc;
LPWSTR *ppArgv = CommandLineToArgvW(GetCommandLine(), &nArgc);
do{
// 判断命令行参数数量是否大于等于3
if (nArgc < 3)
break;


// 判断命令行参数数量是否大于1
if (nArgc > 1) {
// 对编译版本号加一
CVerFile file;
file.IncBuildVer(ppArgv[2]);
} while (false);
CVersionManager manager;
manager.IncBuildVer(ppArgv[1]);
}

LocalFree(ppArgv);
return 0;
Expand Down
4 changes: 2 additions & 2 deletions IncBuildVer/IncBuildVer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<ClInclude Include="Resource.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="VerFile.h" />
<ClInclude Include="VersionManager.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="IncBuildVer.cpp" />
Expand All @@ -164,7 +164,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="VerFile.cpp" />
<ClCompile Include="VersionManager.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="IncBuildVer.rc" />
Expand Down
122 changes: 61 additions & 61 deletions IncBuildVer/IncBuildVer.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="IncBuildVer.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="VerFile.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="IncBuildVer.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="VerFile.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="IncBuildVer.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="small.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="IncBuildVer.ico">
<Filter>资源文件</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<None Include="..\ReadMe.md" />
<None Include="..\LICENSE" />
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="IncBuildVer.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="VersionManager.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="IncBuildVer.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="VersionManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="IncBuildVer.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="small.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="IncBuildVer.ico">
<Filter>资源文件</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<None Include="..\ReadMe.md" />
<None Include="..\LICENSE" />
</ItemGroup>
</Project>
Loading

0 comments on commit a5b483f

Please sign in to comment.