plain framework 商业版 开发总结2 项目管理器

任何事情都有三个阶段,分析、制作、质检的过程。在程序中就分为设计、编码、调试(测试)三个阶段,其中设计最为重要,设计的不好会导致编码和调试重复,甚至最后又回到了设计的过程。为了不会重复返工,所以设计的时候需要考了全面,否则会导致资源上的浪费和占用,甚至造成资源不足而终止。就像任何一个投资项目一样,设计的不好,往往会导致人力资源的浪费,如果在项目进程中达不到预期的效果,这个项目生命周期就会缩短。

1、项目管理器设计

  为什么要使用到项目管理器?如果这点都不明确,那么这样的功能需求是无效的,也就是说不需要这样的功能。编译的功能,以前在编译的时候如果换了一个平台或者VS的版本,就需要重写编译脚本。其实现在的CMAKE已经具备这样的跨平台功能,可惜不能完全满足PF项目的需求。所以需要使用项目管理器的一个功能就是生成不同平台的编译脚本,这样项目管理器就是一个有效的需求了。其次大部分开源或是商业框架都使用到了自身的命令行或者管理器,如著名的虚幻引擎,也有自己的项目管理器。故而项目管理器,也是势在必行的。

  项目管理器现在的主要功能是对现有的项目自动生成对应平台的编译脚本,Windows下面现在实现的是VC12的脚本,LINUX实现的是CMAKE脚本。

  以下是原型:

# This file generate by plain framework admin tool, date: 2015-05-07 19:42:16
SET(EXECUTABLE_OUTPUT_PATH ../../bin)

ADD_DEFINITIONS(-DPF_BUILD_AS_DLL)
ADD_DEFINITIONS(-D_DATABASE)
ADD_DEFINITIONS(-D__SERVER__)
SET(USE_32BITS 0)

IF(CMAKE_SYSTEM MATCHES Linux)
  ADD_DEFINITIONS(-D_REENTRANT)
  ADD_DEFINITIONS(-DDONT_TD_VOID)
  ADD_DEFINITIONS(-D_PF_NET_EPOLL)
ELSE(CMAKE_SYSTEM MATCHES Linux)
ENDIF(CMAKE_SYSTEM MATCHES Linux)

LINK_DIRECTORIES(
  "./"
  "./../../../pf/core/dll/"
  "./../../../pf/dependencies/dll/"
)

INCLUDE_DIRECTORIES(
  "../../../pf/core/include/"
  "../include/"
  "../../common/include/"
  "../../../pf/dependencies/lua/src/"
  "/usr/local/unixODBC/include/"
)

SET (COMMON_INCLUDE_COMMON_LIST
  ../../common/include/common/config.h
)

SET (COMMON_INCLUDE_COMMON_DEFINE_LIST
  ../../common/include/common/define/all.h
  ../../common/include/common/define/config.h
  ../../common/include/common/define/enum.h
  ../../common/include/common/define/file.h
  ../../common/include/common/define/log.h
  ../../common/include/common/define/macros.h
  ../../common/include/common/define/struct.h
)

SET (COMMON_INCLUDE_COMMON_DEFINE_NET_LIST
  ../../common/include/common/define/net/config.h
)

SET (COMMON_INCLUDE_COMMON_DEFINE_NET_PACKET_LIST
  ../../common/include/common/define/net/packet/config.h
)

SET (COMMON_INCLUDE_COMMON_DEFINE_NET_PACKET_ID_LIST
  ../../common/include/common/define/net/packet/id/all.h
  ../../common/include/common/define/net/packet/id/billinglogin.h
  ../../common/include/common/define/net/packet/id/clientlogin.h
  ../../common/include/common/define/net/packet/id/clientserver.h
  ../../common/include/common/define/net/packet/id/config.h
  ../../common/include/common/define/net/packet/id/logincenter.h
  ../../common/include/common/define/net/packet/id/servercenter.h
  ../../common/include/common/define/net/packet/id/serverserver.h
)

SET (COMMON_INCLUDE_COMMON_NET_LIST
  ../../common/include/common/net/config.h
  ../../common/include/common/net/packetfactory.h
)

