码迷,mamicode.com
首页 > 移动开发 > 详细

Android框架之AndroidAnnotations实战

时间:2015-07-23 06:34:31      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:

  第一步:

    下载 androidannotations-bundle-3.3.2.zip

 

  第二不:

      楼主选用开发环境:android studio

    新建项目  修改app 下的build.gradle

    对应的是Gradle选项

      

  

apply plugin: ‘com.android.application‘
apply plugin: ‘android-apt‘
def AAVersion = ‘3.3.2‘

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        // replace with the current version of the Android plugin
        classpath ‘com.android.tools.build:gradle:1.2.3‘
        // replace with the current version of the android-apt plugin
        classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.4‘
    }
}

repositories {
    mavenCentral()
    mavenLocal()
}

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc2"

    defaultConfig {
        applicationId "com.androidannotations"
        minSdkVersion 14
        targetSdkVersion 22
        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:22.2.0‘
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
}

apt {
    arguments {
        androidManifestFile variant.outputs[0].processResources.manifestFile
        // if you have multiple outputs (when using splits), you may want to have other index than 0

        // you should set your package name here if you are using different application IDs
        // resourcePackageName "your.package.name"

        // You can set optional annotation processing options here, like these commented options:
        // logLevel ‘INFO‘
        // logFile ‘/var/log/aa.log‘
    }
}

 

  

Android框架之AndroidAnnotations实战

标签:

原文地址:http://www.cnblogs.com/Free-Wind/p/4669109.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!