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 "\Source\Database" 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.

Delphi 项目 结构 文件夹 组织的更多相关文章

  1. Android 项目中文件夹的说明与作用(转)

    (转自:http://blog.csdn.net/goodshot/article/details/11529731) Android 项目中文件夹的作用 1. src:存放所有的*.java源程序. ...

  2. 如何使用vs将现有的项目或者文件夹(尤其是多层目录的)添加到项目中

    困扰我这么久的问题,哎,真心弱爆了! 1.将现有项目或文件夹拷贝到指定目录下 2.解决方案右上有个显示所有文件的按钮 然后选中所有要添加的文件,右击 选择包含到项目中即可

  3. iOS 项目的文件夹结构能看出你的开发经验

    近期有师弟去面试iOS开发,他谈论到,面试官既然问他怎么分文件夹结构的,并且还详细问到每一个子文件夹的文件名称. 文件夹结构确实非常重要.面试官问他这些无疑是想窥探他的开发经验.清晰的文件夹结构,可让 ...

  4. log4j日志输出到web项目指定文件夹

    感谢 eric2500 的这篇文章:http://www.cxyclub.cn/n/27860/ 摘要:尝试将log4j的文件日志输出到web工程制定目录,遇到了很多问题,最终在eric2500的指导 ...

  5. linux 下用renameTo方法修改java web项目中文件夹名称问题

    经测试,在Linux环境中安装tomcat,然后启动其中的项目,在项目中使用java.io.File.renameTo(File dest)方法可行. 之前在本地运行代码可以修改,然后传到Linux服 ...

  6. js配置文件路径和项目目录文件夹位置的一致性

    在js文件引入的时候注意配置文件的路径是否和项目目录中的文件夹位置一致,如果不一致, 浏览器会指出找不到文件404的情况

  7. Android 项目中文件夹作用(res文件夹详细介绍)

    1. src:存放所有的*.Java源程序. 2. gen:为ADT插件自动生成的代码文件保存路径,里面的R.java将保存所有的资源ID. 3. assets:可以存放项目一些较大的资源文件,例如: ...

  8. 关于idea中新建web项目 webapp文件夹没有小蓝点 ,启动服务,访问不到解决方案

    第一步: 选中项目按F4键,找到你的项目. 第二步: 选中项目下的web,如果没有web点击左上角的加号,找到web最下面,添加进去 第三步: 点开type下的节点,出来弹框, 第四步: 点击弹框的选 ...

  9. eclipse如何把多个项目放在文件夹下,用文件夹分开不同的项目

    在Package Explorer顶部的右侧有有机表图标按钮,点击倒三角 Top Level Elements->Working Set.此时就会发现,很多项目会自动纳入一个文件夹,这个文件夹的 ...

随机推荐

  1. 骗访问量的机房人物列传by xMinh

    作者:$xMinh$ 人物列传·Refun(Aufun,虚凡,人赢) 机房最人赢的人赢,上过表白墙的男人 在宿舍公然开设情感讲座和人赢培训班,教学成果显著,他的徒弟要么gay了要么凉了 认识的人极其广 ...

  2. HDU 1848 Fibonacci again and again(SG函数入门)题解

    思路:SG打表 参考:SG函数和SG定理[详解] 代码: #include<queue> #include<cstring> #include<set> #incl ...

  3. html文件引用本地js文件出现跨域问题的解决方案

    在本地做个小demo,很简单,一个html文件,一个js文件,在html文件中通过<script>标签引入js,但是出现了一个意想不到的问题:浏览器报错—— 一番折腾后,终于弄明白了:加载 ...

  4. 阿里云Linux服务器初探

    阿里云Linux服务器初探 阿里云Linux服务器初探 因为钱包的关系,本人买了一个660元2年的1核1GB的小服务器(centos是Linux的发行版),在当初是用2核4GB(内存)的时候使用的是w ...

  5. Ubuntu 14.04 更新gcc版本至4.9.2

    参考: ubuntu 14.04 更新 gcc/g++ 4.9.2 Ubuntu 14.04 更新gcc版本至4.9.2 1.更新源,安装gcc v4.9.2 $ sudo add-apt-repos ...

  6. 高精度N的阶乘-N!

    题目:输入一个正整数N(0<N<=30),求N! 代码: #include<stdlib.h> #include<cstdio> #include<strin ...

  7. stm32 ADC使用方法

    void Adc_Init(void) { ADC_InitTypeDef ADC_InitStructure; GPIO_InitTypeDef GPIO_InitStructure; RCC_AP ...

  8. Django Python MySQL Linux 开发环境搭建

    Django Python MySQL Linux 开发环境搭建 1.安装Python 进行Python开发,首先必须安装python,对于linux 或者Mac 用户,python已经预装. 在命令 ...

  9. XML_CPP_资料_libXml2_01_Code_ZC(?.pro)

    ZC:最下面有 ?.pro文件的设置写法 ZC: Win7x64,qt-opensource-windows-x86-msvc2010_opengl-5.3.2.exe,cn_visual_studi ...

  10. Codeforces 855B - Marvolo Gaunt's Ring

    855B - Marvolo Gaunt's Ring 思路:①枚举a[j],a[i]和a[k]分别用前缀最小值最大值和后缀最小值和后缀最大值确定. ②dp,dp[i][j]表示到第j为止,前i+1个 ...