Advertisement
Guest User

Untitled

a guest
Apr 6th, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 1.30 KB | None | 0 0
  1. apply plugin: 'com.android.application'
  2. apply plugin: GreetingPlugin
  3.  
  4. android {
  5.     compileSdkVersion 25
  6.     buildToolsVersion "25.0.2"
  7.     defaultConfig {
  8.         applicationId "com.incentive.customplugin"
  9.         minSdkVersion 21
  10.         targetSdkVersion 25
  11.         versionCode 1
  12.         versionName "1.0"
  13.         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  14.     }
  15.     buildTypes {
  16.         release {
  17.             minifyEnabled false
  18.             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  19.         }
  20.     }
  21. }
  22.  
  23. dependencies {
  24.     compile fileTree(dir: 'libs', include: ['*.jar'])
  25.     androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  26.         exclude group: 'com.android.support', module: 'support-annotations'
  27.     })
  28.     compile 'com.android.support:appcompat-v7:25.3.1'
  29.     testCompile 'junit:junit:4.12'
  30.     compile 'com.android.support.constraint:constraint-layout:1.0.2'
  31. }
  32.  
  33.  
  34. class GreetingPlugin implements Plugin<Project> {
  35.     void apply(Project project) {
  36.         project.android.productFlavors.create("name")
  37.         project.android.applicationVariants.all { variant -> println(variant.getName()) }
  38.     }
  39. }
  40.  
  41. In console:
  42.  
  43. nameDebug
  44. nameRelease
  45.  
  46. Screenshot: https://goo.gl/x1rCz7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement