什么项目选择用于开源Delphi包? [英] What project options to use for open source Delphi packages?
问题描述
应该使用哪些项目选项来容易地将开放源码包纳入个别项目?
我最近开始使用NodeJS。 NPM软件包管理器使其在项目中使用第三方软件包非常简单。在命令行上安装了一个简单的命令。软件包将自动安装任何所需的依赖项。
PS:如果您想添加额外的事情,请随时编辑此问题。
I've recently started using NodeJS. The NPM package manager makes it super easy to use third-party packages in a project. Packages are installed with one simple command on the command line. Packages will automatically install any required dependencies.
推荐答案
让我们说你有这个结构
- MyComponent
- 包
- DelphiXE7
- Package2。 dpr
- Delphi XE7
然后设置
-
搜索路径 p>
then set
.. \..\..\source
Search Path
-
单位输出目录
.. \..\。 .\bin\Delphi XE7\ $(Platform)\ $(Config)
Unit output directory
..\..\..\bin\Delphi XE7\$(Platform)\$(Config)
在所有支持的平台以及发布和调试的编译之后,您将在 bin 目录
- DelphiXE7
- MyComponent
- 包
- DelphiXE7
- Package2.dpr
- Delphi XE7
- Android
- 发布
- 调试
- 发布
- Debug
- 发布
- 调试
- Release
- Debug
要安装,您必须在IDE中设置一些路径。
For installation you have to setup some path inside the IDE.
-
环境
MYCOMPONENT => [文件]
MYCOMPONENT => [root path to the files]
- Android
-
库
对所有支持的平台重复
-
库路径
$(MYCOMPONENT)\bin\Delphi XE7\ $(Platfor m)\Release
$(MYCOMPONENT)\bin\Delphi XE7\$(Platform)\Release
-
-
搜索路径
$(MYCOMPONENT)\source
$(MYCOMPONENT)\source
-
DCU-Path
Debug-DCU-Path
$(MYCOMPONENT)\bin\Delphi XE7\ $(Platform)\Debug
$(MYCOMPONENT)\bin\Delphi XE7\$(Platform)\Debug
语言相关单位也有一个要添加的地方(参见库 - 翻译)
If there are some language related units there is also a place to add (see Library - translated)
这样可以确保您具有完整的调试功能(带使用Debug-DCU 选项集),并且您的应用程序中没有调试代码。
This ensures, that you have full debug feature (with Use Debug-DCU option set) and on release you have no debug code in your application.
只需要一个不想安装的图标,因为您只能在某些项目中使用它们。
Just a sidenote on libraries you should not want to install because you only use them in some projects.
只需将选项与环境变量结合使用。
Simply use the Optionset combined with a environment variable.
这里我的SuperObject.optionset (
$(USRLIB)
ctory,我收集所有常用的源代码。而$(USRLIB)\ext
是所有外部库的地方)。Here my SuperObject.optionset (
$(USRLIB)
points to a directory, where I collect all common used source code. And$(USRLIB)\ext
is the place for all of the external libraries).<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <DCC_UnitSearchPath>$(USRLIB)\ext\superobject;$(DCC_UnitSearchPath)</DCC_UnitSearchPath> </PropertyGroup> <ProjectExtensions> <Borland.Personality>Delphi.Personality.12</Borland.Personality> <Borland.ProjectType>OptionSet</Borland.ProjectType> <BorlandProject> <Delphi.Personality/> </BorlandProject> <ProjectFileVersion>12</ProjectFileVersion> </ProjectExtensions> </Project>
要使用超级对象库,只需将选项集添加到项目中(鼠标右键单击构建配置)一切都很好。
To use the superobject library I simply add the optionset to the project (right mouse click on build configuration) and everything is fine.
这篇关于什么项目选择用于开源Delphi包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- DelphiXE7
- 包
- 包