How to deploy a Delphi OSX project from the command line
Delphi has a well developed command line build process (via MSBuild) for Windows projects. After the introduction of FireMonkey, MSBuild was altered to allow users to build non-Win projects. After you build a project, if you want to deploy it to platforms other than Win32 (or Win64), the compiler requires a deployment project file and the use of Deployment Manager.
According to the documentation, the only way to generate a deployment file and deploy the project is via the IDE. This means that you have to, manually, generate the file in the IDE first and then, manually again, deploy the project. This limitation may present a problem for those who have an automated processes after the development of the code (unit tests, builds, deployment, etc.).
Vladimir Georgiev has written a very nice tool (EmbDeploy) to allow the deployment of a Delphi project via the PAClient. If you want to check the details of the solution, see this post and get the source code from here.
You use EmbDeploy with the following command-line arguments:
- embdeploy [-delphiver "ver"] -deploy|(-cmd "command")|(-bundle "zip") [-platform|-profile|-config|-proot "name"] [-ignore] ProjectName
The arguments are here:
- ProjectName Name (relative or absolute) of the project file (.dproj)
- -delphiver "ver" Delphi version to use the paclient from. It is the number from the HKCU/Software/Emb...'
- -deploy Deploy the project to the remote profile
- -platform "name" Platform to deploy (Win32, OSX32, iOSDevice, etc). If not specified the default one from the project is used
- -profile "name" Name of the remote profile to use. If not specified the default one for the platform is used
- -config "name" Release or Debug configuration. If not specified the default one from the project file is used
- -proot "name" Remote project root folder. If not specified a default one is generated from the project name
- -cmd "command" Execute an arbitrary command line on the remote server. The command is anything that can be executed from a terminal or command line prompt.
- It is executed from above the remote project folder. The command can contain the $PROOT parameter, which is replaced with the project
- root folder, e.g. $PROOT/Contents/... becomes myproject.app/Contents/...
- -ignore Ignore errors reported by paclient.exe and continue deploying
- -bundle "zipname" Produce a ZIP archive of the files to be deployed. Useful for making a ZIP of an OSX project APP bundle
So, if you want to build for OSX32 and use the Release configuration in Delphi, you call the following command from the project folder:
- embdeploy.exe -platform OSX32 -config Release -deploy myproject.dproj
This will generate the .app bundle in the scratch-dir on your Mac machine.
EmbDeploy requires an open channel to the Mac machine; i.e., if I want to build my OSX project from the command line, I have to keep PAClient open and give constant access of my Delphi machine to the Mac machine. This is because EmbDeploy uses a pipe channel to the Mac machine in order to generate the .app bundle with all its resources and the rest of the files. Although this is not the end of the world, I wanted to keep my build server as a separate machine isolated from my Mac.
I modified Vladimir’s work and added a few more command line switches to meet my needs.
- -registerPAClient Uses the PAClient to deploy the project
- -registerFolder "folder"'
- OSX only: Creates the APP folder structure on Windows. Useful for building OSX without the need to use the paclient on OSX
- -verbose Produces detailed debugging messages
- -logExceptions Logs any exceptions and quits instead of raising them
- -binaryFolder "folder"
- The folder for the binary files. If not provided, the default location is assumed
I have introduced the idea of “build channels” and, for now, you can have a channel that uses the PAClient (registerPAClient), as before, and/or a channel which creates the .app bundle as a folder on windows (registerFolder). The improvement here is that you don’t need the PAClient to be open and linked to your Delphi machine, as EmbDeploy creates the bundle (executable on Mac) independently. Of course, you need the PAClient if you use the registerPAClient switch. Then, if you wish, you can copy the .app folder to a Mac machine and execute it without any modifications.
I have,also, introduced a couple of other switches to help debugging the deployment process (verbose, logExceptions) and a parameter (binaryFolder) which defines the directory with the build binaries.
The usage of the new parameters is as follows:
- embdeploy.exe -registerFolder "....\Desktop" -binaryFolder "\OSX32" -platform OSX32 -config Release -deploy myproject.dproj
The above command will create the myproject.app folder on Desktop. The paths indicate that the command is executed in the same folder as myproject.dproj. As a test, if you have Windows on a virtual machine, you can reveal the myproject.app folder in Mac and execute it directly.
You can get the modified version of EmbDeploy from here, until Vladimir responds to the pull request on github.
Update (24/09/2016): Vladimir has, now, merged the pull request so you can download the updated version of EmbDeploy, directly, from his repository. Thanks Vladimir!
http://www.kouraklis.com/2016/09/how-to-build-and-deploy-a-delphi-osx-project-from-the-command-line/
How to deploy a Delphi OSX project from the command line的更多相关文章
- IAR project build with command line
The simple way is that using iarbuild.exe project.eww -build Release/Debug Release/Debug is the con ...
- Getting command line access to PHP and MySQL running MAMP on OSX
建立自己profile路径应该在/Users/yourname/,最后要运行. ./.profile使文件生效,和windows中给添加环境变量是一个道理,还可以看出linux和UNIX默认运行路径为 ...
- Happening in delphi world
Happy New Year! Delphi XE5 Update 2 Recent VCL enhancements New product features for old product use ...
- 错误异常 (1)Android Studio错误提示:Gradle project sync failed. Basic functionality (eg. editing, debugging) will not work properly
[已解决]Android Studio错误提示:Gradle project sync failed. Basic functionality (eg. editing, debugging) wil ...
- Android Studio错误提示:Gradle project sync failed. Basic functionality (eg. editing, debugging) will not work properly
Android Studio中出现提示: Gradle project sync failed. Basic functionality (eg. editing, debugging) will n ...
- 【1】按照Django官网,编写一个web app 创建project/配置数据库
1. Creating a project From the command line, cd into a directory where you'd like to store your code ...
- maven tomcat 插件实现热部署
tomcat 的maven插件有助于提高开发效率,原因是: --可以直接把项目发布到远程的服务器上. --能够实现项目的热部署,在开发过程中修改了Java类,不需要重启tomcat 首先配置一个tom ...
- Delphi10.2 VCL Forms Application 的构成
Delphi10.2 项目的构成(File Extensions of Files Generated by RAD Studio) Step1.打开 Delphi10.2,选择[File | New ...
- Developing on Windows Phone 8 Devices
Developing on Windows Phone 8 Deviceshttp://docs.madewithmarmalade.com/native/platformguides/wp8guid ...
随机推荐
- 使用Vim比较两个文件的内容
原文地址:http://blog.chinaunix.net/uid-22548820-id-3477464.html 1. 使用vim的比较模式打开两个文件: vim -d file1 file2 ...
- 30深入理解C指针之---字符串和数组
一.字符串与数组 1.定义:使用字符数组表示字符串 2.特征: 1).可以直接使用字符串字面量初始化字符数组 2).声明后,赋值就只能使用字符串操作函数strcpy函数赋值 3).可以使用数组的一一赋 ...
- 现象: shell脚本中source aaa.sh时提示 source: not found
原因: ls -l `which sh` 提示/bin/sh -> dash 这说明是用dash来进行解析的. 改回方法: 命令行执行:sudo dpkg-reconfigure dash 在界 ...
- java打包python到exe文件
最近想把写的python代码打包,以供没用安装python环境的同事使用,需求如下: 无python环境也可执行 文件尽量少,不要太乱 程序体积尽量小 如果需要更新的话重复类库不用更新 采用方案如下: ...
- 关于[WinError 10054] 远程主机强迫关闭了一个现有的连接。
之前一直用python实现qq邮箱自动发送,都弄的好好的,然后今天一打开,就出现如题的错误,百度了许多,说,可能发送邮件次数过多,被当作是攻击,建议换个邮箱,换了也不行, 最后用手机给电脑分享Wifi ...
- 标题:如何使用ShareSDK实现Cocos2d-x的Android/iOS分享与授权
Cocos2DX 简介 Cocos2d-x是一套成熟的开源跨平台游戏开发框架.其引擎提供了图形渲染.GUI.音频.网络.物理.用户输入等丰富的功能,被广泛应用于游戏开发及交互式应用的构建.引擎的核心采 ...
- 洛谷—— P1875 佳佳的魔法药水
https://www.luogu.org/problemnew/show/1875 题目背景 发完了 k 张照片,佳佳却得到了一个坏消息:他的 MM 得病了!佳佳和大家一样焦急 万分!治好 MM 的 ...
- java正则表达式的知识
/** 用途:正则表达式 * 创建人:向家康 * 创建日期:2019年4月21日 下午9:59:08 */ //有了登录界面当然少不了正则表达式啦,这是做项目必备的知识点 //通过本博客的代码,想必即 ...
- 第四章——SQLServer2008-2012资源及性能监控(1)专家
http://blog.csdn.net/dba_huangzj/article/details/8614817
- 在asp.net 项目的bin目录中使用子目录
如果要动态发布第三方扩展或者对asp.net项目进行二次开发时,希望不影响原有的程序并保持原有bin完整性,可以将扩展放到bin下的子目录中,并修改web.config的相应配置. 原配置: < ...