SET (COMMON_INCLUDE_COMMON_NET_PACKET_LIST
  ../../common/include/common/net/packet/config.h
)

SET (COMMON_INCLUDE_COMMON_NET_PACKET_SERVERSERVER_LIST
  ../../common/include/common/net/packet/serverserver/config.h
  ../../common/include/common/net/packet/serverserver/connect.h
  ../../common/include/common/net/packet/serverserver/dbquery.h
  ../../common/include/common/net/packet/serverserver/dbresult.h
  ../../common/include/common/net/packet/serverserver/config.h
  ../../common/include/common/net/packet/serverserver/connect.h
  ../../common/include/common/net/packet/serverserver/dbquery.h
  ../../common/include/common/net/packet/serverserver/dbresult.h
)
SET (INCLUDE_LIST
  ../include/main.h
)

SET (INCLUDE_APPLICATION_LIST
  ../include/application/config.h
)

SET (INCLUDE_ENGINE_LIST
  ../include/engine/config.h
  ../include/engine/system.h
)

SET (INCLUDE_THREAD_LIST
  ../include/thread/archive.h
  ../include/thread/archivemanager.h
  ../include/thread/config.h
)
SET (COMMON_SRC_DEFINE_LIST
  ../../common/src/define/struct.cc
)

SET (COMMON_SRC_LIST
  ../../common/src/setting.cc
)

SET (COMMON_SRC_NET_PACKET_SERVERSERVER_LIST
  ../../common/src/net/packet/serverserver/connect.cc
  ../../common/src/net/packet/serverserver/dbquery.cc
  ../../common/src/net/packet/serverserver/dbresult.cc
  ../../common/src/net/packet/serverserver/connect.cc
  ../../common/src/net/packet/serverserver/dbquery.cc
  ../../common/src/net/packet/serverserver/dbresult.cc
)

SET (COMMON_SRC_NET_LIST
  ../../common/src/net/packetfactory.cc
)
SET (SRC_LIST
  ../src/main.cc
)

SET (SRC_ENGINE_LIST
  ../src/engine/system.cc
)

SET (SRC_MESSAGE_HANDLER_SERVERSERVER_LIST
  ../src/message/handler/serverserver/connect.cc
  ../src/message/handler/serverserver/dbquery.cc
)

SET (SRC_THREAD_LIST
  ../src/thread/archive.cc
  ../src/thread/archivemanager.cc
)

ADD_EXECUTABLE(database
  ${SRC_LIST}
  ${SRC_ENGINE_LIST}
  ${SRC_MESSAGE_HANDLER_SERVERSERVER_LIST}
  ${SRC_THREAD_LIST}
  ${COMMON_SRC_DEFINE_LIST}
  ${COMMON_SRC_LIST}
  ${COMMON_SRC_NET_PACKET_SERVERSERVER_LIST}
  ${COMMON_SRC_NET_LIST}
)

if(USE_32BITS)
  SET(CMAKE_C_FLAGS "-Wall -ggdb -pipe -march=i386 -mtune=i686")
  SET(CMAKE_CXX_FLAGS "-Wall -ggdb -pipe -march=i386 -mtune=i686")
else()
  SET(CMAKE_C_FLAGS "-Wall -ggdb -pipe -march=x86-64 -mtune=i686")
  SET(CMAKE_CXX_FLAGS "-Wall -ggdb -pipe -march=x86-64 -mtune=i686")
endif(USE_32BITS)

if (WIN32)
TARGET_LINK_LIBRARIES(database ws2_32.lib odbc32.lib odbccp32.lib pf_core.lib lua.lib iconv.lib)
else()
TARGET_LINK_LIBRARIES(database odbc pf_core lua iconv)
  if(USE_32BITS)
    SET(CMAKE_C_FLAGS "-Wall -ggdb -pipe -march=i386 -mtune=i686")
    SET(CMAKE_CXX_FLAGS "-Wall -ggdb -pipe -march=i386 -mtune=i686")
  else()
    SET(CMAKE_C_FLAGS "-Wall -ggdb -pipe -march=x86-64 -mtune=i686")
    SET(CMAKE_CXX_FLAGS "-Wall -ggdb -pipe -march=x86-64 -mtune=i686")
  endif(USE_32BITS)
