技术栈Android开发Android知识

build、make、compile的区别

2017-10-09  本文已影响66人  黄油伯伯

我们先来看看Stack Overflow的compileSdkVersion和buildToolsVersion解释:
https://stackoverflow.com/questions/24521017/android-gradle-buildtoolsversion-vs-compilesdkversion

compileSdkVersion is the API version of Android that you compile against.

buildToolsVersion is the version of the compilers (aapt, dx, renderscript compiler, etc...) that you want to use. For each API level (starting with 18), there is a matching .0.0 version.

At IO 2014, we release API 20 and build-tools 20.0.0 to go with it.

Between Android releases we will release updates of the compilers, and so we'll release version .0.1, .0.2, etc... Because we don't want to silently update these version under you, it's up to you to move to the new version when it's convenient for you.

You can use a higher version of the build-tools than your compileSdkVersion, in order to pick up new/better compiler while not changing what you build your app against.

这里大概意思compileSdkVersion是编译时api版本,buildToolsVersion是执行编译的组件工具版本。你可以用高版本的编译组件来执行低sdk版本的程序。

接着,看http://lavasoft.blog.51cto.com/62575/436216/ 解答java的build、make、compile三种的区别:

compile:编译成机器能明白的指令。
build:一般包含了compile的操作,并且会生成对应的可执行文件。
make:编译选定的目标,但是Make只编译上次编译变化过的文件,减少重复劳动,节省时间

上一篇下一篇

猜你喜欢

热点阅读