All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sysgears.grain.gradle.handlers.GrainTaskHandler.groovy Maven / Gradle / Ivy

Go to download

Gradle plugin for Grain general purpose static site generator which provides all the modern features and tools for generating any kind of HTML content.

There is a newer version: 0.2.1
Show newest version
package com.sysgears.grain.gradle.handlers

import com.sysgears.grain.gradle.GrainTask
import groovy.transform.TupleConstructor
import org.gradle.api.Project

/**
 * Creates Grain tasks and adds them to Gradle project.
 */
@TupleConstructor
class GrainTaskHandler {

    /** Gradle project to which the plugin is applied. */
    Project project

    def methodMissing(String name, args) {
        def settings = args[0]

        project.task(name, type: GrainTask) {
            group = settings.group ?: 'Grain'
            command = settings.command ?: ''
            arguments = settings.args ? settings.args.split(' ') : []
            jvmArguments = settings.opts ? settings.opts.split(' ') : []
            description = settings.description ?: ''
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy