git + Flash Builder 工作流程:如何设置才能使 git 顺利运行?

发布于 2024-08-06 16:54:49 字数 1675 浏览 8 评论 0原文

我正在使用 git 跟踪我在 Flash Builder 中开发的项目,我想知道让它跟踪它的最佳方法,特别是关于 Flash Builder 生成的文件、编译器生成的文件以及非“的源文件”不一定是 Flex 文件。

我将其设置为忽略所有 flash builder .project 和 .project 。通过 .gitignore 调试目录:

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

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

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

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

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

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

  2. 抑制模板文件 创建(特别是 APP_NAME.mxml) 使用 git 克隆。

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

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

最后一个问题是在哪里保存服务器文件。我是否将它们放在单独的存储库中?我将 php VO 与 AMFPHP 一起使用,因此能够在 Flash Builder 中编辑 php 文件以及我的 Actionscript 文件是件好事……但它们不属于项目 src 文件夹。

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

  1. 在项目根目录中创建一个“服务器”文件夹

  2. 指向一个 apache 虚拟主机

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

  4. 然后使用服务器文件夹替换 bin-导出文件时进行调试

问题是我有一大堆编译器生成的文件,并且非 - AS 源文件位于我的服务器文件夹中。这看起来并不是一个优雅的解决方案。

如何设置 git 才能顺利地与 flash builder 配合使用?所有这些问题都可以通过多个 git repos/Flash Builder 项目或者 ANT 脚本之类的东西来解决吗?

谢谢。

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.

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

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

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

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

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

Flash Builder doesn't like it when
you have a project folder without
the .project files.
Only way to
import the source into Flash Builder is to:

  1. Create a new Flex Application

  2. Smother the template files it
    created (specifially APP_NAME.mxml)
    with a git clone.

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.

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.

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. Creating a 'server' folder in the project root

  2. Pointing an apache virtualhost at it

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

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

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.

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?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鲜血染红嫁衣 2024-08-13 16:54:49

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

在 git 提交之前清理您的项目。

就这么简单。

无论是通过Flash Builder还是通过ant,无论如何你都应该有清理的能力,所以如果你在提交之前简单地清理,生成文件的问题就解决了。呃。

事实上,您可能可以将其设置为 git hook 或其他东西。

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

CLEAN your projects before you git commit.

Simple as that.

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.

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

轻拂→两袖风尘 2024-08-13 16:54:49

通常,对于任何 SCM 的 Eclipse 项目,我最初会检查所有内容,包括 .projects 等,但在您的情况下可能除了 bin-debug 之外。然后确保签出该项目的任何人都不会签回这些 .xxx 文件。例如,当我使用 perforce 时,我首先将 .xxx 文件签出到我从未签入的变更列表中。然后将其余文件签出到单独的变更列表中。

另一个技巧是在使用构建路径等时使用用户定义的库变量。

Typically for eclipse projects with any SCM, I initially check in everything including .projects, etc., but maybe except bin-debug in your case. Then just make sure that anybody who checks out the project never checks back in those .xxx files. For instance, when I use perforce, I first check out the .xxx files to a changelist that I never check in. Then check out the rest to a separate changelist.

Another tip is to use user defined library variables when working with build paths, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文