Permalink
Browse files

Gaelyk 2.2.0 preparation

  • Loading branch information...
musketyr committed Jun 3, 2015
1 parent 13e593f commit a534f1c047669ada083ed41e7d36d36c116080de
View
@@ -9,7 +9,7 @@ allprojects {
}
version = '2.2.0-SNAPSHOT'
version = '2.2.0'
group = 'org.gaelyk'
}
View
@@ -1,8 +1,8 @@
project.ext.gaelykGroovyVersion = '2.4.3'
project.ext.gaelykSpockVersion = '0.7-groovy-2.0'
project.ext.gaelykSpockVersion = '0.1-groovy-2.4'
project.ext.gaelykAppEngineVersion = '1.9.20'
project.ext.gaelykLatestVersion = '2.2'
project.ext.gaelykSpockLatestVersion = '0.4'
project.ext.gaelykLatestVersion = '2.2.0'
project.ext.gaelykSpockLatestVersion = '0.5'
project.ext.gaelykGradleVersion = '2.4'
repositories {
@@ -30,8 +30,6 @@ import com.google.appengine.api.xmpp.XMPPServiceFactory
import groovyx.gaelyk.logging.LoggerAccessor
import com.google.appengine.api.channel.ChannelServiceFactory
import com.google.appengine.api.files.FileServiceFactory
import com.google.appengine.api.backends.BackendServiceFactory
import com.google.appengine.api.LifecycleManager
import com.google.appengine.api.users.User
import com.google.appengine.api.prospectivesearch.ProspectiveSearchServiceFactory
@@ -98,11 +96,7 @@ class GaelykBindingEnhancer {
// Channel service in SDK 1.4.0 for Comet-style applications
binding.setVariable("channel", ChannelServiceFactory.channelService)
// Files service in SDK 1.4.3 for writing to the blobstore programmatically
binding.setVariable("files", FileServiceFactory.fileService)
// Backend service and Lifecycle manager in SDK 1.5.0
binding.setVariable("backends", BackendServiceFactory.backendService)
binding.setVariable("lifecycle", LifecycleManager.instance)
// Prospective search service in SDK 1.5.4
@@ -16,8 +16,6 @@
package groovyx.gaelyk
import com.google.appengine.api.LifecycleManager
import com.google.appengine.api.backends.BackendService
import com.google.appengine.api.backends.BackendServiceFactory
import com.google.appengine.api.blobstore.BlobstoreService
import com.google.appengine.api.blobstore.BlobstoreServiceFactory
import com.google.appengine.api.capabilities.CapabilitiesService
@@ -26,8 +24,6 @@ import com.google.appengine.api.channel.ChannelService
import com.google.appengine.api.channel.ChannelServiceFactory
import com.google.appengine.api.datastore.DatastoreService
import com.google.appengine.api.datastore.DatastoreServiceFactory
import com.google.appengine.api.files.FileService
import com.google.appengine.api.files.FileServiceFactory
import com.google.appengine.api.mail.MailService
import com.google.appengine.api.mail.MailServiceFactory
import com.google.appengine.api.memcache.MemcacheService
@@ -98,8 +94,6 @@ class GaelykBindingsTransformation implements ASTTransformation {
addGetterIfNotExists(parent, OAuthService, "getOauth", OAuthServiceFactory, "getOAuthService")
addGetterIfNotExists(parent, CapabilitiesService, "getCapabilities", CapabilitiesServiceFactory, "getCapabilitiesService")
addGetterIfNotExists(parent, ChannelService, "getChannel", ChannelServiceFactory, "getChannelService")
addGetterIfNotExists(parent, FileService, "getFiles", FileServiceFactory, "getFileService")
addGetterIfNotExists(parent, BackendService, "getBackends", BackendServiceFactory, "getBackendService")
addGetterIfNotExists(parent, LifecycleManager, "getLifecycle", LifecycleManager, "getInstance")
addGetterIfNotExists(parent, ProspectiveSearchService, "getProspectiveSearch", ProspectiveSearchService, "getProspectiveSearchService")
addGetterIfNotExists(parent, User, "getUser", GaelykBindingEnhancer, "getCurrentUser")
@@ -41,7 +41,7 @@ import org.codehaus.groovy.runtime.InvokerInvocationException
*/
class GaelykTemplateServlet extends TemplateServlet {
private static final String PRECOMPILED_TEMPLATE_PREFIX = '$gtpl$'
private static final String PRECOMPILED_TEMPLATE_PREFIX = '_gtpl_'
private boolean preferPrecompiled = false
private boolean logErrors
@@ -182,7 +182,7 @@ class GaelykTemplateServlet extends TemplateServlet {
ret += packageToDir(match[0][1])
}
ret += PRECOMPILED_TEMPLATE_PREFIX
ret += match[0][3]
ret += match[0][3].replaceAll(/[^a-zA-Z0-9\$]/, '_')
ret
}
@@ -1,57 +0,0 @@
/*
* Copyright 2009-2012 the original author or 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.
*/
package groovyx.gaelyk.extensions;
import org.codehaus.groovy.runtime.DefaultGroovyMethods;
import groovy.lang.Closure;
import groovy.lang.DelegatesTo;
import com.google.appengine.api.LifecycleManager;
import com.google.appengine.api.ThreadManager;
import com.google.appengine.api.backends.BackendService;
/**
* Backend service extension methods.
*
* @author Guillaume Laforge, Vladmir Orany
*/
public class BackendExtensions {
/**
* Shortcut to use closures as shutdown hooks.
* <pre><code>
* lifecycle.shutdownHook = { ...shutdown logic... }
* </code></pre>
*
* @param manager the lifecycle manager
* @param c the closure as shutdown hook
*/
public static void shutdownHook(LifecycleManager manager, @DelegatesTo(LifecycleManager.ShutdownHook.class) Closure<?> c) {
manager.setShutdownHook(DefaultGroovyMethods.asType(c, LifecycleManager.ShutdownHook.class));
}
/**
* Runs code in the background thread.
*
* @param the code supposed to run in background thread
*/
public static Thread run(BackendService backends, Runnable code){
Thread thread = ThreadManager.createBackgroundThread(code);
thread.start();
return thread;
}
}
Oops, something went wrong.

0 comments on commit a534f1c

Please sign in to comment.