endif(WIN32)
<?xml version="1.0" encoding="utf-8"?>
<!-- This file generate by plain framework admin tool, date: 2015-05-07 21:21:36 -->
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>

  <ItemGroup>
    <ClCompile Include="..\..\common\include\common\config.h" />
    <ClCompile Include="..\..\common\include\common\define\all.h" />
    <ClCompile Include="..\..\common\include\common\define\config.h" />
    <ClCompile Include="..\..\common\include\common\define\enum.h" />
    <ClCompile Include="..\..\common\include\common\define\file.h" />
    <ClCompile Include="..\..\common\include\common\define\log.h" />
    <ClCompile Include="..\..\common\include\common\define\macros.h" />
    <ClCompile Include="..\..\common\include\common\define\struct.h" />
    <ClCompile Include="..\..\common\include\common\define\net\config.h" />
    <ClCompile Include="..\..\common\include\common\define\net\packet\config.h" />
    <ClCompile Include="..\..\common\include\common\define\net\packet\id\all.h" />
    <ClCompile Include="..\..\common\include\common\define\net\packet\id\billinglogin.h" />
    <ClCompile Include="..\..\common\include\common\define\net\packet\id\clientlogin.h" />
    <ClCompile Include="..\..\common\include\common\define\net\packet\id\clientserver.h" />
    <ClCompile Include="..\..\common\include\common\define\net\packet\id\config.h" />
    <ClCompile Include="..\..\common\include\common\define\net\packet\id\logincenter.h" />
    <ClCompile Include="..\..\common\include\common\define\net\packet\id\servercenter.h" />
    <ClCompile Include="..\..\common\include\common\define\net\packet\id\serverserver.h" />
    <ClCompile Include="..\..\common\include\common\net\config.h" />
    <ClCompile Include="..\..\common\include\common\net\packetfactory.h" />
    <ClCompile Include="..\..\common\include\common\net\packet\config.h" />
    <ClCompile Include="..\..\common\include\common\net\packet\serverserver\config.h" />
    <ClCompile Include="..\..\common\include\common\net\packet\serverserver\connect.h" />
    <ClCompile Include="..\..\common\include\common\net\packet\serverserver\dbquery.h" />
    <ClCompile Include="..\..\common\include\common\net\packet\serverserver\dbresult.h" />
    <ClCompile Include="..\..\common\include\common\net\packet\serverserver\config.h" />
    <ClCompile Include="..\..\common\include\common\net\packet\serverserver\connect.h" />
    <ClCompile Include="..\..\common\include\common\net\packet\serverserver\dbquery.h" />
    <ClCompile Include="..\..\common\include\common\net\packet\serverserver\dbresult.h" />
    <ClInclude Include="..\include\main.h" />
    <ClInclude Include="..\include\application\config.h" />
    <ClInclude Include="..\include\engine\config.h" />
    <ClInclude Include="..\include\engine\system.h" />
    <ClInclude Include="..\include\thread\archive.h" />
    <ClInclude Include="..\include\thread\archivemanager.h" />
    <ClInclude Include="..\include\thread\config.h" />
    <ClInclude Include="resource.h" />
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="..\..\common\src\define\applications_common_define_struct.cc" />
    <ClCompile Include="..\..\common\src\applications_common_src_setting.cc" />
    <ClCompile Include="..\..\common\src\net\packet\serverserver\applications_common_net_packet_serverserver_connect.cc" />
    <ClCompile Include="..\..\common\src\net\packet\serverserver\applications_common_net_packet_serverserver_dbquery.cc" />
    <ClCompile Include="..\..\common\src\net\packet\serverserver\applications_common_net_packet_serverserver_dbresult.cc" />
    <ClCompile Include="..\..\common\src\net\packet\serverserver\applications_common_net_packet_serverserver_connect.cc" />
    <ClCompile Include="..\..\common\src\net\packet\serverserver\applications_common_net_packet_serverserver_dbquery.cc" />
    <ClCompile Include="..\..\common\src\net\packet\serverserver\applications_common_net_packet_serverserver_dbresult.cc" />
    <ClCompile Include="..\..\common\src\net\applications_common_net_packetfactory.cc" />
    <ClCompile Include="..\src\applications_database_src_main.cc" />
    <ClCompile Include="..\src\engine\applications_database_engine_system.cc" />
    <ClCompile Include="..\src\thread\applications_database_thread_archive.cc" />
    <ClCompile Include="..\src\thread\applications_database_thread_archivemanager.cc" />
    <ClCompile Include="..\src\message\handler\serverserver\applications_database_message_handler_serverserver_connect.cc" />
    <ClCompile Include="..\src\message\handler\serverserver\applications_database_message_handler_serverserver_dbquery.cc" />
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="database.rc" />
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{88F6D0EC-8597-40CE-9BA5-6A2813C82C3A}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
    <RootNamespace>${project_name}</RootNamespace>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="‘$(Configuration)|$(Platform)‘==‘Debug|Win32‘" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v120</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="‘$(Configuration)|$(Platform)‘==‘Debug|x64‘" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v120</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="‘$(Configuration)|$(Platform)‘==‘Release|Win32‘" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v120</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="‘$(Configuration)|$(Platform)‘==‘Release|x64‘" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v120</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="‘$(Configuration)|$(Platform)‘==‘Debug|Win32‘">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists(‘$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props‘)" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Condition="‘$(Configuration)|$(Platform)‘==‘Debug|x64‘" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists(‘$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props‘)" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="‘$(Configuration)|$(Platform)‘==‘Release|Win32‘">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists(‘$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props‘)" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Condition="‘$(Configuration)|$(Platform)‘==‘Release|x64‘" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists(‘$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props‘)" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup Condition="‘$(Configuration)|$(Platform)‘==‘Debug|Win32‘">
    <LinkIncremental>true</LinkIncremental>
    <OutDir>./../bin/$(PlatformName)/$(Configuration)/</OutDir>
    <IntDir>$(ProjectName).dir/$(PlatformName)/$(Configuration)/</IntDir>
  </PropertyGroup>
  <PropertyGroup Condition="‘$(Configuration)|$(Platform)‘==‘Debug|x64‘">
    <LinkIncremental>true</LinkIncremental>
    <OutDir>./../bin/$(PlatformName)/$(Configuration)/</OutDir>
    <IntDir>$(ProjectName).dir/$(PlatformName)/$(Configuration)/</IntDir>
  </PropertyGroup>
  <PropertyGroup Condition="‘$(Configuration)|$(Platform)‘==‘Release|Win32‘">
    <LinkIncremental>false</LinkIncremental>
    <OutDir>./../bin/$(PlatformName)/$(Configuration)/</OutDir>
    <IntDir>$(ProjectName).dir/$(PlatformName)/$(Configuration)/</IntDir>
  </PropertyGroup>
  <PropertyGroup Condition="‘$(Configuration)|$(Platform)‘==‘Release|x64‘">
    <LinkIncremental>false</LinkIncremental>
    <OutDir>./../bin/$(PlatformName)/$(Configuration)/</OutDir>
    <IntDir>$(ProjectName).dir/$(PlatformName)/$(Configuration)/</IntDir>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="‘$(Configuration)|$(Platform)‘==‘Debug|Win32‘">
    <ClCompile>
      <PrecompiledHeader>NotUsing</PrecompiledHeader>
      <WarningLevel>Level4</WarningLevel>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;PF_BUILD_AS_DLL;_DATABASE;__SERVER__;PF_BUILD_AS_DLL;ICONV_BUILD_AS_DLL;CHARSET_BUILD_AS_DLL;LUA_BUILD_AS_DLL;ZLIB_DLL;PF_PLUGIN_BUILD_AS_DLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <SDLCheck>true</SDLCheck>
      <AdditionalIncludeDirectories>../../../pf/core/include/;../include/;../../common/include/;../../../pf/dependencies/lua/src/;/usr/local/unixODBC/include/;</AdditionalIncludeDirectories>
      <DisableSpecificWarnings>4819;</DisableSpecificWarnings>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
       <Version>1.00</Version>
      <AdditionalLibraryDirectories>./$(PlatformName)/$(Configuration)/;./../../../pf/core/dll/$(PlatformName)/$(Configuration)/;./../../../pf/dependencies/dll/$(PlatformName)/$(Configuration)/;</AdditionalLibraryDirectories>
      <AdditionalDependencies>ws2_32.lib;pf_core.lib;lua.lib;iconv.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="‘$(Configuration)|$(Platform)‘==‘Debug|x64‘">
    <ClCompile>
      <PrecompiledHeader>NotUsing</PrecompiledHeader>
      <WarningLevel>Level4</WarningLevel>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;PF_BUILD_AS_DLL;_DATABASE;__SERVER__;PF_BUILD_AS_DLL;ICONV_BUILD_AS_DLL;CHARSET_BUILD_AS_DLL;LUA_BUILD_AS_DLL;ZLIB_DLL;PF_PLUGIN_BUILD_AS_DLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <SDLCheck>true</SDLCheck>
      <AdditionalIncludeDirectories>../../../pf/core/include/;../include/;../../common/include/;../../../pf/dependencies/lua/src/;/usr/local/unixODBC/include/;</AdditionalIncludeDirectories>
      <DisableSpecificWarnings>4819;</DisableSpecificWarnings>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
       <Version>1.00</Version>
      <AdditionalLibraryDirectories>./$(PlatformName)/$(Configuration)/;./../../../pf/core/dll/$(PlatformName)/$(Configuration)/;./../../../pf/dependencies/dll/$(PlatformName)/$(Configuration)/;</AdditionalLibraryDirectories>
      <AdditionalDependencies>ws2_32.lib;pf_core.lib;lua.lib;iconv.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="‘$(Configuration)|$(Platform)‘==‘Release|Win32‘">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <PrecompiledHeader>NotUsing</PrecompiledHeader>
      <Optimization>MaxSpeed</Optimization>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;PF_BUILD_AS_DLL;_DATABASE;__SERVER__;PF_BUILD_AS_DLL;ICONV_BUILD_AS_DLL;CHARSET_BUILD_AS_DLL;LUA_BUILD_AS_DLL;ZLIB_DLL;PF_PLUGIN_BUILD_AS_DLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <SDLCheck>true</SDLCheck>
      <AdditionalIncludeDirectories>../../../pf/core/include/;../include/;../../common/include/;../../../pf/dependencies/lua/src/;/usr/local/unixODBC/include/;</AdditionalIncludeDirectories>
      <DisableSpecificWarnings>4819;</DisableSpecificWarnings>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
       <Version>1.00</Version>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <OptimizeReferences>true</OptimizeReferences>
      <AdditionalLibraryDirectories>./$(PlatformName)/$(Configuration)/;./../../../pf/core/dll/$(PlatformName)/$(Configuration)/;./../../../pf/dependencies/dll/$(PlatformName)/$(Configuration)/;</AdditionalLibraryDirectories>
      <AdditionalDependencies>ws2_32.lib;pf_core.lib;lua.lib;iconv.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="‘$(Configuration)|$(Platform)‘==‘Release|x64‘">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <PrecompiledHeader>NotUsing</PrecompiledHeader>
      <Optimization>MaxSpeed</Optimization>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;PF_BUILD_AS_DLL;_DATABASE;__SERVER__;PF_BUILD_AS_DLL;ICONV_BUILD_AS_DLL;CHARSET_BUILD_AS_DLL;LUA_BUILD_AS_DLL;ZLIB_DLL;PF_PLUGIN_BUILD_AS_DLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <SDLCheck>true</SDLCheck>
      <AdditionalIncludeDirectories>../../../pf/core/include/;../include/;../../common/include/;../../../pf/dependencies/lua/src/;/usr/local/unixODBC/include/;</AdditionalIncludeDirectories>
      <DisableSpecificWarnings>4819;</DisableSpecificWarnings>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
       <Version>1.00</Version>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <OptimizeReferences>true</OptimizeReferences>
      <AdditionalLibraryDirectories>./$(PlatformName)/$(Configuration)/;./../../../pf/core/dll/$(PlatformName)/$(Configuration)/;./../../../pf/dependencies/dll/$(PlatformName)/$(Configuration)/;</AdditionalLibraryDirectories>
      <AdditionalDependencies>ws2_32.lib;pf_core.lib;lua.lib;iconv.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>

  功能需求很明确,就是要怎样生成这两种脚本。要生成这两种脚本,必要的就是这两种文件的结构。要写一个CMAKE其实不太难,而VS脚本直接用VS编辑器生成即可。但是我们现在知道的是源码所在的目录,或者一些散乱的源码文件,那么怎样生成这两种文件?

  要生成文件,我们就要知道文件的内容是怎样的,其组成又是怎样的。本次是以CMAKE2.6和VS2013作为基础,那么我们就看下这两种编译脚本的结构是怎么样的吧。

  分析不同平台的异同,于是我将之总结为以下字段,形成项目管理的基本文件。

