zoukankan      html  css  js  c++  java
  • Delphi 项目 结构 文件夹 组织

    Delphi Project Structure Folder Organization

    http://delphi.about.com/od/delphitips2008/qt/project_layout.htm

    I've been developing in Delphi for the past 10+ years (from Delphi 1). Every version brings some new features - new controls, new build options, new IDE features.

    One question I always ask myself when starting a new Delphi program - a project with two or more applications - is how to best layout all the Delphi files one project is made of? Source code files (PAS) and DFM files (Delphi forms) should go into a source control system. Executable (EXE) should be placed into a separate folder. Third party tools (units) should have their own folders. If I have BPLs or DLLs they also should have their own folder. Resources should be also separated.

     

    Delphi Project Structure Folder Organisation - Best Practice?

    Since with Delphi you can have more than one project in a project group - and each project can have its own set of options where to store various project related files and since I am using source control - here's what my current best practice in Delphi project layout is:

    并且,我正在使用 源代码控制系统。

    Project Group Folder 
    -Common //code used by all project in the group
    --DCU
    -----Debug
    -----Release
    --Source*
    -----Database
    -----GUI
    -----Other -Project 1 Folder
    ---Bin
    -----Debug
    -----Release
    ---DCU
    -----Debug
    -----Release
    ---Documentation*
    ---Help*
    ---GFX*
    ---Source*
    -----Database
    -----GUI
    -----Other
    ---Resources* -Project2 Folder
    ---Bin
    -----Debug
    -----Release
    ---DCU
    -----Debug
    -----Release
    ---Documentation*
    ---Help*
    ---GFX*
    ---Source*
    -----Database
    -----GUI
    -----Other
    ---Resources*
    -Setup*
    --Output

    The above layout is an example layout for Delphi project groups. Also note that you might not need all the folders here (for example "SourceDatabase" for database related source files; or "Resources" for any resources that get compiled into the final executable) - or that you might want to add more folders :)

     

    Folders that are marked with a star (*) should be stored in a source control system.

    那些标记*的文件夹应该保存到 源代码控制系统。

    With the above structure you can easily decide what files (folders) should go into a source control system - by their extension.

    Some more complex projects might need more complex directory layout - but the one above has proven the best for my Delphi work.

    Delphi Project Options

    The "Project Options" dialog box (CTRL+SHIFT+F11) lets you set your directory and conditional defines paths for every Delphi project in a project group.

    For example:

    • Build Configuration - displays the current named build configuration. There are two default build configurations: Debug and Release.
    • Output directory - specifies where the compiler should put the executable file.
    • Unit output directory - specifies a directory to contain the .dcu (Win32) or .dcuil (.NET) files.
  • 相关阅读:
    使用layer.tips实现鼠标悬浮时触发事件提示消息实现
    鼠标移入、移出触发事件实现
    vue组件独享守卫钩子函数参数详解(beforeRouteEnter、beforeRouteUpdate、beforeRouteLeave)
    vscode 向下复制当前行(即visual studio 中的Ctrl + D)功能快捷键
    vue UI可视化窗口修改为显示中文
    js中的匿名函数
    NPM install -save 和 -save-dev 傻傻分不清
    Node.js中package.json中库的版本号详解(^和~区别)
    RTX管理器里怎么建群
    Mysql的timestamp(时间戳)详解以及2038问题的解决方案
  • 原文地址:https://www.cnblogs.com/CodeGear/p/4176900.html
Copyright © 2011-2022 走看看