모바일/Android

Groovy 예제

늘근이 2017. 1. 14. 11:38

https://www.tutorialspoint.com/gradle/gradle_running_a_build.htm


apply plugin: GreetingPlugin

greeting {
   message = 'Hi'
   greeter = 'Gradle'
}

class GreetingPlugin implements Plugin<Project> {
   void apply(Project project) {
      project.extensions.create("greeting", GreetingPluginExtension)
  
      project.task('hello') << {
         println "${project.greeting.message} from ${project.greeting.greeter}"
      }
   }
}

class GreetingPluginExtension {
   String message
   String greeter
}



1gradle –q help –task <task name>Provides the usage information (such as path, type, description, group) about a specific task or multiple tasks.
2gradle –q dependenciesProvides a list of dependencies of the selected project.
3gradle -q api:dependencies --configuration <task name>Provides the list of limited dependencies respective to configuration.
4gradle –q buildEnvironmentProvides the list of build script dependencies.
5gradle –q dependencyInsightProvides an insight into a particular dependency.
6Gradle –q propertiesProvides the list of properties of the selected project.