/**
  Plain framework project file.
  Version:              The project current version.
  Type:                 Project type [library|executable].
  LinkDirectories:      Link directories as the Dependencies directories.
  IncludeDirectories:   Include directories.
  ExtraSources:         Extra source file or directories.
  SourceFilters:        Source directory or filename filter(not active).
  OutputPath:           The project output path.
  Definitions:          Macros definitions.
  Dependencies:         Dependencies library.
**/
{
  "Version": "1.0.1",
  "Type": "executable",
  "LinkDirectories": [
    "./",
    "./../../../pf/core/dll",
    "./../../../pf/dependencies/dll"
  ],
  "IncludeDirectories": [
    "../../../pf/core/include",
    "../include",
    "../../common/include",
    "../../../pf/dependencies/lua/src",
    "/usr/local/unixODBC/include"
  ],
  "ExtraSources": [
   /* static common settings { */
    "../common/include/common/config.h",
    "../common/include/common/define/",
    "../common/include/common/net/config.h",
    "../common/include/common/net/packet/config.h",
    "../common/include/common/net/packetfactory.h",
    "../common/include/common/net/packet/serverserver",
    "../common/src/define",
    "../common/src/setting.cc",
    "../common/src/net/packet/serverserver/",
    "../common/src/net/packetfactory.cc"  /* static common settings } */

    /* projcet only { */
    /* } projcet only */

  ],
  "SourceFilters": [
    "CMakeFiles"
  ],
  "DisableSpecificWarnings": "4819;",
  "OutputPath": "../../bin",
  "Definitions": [
    "PF_BUILD_AS_DLL",
    "_DATABASE",
    "__SERVER__"
  ],
  "Dependencies": [
    "pf_core",
    "lua",
    "iconv"
  ]

2、项目管理器编码

  有很多的数据不需要我们改变,此时联想到的就是模板。到了这里,很多人可能不明白模板是什么。我就简单用一句话概括,模板是生产通用的模型。可能这句话难以理解,不过可以自己查找一下,如C++中的模板、PHP等脚本框架中的smart模板等等。

  模板就是要把固定和可变的部分分离出来,固定的部分我们直接放在模板中不用动,可变的部分我们用一种叫模板变量的东西关联起来。那么在使用过程中,模板变量又是如何操作的?简言之,模板变量就是值替换的过程。

  项目管理基本文件中的配置,就有这些模板变量,在编码的时候我们就需要考虑怎样将这些变量替换到模板中。其中比较复杂的就是文件列表,这部分可以自己找寻一些目录遍历。

  CMAKE模板:

# This file generate by plain framework admin tool, date: ${time}
${outputpath}
${definitions}
${basebit}

IF(CMAKE_SYSTEM MATCHES Linux)
  ADD_DEFINITIONS(-D_REENTRANT)
  ADD_DEFINITIONS(-DDONT_TD_VOID)
  ADD_DEFINITIONS(-D_PF_NET_EPOLL)
ELSE(CMAKE_SYSTEM MATCHES Linux)
ENDIF(CMAKE_SYSTEM MATCHES Linux)

LINK_DIRECTORIES(
${link_directories}
)

INCLUDE_DIRECTORIES(
${include_directories}
)

${sources_list}

${type_auto}
${sources_group_list}
)

