Skip to content

Commit 115977d

Browse files
committed
Merge branch '3.0.x' into 3.1.x
2 parents 776e0cc + 927a655 commit 115977d

File tree

17 files changed

+432
-277
lines changed

17 files changed

+432
-277
lines changed

grails-bootstrap/src/main/groovy/grails/util/Environment.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,11 @@ public static boolean isWarDeployed() {
292292
if(loadedLocation != null && loadedLocation.getPath().contains("/WEB-INF/classes")) {
293293
return true;
294294
}
295+
// Workaround for weblogic who repacks files from 'classes' into a new jar under lib/
296+
if (loadedLocation != null && loadedLocation.getPath().contains("_wl_cls_gen.jar!/")) {
297+
return true;
298+
}
295299
return false;
296-
297300
}
298301

299302
/**

grails-core/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ dependencies {
1616
compile("org.springframework:spring-context:${springVersion}") {
1717
exclude group: 'commons-logging', module:'commons-logging'
1818
}
19+
testCompile("org.springframework:spring-jdbc:${springVersion}") {
20+
exclude group: 'commons-logging', module:'commons-logging'
21+
}
22+
testRuntime 'com.h2database:h2:1.3.176'
23+
1924
provided("org.springframework:spring-test:${springVersion}") {
2025
exclude group: 'commons-logging', module:'commons-logging'
2126
}

grails-core/src/main/groovy/org/grails/config/yaml/YamlPropertySourceLoader.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,4 @@ class YamlPropertySourceLoader extends YamlProcessor implements PropertySourceLo
113113
return null
114114
}
115115

116-
117116
}

grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public AbstractGrailsPlugin(Class<?> pluginClass, GrailsApplication application)
9393
try {
9494
if (filename.equals(PLUGIN_YML)) {
9595
YamlPropertySourceLoader propertySourceLoader = new YamlPropertySourceLoader();
96-
this.propertySource = propertySourceLoader.load(GrailsNameUtils.getLogicalPropertyName(pluginClass.getSimpleName(), "GrailsPlugin") + "-" + PLUGIN_YML, resource, null, false, DEFAULT_CONFIG_IGNORE_LIST);
96+
this.propertySource = propertySourceLoader.load(GrailsNameUtils.getLogicalPropertyName(pluginClass.getSimpleName(), "GrailsPlugin") + "-" + PLUGIN_YML, resource, null, true, DEFAULT_CONFIG_IGNORE_LIST);
9797
} else if (filename.equals(PLUGIN_GROOVY)) {
9898
GroovyConfigPropertySourceLoader propertySourceLoader = new GroovyConfigPropertySourceLoader();
9999
this.propertySource = propertySourceLoader.load(GrailsNameUtils.getLogicalPropertyName(pluginClass.getSimpleName(), "GrailsPlugin") + "-" + PLUGIN_GROOVY, resource, null, DEFAULT_CONFIG_IGNORE_LIST);

grails-core/src/main/groovy/org/grails/plugins/BinaryGrailsPlugin.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import grails.core.GrailsApplication;
1919
import grails.io.IOUtils;
20+
import grails.io.ResourceUtils;
2021
import grails.plugins.exceptions.PluginException;
2122
import org.grails.core.io.StaticResourceLoader;
2223
import org.springframework.core.io.Resource;
@@ -52,7 +53,6 @@ public class BinaryGrailsPlugin extends DefaultGrailsPlugin {
5253
private final Map<String, Class> precompiledViewMap = new HashMap<String, Class>();
5354
private final Resource baseResource;
5455
private final Resource baseResourcesResource;
55-
private final String baseResourceString;
5656
private final boolean isJar;
5757
private final File projectDirectory;
5858

@@ -72,12 +72,10 @@ public BinaryGrailsPlugin(Class<?> pluginClass, BinaryGrailsPluginDescriptor des
7272
}
7373
this.baseResource = new UrlResource(rootResource);
7474
try {
75-
this.baseResourceString = baseResource.getURL().toString();
75+
this.isJar = ResourceUtils.isJarURL(baseResource.getURL());
7676
} catch (IOException e) {
7777
throw new PluginException("Cannot evaluate plugin location for plugin " + pluginClass, e);
7878
}
79-
80-
this.isJar = baseResourceString.startsWith("jar:");
8179
this.projectDirectory = isJar ? null : IOUtils.findApplicationDirectoryFile(pluginClass);
8280

8381
URL rootResourcesURL = IOUtils.findRootResourcesURL(pluginClass);

grails-core/src/main/groovy/org/grails/transaction/transform/TransactionalTransform.groovy

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,11 @@ class TransactionalTransform implements ASTTransformation{
308308

309309
methodNode.setCode(null)
310310
classNode.addMethod(renamedMethodNode)
311-
312-
processVariableScopes(source, classNode, renamedMethodNode)
313-
311+
312+
if( !isSpockTest(classNode) ) {
313+
processVariableScopes(source, classNode, renamedMethodNode)
314+
}
315+
314316
final originalMethodCall = new MethodCallExpression(new VariableExpression("this"), renamedMethodName, new ArgumentListExpression(renamedMethodNode.parameters))
315317
originalMethodCall.setImplicitThis(false)
316318
originalMethodCall.setMethodTarget(renamedMethodNode)

0 commit comments

Comments
 (0)