9

All of the tutorials I've read for Gradle explain that the build.gradle file should contain either:

apply plugin: 'android'

or

apply plugin: 'android-library'

However, I've just built a new project with Android Studio 0.8.6 and my build.gradle now has:

apply plugin: 'com.android.application'

  1. Is it purely a syntax change or is there some deeper purpose?
  2. What is the new syntax for creating an android library?
bcorso
  • 45,608
  • 10
  • 63
  • 75
  • 1
    You can find the names of `plugin`s in a `buildscript dependency`: `c:\Users\YourName\.gradle\caches\modules-2\files-2.1\com.android.tools.build\gradle\0.13.1\629eebffd224396c1a11029424a0495a32f9414\gradle-0.13.1.jar/META-INF/gradle-plugins` (your hashes and version may differ) – TWiStErRob Oct 09 '14 at 10:04

1 Answers1

10
  1. pure syntax change ( I think to avoid collisions / use a 'protected' namespace )
  2. com.android.library

this talk from the 2014 gradle summit sheds some more light on it: https://www.youtube.com/watch?v=A9Fn3ehhU-o from ~ min 15

ligi
  • 39,001
  • 44
  • 144
  • 244
  • 4
    There's a deeper purpose in that in the future the fully-qualified plugin name will suffice to find the plugin in a central Gradle plugin repository, eliminating the need for the buildscript/repositories/dependencies/classpath boilerplate required now. This is preparing the ground for that change. – Scott Barta Aug 18 '14 at 16:37
  • 1
    No, I was looking for a mention of it in the Gradle roadmap and didn't see it. Think of my comment as an idea for the future and not a commitment to a definite feature :) – Scott Barta Aug 18 '14 at 16:40
  • 1
    The Gradle plugin repository is already [online](http://plugins.gradle.org/). It was announced as part of the [Gradle 2.1-rc-1 release notes](http://www.gradle.org/docs/release-candidate/release-notes). – sschuberth Aug 24 '14 at 18:37
  • 1
    yea - but the android plugin is not yet in there – ligi Aug 24 '14 at 20:23