if(USE_32BITS)
  SET(CMAKE_C_FLAGS "-Wall -ggdb -pipe -march=i386 -mtune=i686")
  SET(CMAKE_CXX_FLAGS "-Wall -ggdb -pipe -march=i386 -mtune=i686")
else()
  SET(CMAKE_C_FLAGS "-Wall -ggdb -pipe -march=x86-64 -mtune=i686")
  SET(CMAKE_CXX_FLAGS "-Wall -ggdb -pipe -march=x86-64 -mtune=i686")
endif(USE_32BITS)

if (WIN32)
TARGET_LINK_LIBRARIES(${project_name} ws2_32.lib ${odbc_dependencies_w} ${dependencies_w})
else()
TARGET_LINK_LIBRARIES(${project_name} ${odbc_dependencies} ${dependencies})
  if(USE_32BITS)
    SET(CMAKE_C_FLAGS "-Wall -ggdb -pipe -march=i386 -mtune=i686")
    SET(CMAKE_CXX_FLAGS "-Wall -ggdb -pipe -march=i386 -mtune=i686")
  else()
    SET(CMAKE_C_FLAGS "-Wall -ggdb -pipe -march=x86-64 -mtune=i686")
    SET(CMAKE_CXX_FLAGS "-Wall -ggdb -pipe -march=x86-64 -mtune=i686")
  endif(USE_32BITS)
