本文介绍了git + Flash Builder 工作流程:我该如何设置才能让 git 顺利运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 git 来跟踪我在 Flash Builder 中开发的项目,我想知道让它跟踪它的最佳方法,尤其是关于 Flash Builder 生成的文件、编译器生成的文件和源文件不一定是 flex 文件.

I'm using git to track a project I'm developing in Flash Builder, and I'm wondering the best way to go about having it track it, especially regarding Flash Builder generated files, Compiler generated files, and source files that aren't necessarily flex files.

我已将其设置为忽略所有 Flash Builder .project &通过 .gitignore 调试目录:

I had it set up to ignore all of the flash builder .project & debugging directories via .gitignore:

.actionScriptProperties
.flexProperties
.metadata
.project
.settings
bin-debug

并且还通过 .gitattributes 将任何 swf/swc 文件视为二进制文件

and also treating any swf/swc files as binaries via .gitattributes

*.swf -crlf -diff -merge
*.swc -crlf -diff -merge

此设置的一个问题是检查此项目并使用在 Flash Builder 中从头开始:

One issue with this setup is checking out this project and using it in Flash Builder from scratch:

Flash Builder 不喜欢它你有一个没有的项目文件夹.project 文件. 唯一的方法将源代码导入 Flash Builder 是为了:

Flash Builder doesn't like it whenyou have a project folder withoutthe .project files. Only way toimport the source into Flash Builder is to:

  1. 创建一个新的 Flex 应用程序

  1. Create a new Flex Application

扼杀模板文件创建(特别是APP_NAME.mxml)使用 git clone.

Smother the template files itcreated (specifially APP_NAME.mxml)with a git clone.

我应该把库放在哪里?从 git 的角度来看,我希望将它们放在 repo 的 lib 文件夹中,这样当有人克隆 repo 时,一切正常,但来自本地文件系统透视图 我想将所有库存储在一个位置并使用 Flash Builder 来引用它们,因为我可能会更新库或下载更高版本.也许我应该将这些库放在他们自己的仓库中并将它们作为 git 模块加载?这样我就不需要手动记住在所有使用它们的 X 项目中更新我的 Y 库文件,当我更新每个项目的子模块时,它们只会更新.

Where do I put libraries? From a git perspective, I'd like to have them in the lib folder of the repo so when someone clones the repo, everything just works, but from a local file system perspective I'd like to store all my libraries in a single location and use Flash Builder to reference them, as I may update the library or download a later version. Maybe I should put the libraries in their own repo and load them as a git module? This way I don't need to manually remember to update my Y library files in all X projects that are using them, edit: they will simply update when I update each projects' submodules.

那么外部 swfs/flex 模块呢?我暂时将外部 swf 文件粘贴在 bin-debug 文件夹中,以便 SWFLoader 类可以找到它们,但因为我是 .gitignoringbin-debug 文件夹,当它被克隆时,它们不随存储库一起提供.

And what about external swfs/flex modules? I've was sticking external swf files in the bin-debug folder for now so the SWFLoader class can find them, but because I'm .gitignoring the bin-debug folder, they don't come with the repo when it's cloned.

最后一个问题是在哪里保存服务器的文件.我是否将它们放在单独的回购中?我将 php VO 与 AMFPHP 一起使用,因此能够在 Flash Builder 中编辑 php 文件和我的 actionscript 文件很好......但它们不属于项目 src 文件夹.

One final issue is where to keep the files for the server. Do I have them in a separate repo? I'm using php VOs' with AMFPHP so it's good to be able to edit the php files alongside my actionscript files in Flash Builder... but they don't belong in the project src folder.

我目前使用的解决方案是:

The current solution I'm using is:

  1. 在项目根目录中创建服务器"文件夹

  1. Creating a 'server' folder in the project root

将 apache 虚拟主机指向它

Pointing an apache virtualhost at it

将运行/调试设置设置为 http://APP_NAME.localhost

Setting the run/debug settings to http://APP_NAME.localhost

然后在导出文件时使用服务器文件夹作为 bin-debug 的替代

Then using the server folder as a replacement for bin-debug when the files get exported

这个问题是我的服务器文件夹中有一大堆编译器生成的文件和非 AS 源文件.这似乎不是一个优雅的解决方案.

The problem with this is I've got a big mess of compiler generated files, and non-AS source files in my server folder. It just doesn't seem like an elegant solution.

如何设置 git 与 flash builder 顺利工作?所有这些都可以通过多个 git repos/Flash Builder 项目或 ANT 脚本或其他东西来解决吗?

How do you set up git to work with flash builder smoothly? Could all this be resolved with multiple git repos/Flash Builder projects, or an ANT script or something?

谢谢.

推荐答案

我找到了一个好的解决方案,它避免了拥有未跟踪文件和保留大量 .ignore 列表的所有恐惧:

I've found a good solution which avoids all of the horror of having untracked files and keeping a massive .ignore list:

在 git commit 之前清理你的项目.

就这么简单.

不管是Flash Builder还是ant,你都应该有清理的能力,所以只要在提交前简单清理,生成文件的问题就解决了.呃.

Whether it be by Flash Builder or by ant, you should have the ability to clean anyway, so if you simply clean before you commit, the problem of generated files is solved. Duh.

事实上,你可以将它设置为 git hook 或其他东西.

In fact you could probably set it up as a git hook or something.

这篇关于git + Flash Builder 工作流程:我该如何设置才能让 git 顺利运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 02:03