build.gradle中这些行的目的是什么

时间:2015-06-10 07:07:42

标签: android gradle

这是build.gradle的一部分:

} else if (!versionCodeOverride) {
  def minSdkVersion = minSdkVersionOverride ?: privateHelpers.extractIntFromManifest("minSdkVersion")
  // Vary versionCode by the two most common API levels:
  // 14 is ICS, which is the lowest API level for many apps.
  // 20 is Lollipop, which is the lowest API level for the updatable system webview.
  if (minSdkVersion >= 20) {
    defaultConfig.versionCode += 9
  } else if (minSdkVersion >= 14) {
    defaultConfig.versionCode += 8
  }
}

如果尚未设置defaultConfig.versionCode,似乎gradle会更改versionCodeOverride。我搜索谷歌并没有找到一些有用的信息,我认为versionCode只是一个用于安装Android的数字,它有其他功能吗?

0 个答案:

没有答案