简体   繁体   English

gradle.xml在平台之间不一致

[英]gradle.xml not consistent between platforms

I develop using Android Studio on both Macs and PCs, and am seeing undesired behavior when moving projects between the two platforms. 我在Mac和PC上都使用Android Studio进行开发,并且在两个平台之间移动项目时看到了不良行为。

One of those issues is regarding the "gradleHome" value in '.idea/gradle.xml' , which is a correct-looking value on the Mac : 这些问题之一是关于'.idea / gradle.xml'中的“ gradleHome”值, 在Mac上这是一个看起来正确的值:

<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.10" />

When I check out the project and load it into Android Studio on Windows, the '.idea/gradle.xml' value for "gradleHome" becomes a hard-coded path: 当我签出项目并将其加载到Windows上的Android Studio中时,“ gradleHome”的'.idea / gradle.xml'值将变成硬编码路径:

<option name="gradleHome" value="C:\Program Files\Android Studio\gradle\gradle-2.10" />

Obviously problems will ensue if the file is checked in with a hard-coded path, but there seems nothing I can do but ignore this change during checkin. 显然,如果使用硬编码路径检入文件,则会出现问题,但是似乎我无能为力,只能在检入期间忽略此更改。

Does anyone know why this is happening or how to prevent it? 有谁知道为什么会这样或如何防止呢? Should I not be checking this file into SVN? 我不应该将此文件签入SVN吗?

Thanks! 谢谢!

This file should not be checked into version-control. 此文件不应签入版本控制。 What can go into version-control and defines the gradle-version is this file: gradle/wrapper/gradle-wrapper.properties - I would ignore the whole .idea directory. 可以用于版本控制并定义gradle版本的是以下文件:gradle / wrapper / gradle-wrapper.properties-我将忽略整个.idea目录。 On a side node - think about using git over svn - if you really need svn as a storage there is git-svn .. 在侧面节点上-考虑在svn上使用git-如果确实需要svn作为存储,则可以使用git-svn ..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM