SonaQube is great tool for monitoring quality of source code.

Gradle projects can be easily integrated with SonarQube by Sonar Runner Plugin.

You can start analysis by command:

gradle sonarRunner

This works perfectly on command line, but execution by Bamboo CI terminates with following error:

ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Missing commit 4a3e...237f

The problem is that Bamboo creates shallow git clones by default. You can find this options under Repositories tab – Advanced options.

Solution: disable “Use shallow clones” options and start job again.

Correct configuration:

stash-shallow-clone

Result: 🙂

build-success

The idea behind unconference is that attendees create and plan content.

Y Soft and Kentico were discussing possibility to host unconference in Brno.

How we organized it?

20150305-unconference-introduction

We presented rules of unconference to attendees:

1. Planning

  • submit your topic for discussion
  • place topic which you like onto the planning board
  • join similar topics into one topic

2. Unconference

  • topic owner should kick-off discussion
  • enjoy the discussion
  • feel free to leave room when you do not find topic interesting and join other group

We made 3 iterations of topic discussion. Duration of each iteration was 20 minutes followed by 10 minutes break.

unconference-board

We were running 3-4 parallel tracks and many discussions were happening in corridors.

What was the feedback? It was positive. Attendees liked opportunity to learn about challenges or experience from the other company.

Attendees suggested that discussion time should be longer. Twenty minutes were not enough to dive deeply into the topic.

We’re looking forward to attend next unconference with our friends from Kentico.

Major feature of Gradle is extensibility. Developer can store common logic in a custom task class.

class GreetingTask extends DefaultTask {
    String greeting = 'hello from Y Soft'

    @TaskAction
    def greet() {
        println greeting
    }
}

task hello(type: GreetingTask)

// Customize the greeting
task greeting(type: GreetingTask) {
    greeting = 'greetings from Brno'
}

It’s not very flexible approach. All classes and the build logic are stored together in one build.gradle file.

It’s possible to move classes into separate Groovy files in buildSrc. Here is the description of transformation process.

Step 1. Create directory buildSrc/main/main/groovy/PACKAGE. E.g.: buildSrc/src/main/groovy/com/ysoft/greeting.

Step 2. Move custom class from build.gradle to GreetingTask.groovy in buildSrc/…/greeting directory.

Step 3. Add package declaration and imports from Gradle API to GreetingTask.groovy.

package com.ysoft.greeting

import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction

class GreetingTask extends DefaultTask {
    String greeting = 'hello from Y Soft'

    @TaskAction
    def greet() {
        println greeting
    }
}

Step 4. Update build.gradle, add groovy plugin and import of the custom class.

apply plugin: 'groovy'

import com.ysoft.greeting.GreetingTask

task hello(type: GreetingTask)

task greeting(type: GreetingTask) {
    greeting = 'greetings from Brno'
}

Alternatively you can use full package name with class name when specifying task type. In that case you can omit import.

Step 5. Type ‘gradle tasks’ and enjoy.

You can find examples of custom tasks at our GitHub.

It’s quite easy to install Docker on Windows. Just download installer and follow instructions.

You might encounter following error message when starting Docker image: VT-X is not available.

hyperv-docker-vbox-problem

The cause of this failure is enabled Hyper-V Windows Feature. We described this issue in previous article.

Here is the quick fix.

Search for “windows feature” and open “Turn Windows features on or off
turn-off-windows-feature

Search for “Hyper-V” in Windows features and uncheck it.

hyper-v-disableClick OK and reboot the machine.