Migrating from IntelliJ Projects
- Create a basic "build.gradle" file. Unlike the default Gradle file created by Android Studio when you create a new project, the following gradle file will point the source code directories to the existing folders (e.g.
res/,src/) instead of the default new directory structure used for Gradle projects (src/main/java/,src/main/res/, etc). A sample gradle file is given below. - Identify which library projects you are using (such as ActionBarSherlock). In Gradle you no longer need to add in these libraries as source code projects; you can simply refer to them as dependencies, and the build system will handle the rest; downloading, merging in resources and manifest entries, etc. For each library, look up the corresponding AAR library dependency name (provided the library in question has been updated as a android library artifact), and add these to the dependency section.
- To find the right declaration statements for your libraries, you might find the following useful: http://gradleplease.appspot.com/
- Test your build by running
gradle assembleDebugin your project. If you have not built with Gradle before, install it from http://www.gradle.org/downloads. Note that when you create new projects with Studio, we create a gradle wrapper script ("gradlew" and "gradlew.bat") in the project root directory, so any users of the project can just run "gradlew assembleDebug" etc in your project and gradle is automatically installed and downloaded. However, your existing IntelliJ projects presumably does not already have the gradle scripts.) - Note that IntelliJ projects for Android generally follow the same structure as Eclipse ADT projects, so the instructions in the Eclipse migration guide might be helpful.
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' }}apply plugin: 'android'dependencies { compile fileTree(dir: 'libs', include: '*.jar')}android { compileSdkVersion 18 buildToolsVersion "18.0.1" sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } // Move the tests to tests/java, tests/res, etc... instrumentTest.setRoot('tests') // Move the build types to build-types/<type> // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... // This moves them out of them default location under src/<type>/... which would // conflict with src/ being used by the main source set. // Adding new build types or product flavors should be accompanied // by a similar customization. debug.setRoot('build-types/debug') release.setRoot('build-types/release') }}http://tools.android.com/tech-docs/new-build-system/migrating-from-intellij-projects
Migrating from IntelliJ Projects的更多相关文章
- Android官方技术文档翻译——IntelliJ 项目迁移
本文译自Android官方技术文档<Migrating from IntelliJ Projects>,原文地址:http://tools.android.com/tech-docs/ne ...
- Intellij IDEA连接Spark集群
1. 首先安装Scala插件,File->Settings->Plugins,搜索出Scla插件,点击Install安装: 2. File->New Project->mave ...
- Android Studio 和 Gradle
由于以前没做过什么java项目,在使用Android Studio时遇到了Gradle,真是一头雾水,决定总结一下. 具体的使用方法请参看:http://www.cnblogs.com/youxilu ...
- Android官方技术文档翻译——Eclilpse项目迁移
本文译自Android官方技术文档<Migrating From Eclipse Projects>,原文地址:http://tools.android.com/tech-docs/new ...
- Android官方技术文档翻译——新构建系统概述
本文译自Android官方技术文档<New Build System>,原文地址:http://tools.android.com/tech-docs/new-build-system. ...
- [2018.05].NET Core 3 and Support for Windows Desktop Applications
.NET Core 3 and Support for Windows Desktop Applications Richard 微软官网的内容...net 3.0 升级任务 任重道远 https:/ ...
- What’s Brewing for .NET Developers
Microsoft hosted its premier fall developer event – Connect(); // 2016 in New York on November 16-17 ...
- Spark机器学习(12):神经网络算法
1. 神经网络基础知识 1.1 神经元 神经网络(Neural Net)是由大量的处理单元相互连接形成的网络.神经元是神经网络的最小单元,神经网络由若干个神经元组成.一个神经元的结构如下: 上面的神经 ...
- Spark机器学习(11):协同过滤算法
协同过滤(Collaborative Filtering,CF)算法是一种常用的推荐算法,它的思想就是找出相似的用户或产品,向用户推荐相似的物品,或者把物品推荐给相似的用户.怎样评价用户对商品的偏好? ...
随机推荐
- 将分页功能从JSP页面中独立出来
附带视频链接:http://www.tudou.com/programs/view/leaQ-YFl7W8/?bid=03&pid=2&resourceId=0_03_05_02
- NHibernate中的IQueryable和IQueryover
今天在做一个小项目时,用到了NHibernate,使用了模糊查询(Like),在后台用IQueryable去接收Session.Query<T>()的查询结果. 代码如下: /// < ...
- android开发者博客二月Android Studio2.0测试
参考网页-http://android-developers.blogspot.com/2016/02/android-studio-20-beta.html Android Studio 2.0-B ...
- Opencv读取视频一闪而过情况分析
在参加一个软件比赛需要用opencv对视频的处理,也碰到了一些问题. 最常见的就是视频一闪而过了,在网上查了好久都没解决, 最后重装在配置环境变量时发现的. 现在我来终结一下估计是比较全的了. 先说明 ...
- C#常用正则验证
#region Protected Property protected Regex rLetters { get { return new Regex("[a-zA-Z]{1,}" ...
- ios ReactiveViewModel
项目中使用 ReactiveCocoa 一般都会嵌入ReactiveViewModel 或者 ReactiveCocoaLayout 联合处理UI.网络.动画.布局.窗口切换等,组合使用时威力惊人. ...
- oracle11g不能导出空表
Oracle11g的数据库迁移,习惯性的用了exp/imp,然后在新的数据库发现,空表根本没有exp出来,然后查资料,发现了如下信息: ORACLE 11G在用EXPORT导出时,空表不能导出. 11 ...
- js简单日期获取( 菜鸟入门基础)
关于js日期的获取要用到最基本的Date()方法获取当日的日期 var d =new Date(); //定义日期对象 var y=d.getFullYear(); //获取年 var m=d. ...
- JAVA IDE下载地址
Subclipse 各版本官网下载地址: http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240 Eclipse ...
- eclipse+PyDev 中报错"scrapy.spiders.Spider" ,可用"# @UndefinedVariable"压制.
# -*- coding:utf-8 -*- ''' Created on 2015年10月22日 (1.1) 例子来源: http://scrapy-chs.readthedocs.org/zh_C ...