How to add a function to android.defaultConfig with a Gradle plugin?
问题 I want to create a Gradle plugin which adds functions to the Android Gradle plugin. I want to add a getGreeting function to android.defaultConfig such as outlined here - but via a plugin: // build.gradle android { defaultConfig { def getGreeting = { name -> return "Hello ${name}" } } } I started preparing the Groovy project in general. Now I am at this point: package com.example.myexample import com.android.build.gradle.AppPlugin import com.android.build.gradle.LibraryPlugin import org.gradle