Andorid 配置 Annotations
来源:互联网 发布:java游戏服务端源码 编辑:程序博客网 时间:2024/06/08 03:08
Annotations注解功能很强大,配置到项目中也是很头疼,好不容意弄出来和大家分享一下,很简单就两步就可以了:
第一步:在app下的build.gradle里配置:
apply plugin: 'com.android.application'
//添加的第一处
apply plugin: 'com.neenbedankt.android-apt'
def AAVersion = '3.0.1'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "test.gzy.qqtest"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.squareup.okhttp:okhttp:2.4.0'
//第二处
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
}
//第三处
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
resourcePackageName 'ctest.gzy.qqtest'//这个地方的resourcePackageName要与applicationId(项目包名)一致
}
}
第二步:配置工程下的build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
//添加
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
allprojects {
repositories {
jcenter()
}
最后build一下gradle即可
- Andorid 配置 Annotations
- Hibernate annotations 配置
- Hibernate Annotations配置映射
- Android Annotations 配置
- Android Studio 配置Annotations
- Android Studio配置Annotations
- spring 2.5 annotations配置ehcache
- Android Studio 配置 android annotations
- Android Annotations配置与使用
- Annotations
- Annotations
- Andorid环境配置及其测试
- andorid studio 配置NDK环境
- Spring 3 ehcache -spring-annotations 配置过程.
- Android Annotations在Eclipse下配置
- Android Studio1.5 配置Android annotations
- Android Studio中配置 Android annotations
- Intellij IDEA配置Android Annotations注解框架
- Java基本类型与byte数组之间相互转换
- 身份证正则法则
- 硬件调试
- 【备份】Java实现忽略SSL认证请求https
- 315. Count of Smaller Numbers After Self
- Andorid 配置 Annotations
- c_str()
- 可自动切换的轮播图(包含位置指示)
- Android 数据存储之SharedPreferences存储小记
- Runtime全方位装逼指南
- 磐优—— 抬走,下一个!
- cf348E
- 超级简单的maven安装配置教程
- lintcode----加一