Skip to content

Instantly share code, notes, and snippets.

@jwir3
Last active August 29, 2015 14:07
Show Gist options
  • Save jwir3/962f2aef235162b97381 to your computer and use it in GitHub Desktop.
Save jwir3/962f2aef235162b97381 to your computer and use it in GitHub Desktop.
gradle default task
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
compile gradleApi()
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task bumpVersion2(type: BumpVersionTask)
// Located at: buildSrc/src/main/groovy/BumpVersionTask.groovy
class BumpVersionTask extends DefaultTask {
@TaskAction
def bumpVersion(String aVersionString) {
println "***** DEBUG_jwir3: " + aVersionString
}
}
startup failed:
/Users/scottjohnson/Source/core-android/buildSrc/src/main/groovy/BumpVersionTask.groovy: 1: unable to resolve class DefaultTask
@ line 1, column 1.
class BumpVersionTask extends DefaultTask {
^
/Users/scottjohnson/Source/core-android/buildSrc/src/main/groovy/BumpVersionTask.groovy: 3: unable to resolve class TaskAction , unable to find class for annotation
@ line 3, column 3.
@TaskAction
^
2 errors
:buildSrc:compileGroovy FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileGroovy'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 6.0 secs
mustafar:core-android scottjohnson$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment