diff --git a/grammars.yml b/grammars.yml index 10361eef..cc5cb6eb 100644 --- a/grammars.yml +++ b/grammars.yml @@ -137,6 +137,8 @@ https://github.com/fsharp/fsharpbinding: - source.fsharp https://github.com/gingerbeardman/monkey.tmbundle: - source.monkey +https://github.com/alkemist/gradle.tmbundle: +- source.groovy.gradle https://github.com/guillermooo/dart-sublime-bundle/raw/master/Dart.tmLanguage: - source.dart https://github.com/harrism/sublimetext-cuda-cpp/raw/master/cuda-c%2B%2B.tmLanguage: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index cc124e04..afaf689a 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -968,6 +968,12 @@ Grace: - .grace tm_scope: none +Gradle: + type: data + extensions: + - .gradle + tm_scope: source.groovy.gradle + Grammatical Framework: type: programming aliases: diff --git a/samples/Gradle/build.gradle b/samples/Gradle/build.gradle new file mode 100644 index 00000000..190eb3f6 --- /dev/null +++ b/samples/Gradle/build.gradle @@ -0,0 +1,18 @@ +apply plugin: GreetingPlugin + +greeting.message = 'Hi from Gradle' + +class GreetingPlugin implements Plugin { + void apply(Project project) { + // Add the 'greeting' extension object + project.extensions.create("greeting", GreetingPluginExtension) + // Add a task that uses the configuration + project.task('hello') << { + println project.greeting.message + } + } +} + +class GreetingPluginExtension { + def String message = 'Hello from GreetingPlugin' +} diff --git a/samples/Gradle/builder.gradle b/samples/Gradle/builder.gradle new file mode 100644 index 00000000..342be2fd --- /dev/null +++ b/samples/Gradle/builder.gradle @@ -0,0 +1,20 @@ +apply plugin: GreetingPlugin + +greeting { + message = 'Hi' + greeter = 'Gradle' +} + +class GreetingPlugin implements Plugin { + 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 +}