endif(WIN32)

3、项目管理器调试

  首先生成的脚本在LINUX上使用CMAKE运行,其次再使用VS打开编译脚本进行编译。如果编译通过,那么初次测试就算通过了。

时间: 2024-10-07 19:29:52

plain framework 商业版 开发总结2 项目管理器的相关文章

plain framework 商业版 开发总结1

计划表 每日都在计划表中纠结,一步步辛酸,一步步艰难的前行. CODE 部分商业核心代码,暂时不予开源. #include "pf/base/string.h" #include "pf/base/log.h" #include "pf/base/time_manager.h" #include "pf/net/packet/factorymanager.h" #include "pf/sys/thread.h&qu

程序设计模式浅析(plain framework商业版设计模式)

程序设计其实对程序开发者来说十分重要,但是在工作中往往我们却忽略了这一块,因为我们所用的都是现有的模式.一个设计模式的好坏,往往能够体现出程序的专业性,还有整个项目的可持续性.这就是为什么有些公司,在经历了若干年后忽然重写整套代码的原因,因为他们会发现在越来越多的需求的情况下,以前那些设计模式完全不能满足了,或者说程序的复杂度和维护成本实在太高.最近我又看到了一个公司的项目设计,文档中写的还算优秀,可是整体的框架设计总觉得还有差强人意.那么我们又该怎样来设计我们的程序,怎么减少维护代码的成本,怎

