美文网首页
Dagger2安装

Dagger2安装

作者: lyzaijs | 来源:发表于2016-03-20 15:23 被阅读130次
    1. 配置APT
    buildscript {
    repositories {
    jcenter()
    mavenCentral()
    maven {
    url "https://oss.sonatype.org/content/repositories/snapshots"
    }
    }
    dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-beta5'
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    classpath 'com.frogermcs.androiddevmetrics:androiddevmetrics-plugin:0.3.1'
    }
    }
    allprojects {
    repositories {
    jcenter()
    mavenCentral()
    maven {
    url "https://oss.sonatype.org/content/repositories/snapshots"
    }
    }
    }
    
    1. 配置Dagger2
    apply plugin: 'com.android.application'
    apply plugin: 'com.neenbedankt.android-apt'
    
    
    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.2"
    
        defaultConfig {
            applicationId "frogermcs.io.githubclient"
            minSdkVersion 15
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
    
            testInstrumentationRunner 'frogermcs.io.githubclient.MyTestRunner'
        }
        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.1.1'
    
        //Dagger 2
        compile 'com.google.dagger:dagger:2.1'
        compile 'com.google.dagger:dagger-producers:2.1'
        apt 'com.google.dagger:dagger-compiler:2.1'
    
    
        androidTestCompile 'com.android.support:support-annotations:23.1.1'
        androidTestCompile 'junit:junit:4.12'
        
    }
    

    相关文章

      网友评论

          本文标题:Dagger2安装

          本文链接:https://www.haomeiwen.com/subject/gxfklttx.html