Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
initial version of GORM rest-client plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Aug 27, 2013
1 parent d2d24fa commit 5defe10
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 0 deletions.
68 changes: 68 additions & 0 deletions grails-plugins/rest-client/GormRestClientGrailsPlugin.groovy
@@ -0,0 +1,68 @@
/* Copyright (C) 2013 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.grails.datastore.gorm.rest.client.plugin.support.*

/**
* @author Graeme Rocher
*/
class GormRestClientGrailsPlugin {
// the plugin version
def version = "1.0.0.M1"
// the version or versions of Grails the plugin is designed for
def grailsVersion = "2.3 > *"
// resources that are excluded from plugin packaging
def pluginExcludes = [
"grails-app/views/error.gsp"
]

def title = "GORM Rest Client Plugin" // Headline display name of the plugin
def author = "Graeme Rocher"
def authorEmail = "graeme.rocher@gmail.com"
def description = '''\
A GORM implementation that can back onto a REST web service
'''

// URL to the plugin's documentation
def documentation = "http://grails.org/plugin/gorm-rest-client"

// Extra (optional) plugin metadata

// License: one of 'APACHE', 'GPL2', 'GPL3'
def license = "APACHE"

// Details of company behind the plugin (if there is one)
def organization = [ name: "SpringSource", url: "http://www.springsource.com/" ]

// Any additional developers beyond the author specified above.
def developers = [ [ name: "Graeme Rocher", email: "graeme.rocher@gmail.com" ]]

// Location of the plugin's issue tracker.
def issueManagement = [ system: "JIRA", url: "http://jira.grails.org/browse/GRAILS" ]

// Online location of the plugin's browseable source code.
def scm = [ url: "https://github.com/SpringSource/grails-data-mapping" ]

def doWithSpring = new RestClientSpringConfigurer().getConfiguration()

def doWithDynamicMethods = { ctx ->
def datastore = ctx.mongoDatastore
def transactionManager = ctx.restClientTransactionManager
def methodsConfigurer = new RestClientMethodsConfigurer(datastore, transactionManager)
methodsConfigurer.hasExistingDatastore = manager.hasGrailsPlugin("hibernate")
def foe = application?.config?.grails?.gorm?.failOnError
methodsConfigurer.failOnError = foe instanceof Boolean ? foe : false
methodsConfigurer.configure()
}
}
4 changes: 4 additions & 0 deletions grails-plugins/rest-client/application.properties
@@ -0,0 +1,4 @@
#Grails Metadata file
#Tue Aug 27 15:15:35 CEST 2013
app.grails.version=2.3.0.RC2
app.name=gorm-rest-client
69 changes: 69 additions & 0 deletions grails-plugins/rest-client/grails-app/conf/BuildConfig.groovy
@@ -0,0 +1,69 @@
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"

grails.project.fork = [
// configure settings for compilation JVM, note that if you alter the Groovy version forked compilation is required
// compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true],

// configure settings for the test-app JVM, uses the daemon by default
test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
// configure settings for the run-app JVM
run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the run-war JVM
war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the Console UI JVM
console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
]

grails.project.dependency.resolver = "maven" // or ivy
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
repositories {
grailsCentral()
mavenLocal()
mavenCentral()
// uncomment the below to enable remote dependency resolution
// from public Maven repositories
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}
dependencies {
def excludes = {
excludes "slf4j-simple", "persistence-api", "commons-logging", "jcl-over-slf4j", "slf4j-api", "jta"
excludes "spring-core", "spring-beans", "spring-aop", "spring-asm","spring-webmvc","spring-tx", "spring-context", "spring-web", "log4j", "slf4j-log4j12"
excludes group:"org.grails", name:'grails-core'
excludes group:"org.grails", name:'grails-gorm'
excludes group:"org.grails", name:'grails-test'
excludes group:'xml-apis', name:'xml-apis'
excludes 'ehcache-core'
transitive = false
}


def restClientDatastoreVersion = "1.0.0.M1"
def datastoreVersion = "2.0.0.RC2"

compile ("org.grails:grails-datastore-rest-client:$restClientDatastoreVersion",
"org.grails:grails-datastore-gorm-rest-client:$restClientDatastoreVersion",excludes)
compile("org.grails:grails-datastore-gorm-plugin-support:$datastoreVersion",
"org.grails:grails-datastore-gorm:$datastoreVersion",
"org.grails:grails-datastore-core:$datastoreVersion",
"org.grails:grails-datastore-web:$datastoreVersion",excludes)

runtime 'org.javassist:javassist:3.16.1-GA'
}

plugins {
build(":release:3.0.0",
":rest-client-builder:1.0.3") {
export = false
}
}
}

0 comments on commit 5defe10

Please sign in to comment.