Permalink
Browse files

Revert "Revert "introduce new configuration option that disables pars…

…ing of dependencies.groovy completely so that only POM data is used. Parsing dependencies.groovy is disabled by default for new applications.""

This reverts commit 2758a05.
  • Loading branch information...
1 parent 2758a05 commit fcdafd509a967974a88f6443492f92f017857a33 @jeffbrown jeffbrown committed Dec 7, 2012
View
11 grails-bootstrap/src/main/groovy/grails/util/BuildSettings.groovy
@@ -1342,11 +1342,14 @@ class BuildSettings extends AbstractBuildSettings {
try {
Script script = gcl.parseClass(pluginDependencyDescriptor)?.newInstance()
def pluginConfig = pluginSlurper.parse(script)
- def pluginDependencyConfig = pluginConfig.grails.project.dependency.resolution
- if (pluginDependencyConfig instanceof Closure) {
- def excludeRules = pdd ? pdd.getExcludeRules(dependencyManager.configurationNames) : [] as ExcludeRule[]
- dependencyManager.parseDependencies(pluginName, pluginDependencyConfig, excludeRules)
+ if(dependencyManager.isLegacyResolve()) {
+ def pluginDependencyConfig = pluginConfig.grails.project.dependency.resolution
+ if (pluginDependencyConfig instanceof Closure) {
+ def excludeRules = pdd ? pdd.getExcludeRules(dependencyManager.configurationNames) : [] as ExcludeRule[]
+
+ dependencyManager.parseDependencies(pluginName, pluginDependencyConfig, excludeRules)
+ }
}
def inlinePlugins = getInlinePluginsFromConfiguration(pluginConfig, dir)
View
14 ...trap/src/main/groovy/org/codehaus/groovy/grails/resolve/AbstractIvyDependencyManager.java
@@ -145,6 +145,7 @@
protected final IvySettings ivySettings;
protected final BuildSettings buildSettings;
protected final Metadata metadata;
+ protected boolean legacyResolve = true;
private boolean offline;
private ChainResolver chainResolver;
@@ -168,6 +169,19 @@ public AbstractIvyDependencyManager(IvySettings ivySettings, BuildSettings build
updateChangingPattern();
}
+ /**
+ * Whether the legacy approach of parsing dependencies.groovy in addition to pom.xml should be used during dependency resolution
+ *
+ * @return True if it should
+ */
+ public boolean isLegacyResolve() {
+ return legacyResolve;
+ }
+
+ public void setLegacyResolve(boolean legacyResolve) {
+ this.legacyResolve = legacyResolve;
+ }
+
public ResolveEngine getResolveEngine() {
return resolveEngine;
}
View
3 ...s-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/PluginInstallEngine.groovy
@@ -468,12 +468,13 @@ You cannot upgrade a plugin that is configured via BuildConfig.groovy, remove th
}
protected void resolvePluginJarDependencies(fullPluginName, pluginName, pluginInstallPath, Map runtimeDependencies = [:]) {
+ IvyDependencyManager dependencyManager = settings.dependencyManager
+ if(!dependencyManager.isLegacyResolve()) return;
def pluginDependencyDescriptor = new File("$pluginInstallPath/dependencies.groovy")
if (pluginDependencyDescriptor.exists() && !settings.isDependenciesExternallyConfigured()) {
eventHandler "StatusUpdate", "Resolving plugin JAR dependencies"
def callable = settings.pluginDependencyHandler()
callable.call(new File("$pluginInstallPath"))
- IvyDependencyManager dependencyManager = settings.dependencyManager
dependencyManager.resetGrailsPluginsResolver()
def dependencyConfigurationsToAdd = [IvyDependencyManager.RUNTIME_CONFIGURATION, IvyDependencyManager.BUILD_CONFIGURATION, IvyDependencyManager.PROVIDED_CONFIGURATION]
View
5 ...groovy/org/codehaus/groovy/grails/resolve/config/DependencyConfigurationConfigurer.groovy
@@ -31,6 +31,7 @@ class DependencyConfigurationConfigurer extends AbstractDependencyManagementConf
boolean pluginMode = false
boolean repositoryMode = false
+ boolean legacyResolve = true
DependencyConfigurationConfigurer(DependencyConfigurationContext context) {
super(context)
@@ -40,6 +41,10 @@ class DependencyConfigurationConfigurer extends AbstractDependencyManagementConf
dependencyManager.ivySettings.setVariable("ivy.checksums", checksumConfig)
}
+ void legacyResolve(boolean lr) {
+ dependencyManager.setLegacyResolve(lr)
+ }
+
void checksums(boolean enable) {
if (!enable) {
dependencyManager.ivySettings.setVariable("ivy.checksums", "")
View
1 grails-resources/src/grails/grails-app/conf/BuildConfig.groovy
@@ -19,6 +19,7 @@ grails.project.dependency.resolution = {
}
log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
+ legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility
repositories {
inherits true // Whether to inherit repository definitions from plugins
View
1 grails-resources/src/grails/plugin/grails-app/conf/BuildConfig.groovy
@@ -9,6 +9,7 @@ grails.project.dependency.resolution = {
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
+ legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility
repositories {
grailsCentral()
// uncomment the below to enable remote dependency resolution

0 comments on commit fcdafd5

Please sign in to comment.