Skip to content

Instantly share code, notes, and snippets.

import javax.swing.UIManager
import groovy.ui.Console
import org.codehaus.groovy.control.CompilerConfiguration
import org.codehaus.groovy.control.customizers.ASTTransformationCustomizer
import groovy.transform.*
def transformations = [ThreadInterrupt, Canonical]
Console.metaClass.newScript = { ClassLoader parent, Binding binding ->
def config = new CompilerConfiguration()
@bluepapa32
bluepapa32 / emma.gradle
Created June 13, 2011 16:49
Gradle で EMMA してみる
configurations {
emma
}
dependencies {
emma "emma:emma:2.1.5320"
emma "emma:emma_ant:2.1.5320"
}
tmpDir = new File(buildDir, "tmp")
def getMD5(File file) {
new AntBuilder().with{
checksum(file: file, algorithm: 'MD5', property: 'result')
it.project.properties.result
}
}
println getMD5(new File(args[0]))
@bluepapa32
bluepapa32 / Native2AsciiPlugin.groovy
Created February 2, 2011 14:38
com.bluepapa32.gradle.plugins.Native2AsciiPlugin
package com.bluepapa32.gradle.plugins
import org.apache.tools.ant.filters.EscapeUnicode
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaBasePlugin
public class Native2AsciiPlugin implements Plugin<Project> {
def void apply(Project project) {
project.getPlugins().apply(JavaBasePlugin.class);