plain framework 1 1.0.4 更新 稳定版发布

PF由于各种因素迟迟不能更新,此次更新主要是更新了以往和上个版本出现的内存问题,该版本较为稳定,如果有用到的朋友请更新至此版本. PF 1.0.4 修复1.0.0.3更新后产生的内存问题,可能导致网络数据错误 全面修复PF核心的内存问题 优化部分代码风格 PF商业版核心人员招募 开篇语 我们没有大神,只有解决问题的人. 我们没有强悍的技术,只有一颗向往简单的心. 我们没有惊人的理论,只有一堆不可思议的妄想. 我们不需要复杂,只需要够简洁. 我们不需要固定的思维,只需要你能想得到. 核心成员资格需

plain framework 1(简约框架)一款主要用于网络(游戏)开发的C/C++框架 即将开源发布

在我们的日常开发中,我们往往会遇到这种情况,当我们换了一个开发环境时很可能会重新利用一套新的框架进行开发.由于不同框架有着不同的接口,所以我们不得不花时间再次熟悉这些接口,这将造成开发时间上的重复,而对于一个程序来说又经历了一段重复造轮子的过程.在游戏开发领域,我介入的时间并不太长,大约三年时间.抱着对于游戏的热爱和激情,在这几年时间里也是一个苦苦摸索的过程.我们国人有着这么一个通病,那就是所谓的“闭关自守”,我发现有些开发者是拥有了一套代码之后便利用这套代码可以玩转整个游戏界.我能了解这些朋友

