This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GrabResolver(name='grails-core', root='http://repo.grails.org/grails/core') | |
@Grab(group='org.grails', module='grails-datastore-gorm-mongo', version='1.0.0.BUILD-SNAPSHOT') | |
@Grab(group='org.slf4j', module='slf4j-simple', version='1.6.1') | |
import grails.persistence.* | |
import org.grails.datastore.gorm.mongo.config.* | |
MongoDatastoreConfigurer.configure("myDatabase", Book) | |
Book.withSession { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################ | |
# Dockerfile to run Groovy containers | |
# Based on Java 8 image | |
################################################ | |
FROM java:8u40-jdk | |
MAINTAINER Cédric Champeau | |
RUN apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bundle groovy = Platform.getBundle("org.codehaus.groovy"); | |
final GroovyClassLoader transformLoader = new GroovyClassLoader(groovy.adapt(BundleWiring.class).getClassLoader()); | |
GroovyClassLoader loader = new GroovyClassLoader(getClass().getClassLoader()) { | |
@Override | |
protected CompilationUnit createCompilationUnit(CompilerConfiguration config, CodeSource source) { | |
return new CompilationUnit(config, source, this, transformLoader, true, null, null); | |
} | |
}; | |
Class<?> cl = loader.parseClass(new GroovyCodeSource(capellaScriptFile.getLocation().toFile(), capellaScriptFile.getCharset())); | |
InvokerHelper.runScript(cl, args); |