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. P4013 数字梯形问题 网络流二十四题

    P4013 数字梯形问题 题目描述 给定一个由 nn 行数字组成的数字梯形如下图所示. 梯形的第一行有 m 个数字.从梯形的顶部的 m 个数字开始,在每个数字处可以沿左下或右下方向移动,形成一条从梯形 ...

  2. 打印图形|2014年蓝桥杯B组题解析第五题-fishers

    打印图形 小明在X星球的城堡中发现了如下图形和文字: rank=3 rank=5 rank = 6 小明开动脑筋,编写了如下的程序,实现该图形的打印. 答案:f(a, rank-1, row, col ...

  3. Linux 文件的权限

    备注 : -rw-r--r-- 第一个“-”不算 ,三个一组 这个就是 644   二.使用chown命令更改文件拥有者 在 shell 中,可以使用chown命令来改变文件所有者.chown命令是c ...

  4. 51nod 1073约瑟夫环

    思路传送门 :http://blog.csdn.net/kk303/article/details/9629329 n里面挑选m个 可以递推从n-1里面挑m个 然后n-1里面的x 可以转换成 n里面的 ...

  5. BZOJ1398: Vijos1382寻找主人 Necklace 字符串最小表示法

    Description 给定两个项链的表示,判断他们是否可能是一条项链. Input 输入文件只有两行,每行一个由0至9组成的字符串,描述一个项链的表示(保证项链的长度是相等的). Output 如果 ...

  6. 软件测试&安全测试高峰论坛

    Nubia测试以及介绍 基于Cucumber的自动化测试平台 常见Web漏洞之XSS,主要HTML与JS基础.XSS的基础知识与挖掘方法.XSS的利用 自动化测试框架以及测试思路

  7. NetCat教程

    NetCat by Jian Lee 简介 使用 隐藏命令行参数 正/反向域名解析 参数详解 案例 监听端口(制作蜜罐) 端口扫描 ftp 服务器 两台服务器文件校验 使用注意 简介 使用 最简单的使 ...

  8. js 文件上传

    <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8&quo ...

  9. Spring Boot入门第二天:一个基于Spring Boot的Web应用,使用了Spring Data JPA和Freemarker。

    原文链接 今天打算从数据库中取数据,并展示到视图中.不多说,先上图: 第一步:添加依赖.打开pom.xml文件,添加必要的依赖,完整代码如下: <?xml version="1.0&q ...

  10. Confluence 6 使用 LDAP 授权连接一个内部目录 - 用户组 Schema 设置

    请注意:这部分仅在拷贝用户登录(Copy User on Login)和 同步组成员(Synchronize Group Memberships)被启用后可见. 其他用户组 DN(Additional ...