Страница 1 из 1

[Решено] Gradle. Как исправить/игнорировать warnings?

Добавлено: 07 июн 2014, 00:29
rezak90
При сборке Gradle выдает странные ошибки, не знаю как исправить. Использую Android Studio 0.5.9, Gradle 1.12
build.gradle

Код: Выделить всё

apply plugin: 'android'
apply plugin: 'android-test'
apply plugin: "jacoco"

repositories {
    maven { url '***' }
}

android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
        testPackageName "***"
        testInstrumentationRunner "android.test.InstrumentationTestRunner"
    }

    buildTypes {
        debug {
            packageNameSuffix ".debug"
            runProguard false
            testCoverageEnabled = true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }

    jacoco {
        version = '0.6.2.201302030002'
    }

    testOptions {
        resultsDir = "$project.buildDir/jacoco"
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile 'com.activeandroid:activeandroid:3.1'
    compile 'com.android.support:support-v4:19.1.0'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.google.android.gms:play-services:4.4.52'
    compile 'com.squareup.picasso:picasso:2.2.0'
    testCompile('org.mockito:mockito-all:1.9.5') {
        exclude module: 'hamcrest'
    }
    compile 'com.google.dexmaker:dexmaker-mockito:1.0'
    testCompile 'com.google.dexmaker:dexmaker:1.0'
    testCompile 'junit:junit:4.11'
    androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.1'
}
И выдает такие вот варнинги:
Information:Gradle tasks [:app:generateDebugSources]
Warning:Configuration on demand is an incubating feature.
Warning:Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
Warning:The Test.testReportDir property has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the Test.getReports().getHtml().getDestination() property instead.
:app:preBuild
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:preStageBuild
:app:prepareComGoogleAndroidGmsPlayServices4452Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
Information:BUILD SUCCESSFUL
Information:Total time: 6.457 secs
Information:0 errors
Information:3 warnings
Я так понял что это лишь предположения. Но может есть возможность отключить варнинги в градле? Еще могу предполагать что это из-за плагина com.squareup.gradle:gradle-android-test-plugin:0.9.0 так как всеми уважаемыми JakeWharton написал что плагин устарел и Don't use this. I have neither the time nor energy nor desire to maintain.
P.S. Замечаю в последнее время он во всех (или большинство) проектов пишет что у него нету времени, сил, желания сапортить и помечает все как Deprecated. Он редиска :(

Re: Gradle. Как исправить/игнорировать warnings?

Добавлено: 07 июн 2014, 02:19
rezak90
Сам спросил, сам ответил. В общем как я и предполагал - ошибка в плагине Джека. Редиска. Удалил плагин, переписал build.gradle:

Код: Выделить всё

apply plugin: 'android'
apply plugin: "jacoco"

repositories {
    maven { url '***' }
}

android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
        testPackageName "***"
        testInstrumentationRunner "android.test.InstrumentationTestRunner"
        testHandleProfiling true
        testFunctionalTest true
    }

    packagingOptions {
        exclude 'LICENSE.txt'
    }

    buildTypes {
        debug {
            packageNameSuffix ".debug"
            runProguard false
            testCoverageEnabled = true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
        test {
            packageNameSuffix ".test"
            runProguard false
            testCoverageEnabled = true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }

    jacoco {
        version = '0.6.2.201302030002'
    }

    testOptions {
        resultsDir = "$project.buildDir\\jacoco"

    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile 'com.activeandroid:activeandroid:3.1'
    compile 'com.android.support:support-v4:19.1.0'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.google.android.gms:play-services:4.4.52'
    compile 'com.squareup.picasso:picasso:2.2.0'
    compile('org.mockito:mockito-all:1.9.5') {
        exclude module: 'hamcrest'
    }
    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.0'
    androidTestCompile 'com.google.dexmaker:dexmaker:1.0'
    androidTestCompile 'junit:junit:4.11'
    androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.1'
}