Mac distribution of Eclipse RCP application built with Tycho on Windows doesn't start

北慕城南 提交于 2019-12-01 17:53:50

Cross-platform build on Windows for Mac is not expected to work. The reason is that Tycho/p2 would need to simulate a file system with Unix permissions. There is a request for this in Tycho's issue tracker, but IMHO implementing this is not worth the effort.

I have just figured out how to make OSX executable .app from Windows.

You can set the Tycho build to generate .tar.gz files for Mac/Linux, then use a tool to set permission on the executable within the tar file, as tar supports *nix permissions.

Here is a snippet that shows how to set this in a pom.xml file. (This snippet also sets up Mac .app folder and adds version to archive file names): http://snipt.org/Aggid3

Here is a Java class that does the permissions bit. It requires Guava and Apache Commons Compress: http://snipt.org/Aggic1

Here is a prebuilt jar including all the dependencies: https://mega.co.nz/#!WcNjyRjS!KE7tM1xYrt1l9JIguUAsrgpLe2V0NS1QIj_NvdAnm88

A usage example using the above would be: java -jar gztperms.jar “My Product-0.0.1.201309091838-macosx.cocoa.x86.tar.gz” “My Product-Executable-0.0.1.201309091838-macosx.cocoa.x86.tar.gz” “My Product.app/Contents/MacOS/My Product”

I have a fairly trivial Ant-based post-build script I execute from Jenkins that finds the .gz file and runs this script on it, and everything now works from the artifact link.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!