How to set up compile library in android studio. LOMBOK

前端 未结 4 1751
情话喂你
情话喂你 2020-12-31 06:35

Help me to set up comile dependencies in Android Studio in build.gradle. I mean that they not include into final APK.

this build.gradle works fine but i don\'t need

4条回答
  •  情话喂你
    2020-12-31 06:58

    The ability to do this was just added to the v0.8 Android-Gradle plugin, which you can use if you're running Android Studio 0.4.3 (which is available on the canary update channel).

    It's mentioned in the release notes and a thread on the adt-dev mailing list

    You specify it like this:

    dependencies {
        provided 'org.projectlombok:lombok:1.12.2'
    }
    

    I've filed bug https://code.google.com/p/android/issues/detail?id=65216 to request the ability to edit this through the Dependencies panel in the Project Structure dialog; for the moment you have to edit your build.gradle file by hand to use this.

    As for whether you can put it in the top-level build.gradle file to have it apply to all modules, I'm not certain. I tried putting it in the allprojects block, but Gradle told me that the default dependency handler didn't know what to do with it. So I'm guessing no, but if I get other information, I'll update this answer.

提交回复
热议问题