[英]Android Library Projects on Windows and Mac
I'm asking this question on behalf of my team of two Android devs. 我代表两个Android开发人员的团队问这个问题。 I use Windows and my partner uses a Macbook.
我使用Windows,而我的伴侣使用Macbook。 When sharing a project through Git, the
classpaths
accidentally got messed up. 通过Git共享项目时,
classpaths
偶然被弄乱了。 Here are a few observations: 以下是一些观察结果:
NoClassDefFoundError
), again pointing towards a messy build path structure. NoClassDefFoundError
),再次指向混乱的构建路径结构。 I'd like to resolve this issue in a way that we can share the project on Git and work seamlessly in the future. 我想以一种我们可以在Git上共享项目并在未来无缝运行的方式解决此问题。 :)
:)
One option is to: 一种选择是:
.classpath
, .classpath
, That is called a content filter driver , here a smudge
script, which will be called automatically (hence the "seamless" aspect) on git checkout
, and will generate the actual .classpath
(otherwise not versioned and add in the .gitignore
) 这就是所谓的内容过滤器驱动程序 ,这里是
smudge
脚本,将在git checkout
上自动调用(因此称为“无缝”方面),并将生成实际的.classpath
(否则未版本化并添加.gitignore
)
(image shown in " Customizing Git - Git Attributes ", from " Pro Git book ") (图像显示在“ 自定义Git-Git属性 ”中,来自“ Pro Git书 ”)
Note that you can easily remove (without deleting it locally) the .classpath
from the repo: 请注意,您可以轻松地从存储库中删除(无需在本地删除)
.classpath
:
git rm --cached -- .classpath
git add -u .
git commit -m "Delete .classpath"
git push
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.