gradle 配置文件 build.gradle 属性详解
2015-08-13 22:50
796 查看
gradle 配置文件 build.gradle 属性详解
// 声明插件,这是一个android程序,如果是android库,应该是com.android.library apply plugin: 'com.android.application' android { // android构建过程需要配置的参数 compileSdkVersion 22 // 编译版本 buildToolsVersion "22.0.1" // buildtool版本 defaultConfig { // 默认配置,会同时应用到debug和release版本上 minSdkVersion 10 targetSdkVersion 22 versionCode 2 versionName "2.0.0" } // 编译选项 compileOptions { // java版本 sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } } // 依赖 dependencies { compile 'com.android.support:appcompat-v7:22.1.1' compile 'com.android.support:support-annotations:22.1.1' compile 'com.android.support:design:22.2.0' compile 'com.android.support:cardview-v7:22.1.1' compile 'com.android.support:recyclerview-v7:22.1.1' compile project(path: ':library') compile fileTree(dir: 'libs', include: ['*.jar']) }
buildToolsVersion "22.0.1"
buildToolsVersion 与 sdk\build-tools 中版本对应
dependencies { compile 'com.android.support:appcompat-v7:22.1.1' compile 'com.android.support:support-annotations:22.1.1' compile 'com.android.support:design:22.2.0' compile 'com.android.support:cardview-v7:22.1.1' compile 'com.android.support:recyclerview-v7:22.1.1' }
com.android.support 与 sdk\extras\android\m2repository\com\android\support 对应,
com.android.support:appcompat-v7:22.1.1则与sdk\extras\android\m2repository\com\android\support\appcompat-v7中版本对应
可参考博客:
http://segmentfault.com/a/1190000002439306
http://www.bkjia.com/Androidjc/981624.html
相关文章推荐
- UI 07 _ 导航视图控制器 与 属性传值
- Innodb/MyISAM在自增/UUID主键下的性能与索引空间比较
- Havok_2014-1-0_Pc_Xs_User_Guide(2.2.2-模拟仿真一个Physics2012世界)
- Havok_2014-1-0_Pc_Xs_User_Guide(1.5.7-计时器)
- UIViewController _loadViewFromNibNamed:bundle:
- -[UIViewController _loadViewFromNibNamed:bundle
- spoj1182 Sorted bit squence
- UIPageControl 与 UIScrollView
- Android中Looper的quit方法和quitSafely方法
- UVa 11955 I Can Guess the Data Structure!
- The Unique MST prim(次小生成树)
- 【转载】UITableView
- iOS开发 -- UILable详解
- iOS开发 -- UIView详解
- KVC(Key-value coding)机制
- UIPageViewController
- POJ 题目3481 Double Queue(SBT ro map)
- UI11_BLOCK传值
- UI11_UITabBar
- UI10_tableview的编辑