plain framework 1 一款主要用于网络(游戏)开发的C/C++框架 安装篇

上次介绍了一下plain framework的基础相关资料,今天该框架正式开源发布.项目的地址托管于github上,我相信大多数朋友都应该知道.今天要介绍的是该框架的目录基本结构,以及分别在linux以及windows平台上安装的例子.为了让初学或者技术不是太扎实的朋友也能快速上手,我在这里一步步从开发环境的搭建讲述到第一个比较完整的示例(网关服务器),每一步都是今日从空白的系统开始及时操作,由简入深,如果大家不太明白请到交流群询问.(新的系统centos7.0及以上我的脚本暂时无法通过环境安装

plain framework 1 网络流 缓存数据详解

网络流是什么?为什么网络流中需要存在缓存数据?为什么PF中要采用缓存网络数据的机制?带着这几个疑问,让我们好好详细的了解一下在网络数据交互中我们容易忽视以及薄弱的一块.该部分为PF现有的网络流模型,但是在这里只讲解最本质的概念,而没有详细说明代码,如果有兴趣的不妨先看了这部分再去看下代码,一切或许会豁然开朗. 网络流 如果你不知道计算机中流数据模型的定义,那么你就可以试想一下河流,有着固定起点和终点的河流.将流水从某一个地方送向另一个地方的通道,我们现实中一般叫做渠道,这种渠道在计算机之间就是网

plain framework 1 1.0.3更新 优化编译部分、网络压缩和加密

有些东西总是姗姗来迟,就好比这新年的钟声,我们盼望着新年同时也不太旧的一年过去.每当这个时候,我们都会总结一下在过去的一年中我们收获了什么,再计划新的一年我们要实现什么.PF并不是一个十分优秀的框架,可以说这只是出于作者们对自己技术的总结.本次版本比我计划的要晚,一方面是因为新年的原因,另一方面又是工作的原因,诚然这些都只不过是为推卸责任的借口,而这责任却是对自己的.再多的话语,只能留待来年,本次更新比较匆忙,希望有用到的朋友可以反馈BUG到issue上,让我能及时跟进.同时祝大家在新的一年:幸

技术开发团队的项目管理工具

前言 小型技术研发团队,往往开发流程比较简单:整理需求/bug.分配任务到个人.完成指定任务.验收.涉及到的相关管理工具主要是:项目/任务管理系统.源代码管理系统. 项目管理系统 从09年开始,我用过ActiveCollab做项目管理工具:后面12年开始使用禅道. AC从0.7以后的版本转向商业,但毫无疑问,这套系统给人一种优雅的感觉:而禅道,本身功能非常强大,一看就是一个工具,只是稍微缺少一点那种文艺范. 其实,日常生活中,个人还在尝试使用很多新兴的任务管理平台,像 Tower.TeamBit

atitit.商业版 源码保护 与 java本地原生代码转换 的方案总结

atitit.商业版 源码保护 与 java本地原生代码转换 的方案总结 1. 为什么虚拟机语言容易被反编译 1 2. 源码泄露的问题问题 1 3. Excelsior JET 1 4. gcj.的流程 2 5. classloader方案,,还凑后 2 6. 制作伪exe,其实和上一种做法是一样的,只不过做成exe,调用系统的java.exe来运行它,这样的工具有nativeJ,exe4j等 3 7. 其他 3 1. 为什么虚拟机语言容易被反编译 ,但虚拟机的中间语言由于带了大量的"元数据&q