Groovy for Domain-specific Languages - Second Edition
Essential Groovy DSLs [ 38 ] Creating task dependencies Any build tool is incomplete without the ability to create dependencies ...
Chapter 3 [ 39 ] Built-in tasks and plugins So far, we've looked at tasks we provide ourselves in the build script. While Gradle ...
Essential Groovy DSLs [ 40 ] This includes some useful tasks as follows: tasks: This lists available tasks as we've seen earlie ...
Chapter 3 [ 41 ] The Eclipse plugin The Eclipse plugin does exactly the same for Eclipse users. To generate a project setup to a ...
Essential Groovy DSLs [ 42 ] Dependencies The final section in our preceding build script declares the dependencies we need to r ...
Chapter 3 [ 43 ] Spock specification structure Spock specifications are written as a Groovy class that extends one of the core S ...
Essential Groovy DSLs [ 44 ] Here is a simple Spock test specification. The specification itself is a Groovy class extended from ...
Chapter 3 [ 45 ] For the most part, we can write whatever we like within the block itself. However, Spock applies some rules, wh ...
Essential Groovy DSLs [ 46 ] Fields Spock test specifications can contain class instance fields, which is a good place to store ...
Chapter 3 [ 47 ] Here is a slightly complex but very useful example of a use for fixture methods. We will go into more detail in ...
Essential Groovy DSLs [ 48 ] Together these fixtures and helper methods give us a neat way to test the expected outcome of runni ...
Chapter 3 [ 49 ] Fixture blocks Sometimes, we will have fixture data which is specific to a feature method and is not something ...
Essential Groovy DSLs [ 50 ] Further reading I encourage you to read the detailed documentation for both these tools at their re ...
[ 51 ] The Groovy Language In this chapter, we will conduct a whistle-stop tour of the Groovy language. We don't have the scope ...
The Groovy Language [ 52 ] To see how this works, let's take an example script and compile it with the Groovy compiler. We can u ...
Chapter 4 [ 53 ] In Java, we are used to the idiom of writing a single class per Java file. The previous style of coding is comm ...
The Groovy Language [ 54 ] Implicit imports Java automatically imports the java.lang package for you. Groovy goes a step further ...
Chapter 4 [ 55 ] If we have multiple statements on a line, a semicolon is required. The semicolon can still be left off the last ...
The Groovy Language [ 56 ] When method calls are nested, the parentheses are also needed to let the compiler distinguish between ...
Chapter 4 [ 57 ] Now, when we invoke, say as before we are retrieving the entry in the returned map for to which is a closure. W ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf