Skip to content

Commit

Permalink
Merge branch 'master' of github.com:grails/grails-core
Browse files Browse the repository at this point in the history
Conflicts:
	grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/fork/ForkedGrailsProcess.groovy
	grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/exceptions/DefaultStackTraceFilterer.java
	grails-core/src/main/groovy/org/codehaus/groovy/grails/project/packaging/GrailsProjectPackager.groovy
	grails-core/src/main/groovy/org/codehaus/groovy/grails/project/plugins/GrailsProjectPluginLoader.groovy
	grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/fork/ForkedTomcatServer.groovy
  • Loading branch information
graemerocher committed Jul 12, 2012
2 parents c5a0ebc + f6c1196 commit 79a3f96
Show file tree
Hide file tree
Showing 347 changed files with 2,688 additions and 3,666 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -11,7 +11,7 @@ Getting Started

You need a Java Development Kit (JDK) installed, but it is not necessary to install Groovy because it's bundled with the Grails distribution.

To install Grails, visit http://grails.org/Download and download the version you would like to use. Set a GRAILS_HOME environment variable to point to the root of the extracted download and add GRAILS_HOME/bin to your executable PATH. Then in a shell, type the following:
To install Grails, visit http://grails.org/Download and download the version you would like to use. Set a `GRAILS_HOME` environment variable to point to the root of the extracted download and add `GRAILS_HOME/bin` to your executable `PATH`. Then in a shell, type the following:

grails create-app sampleapp
cd sampleapp
Expand Down
8 changes: 5 additions & 3 deletions gradle/assemble.gradle
Expand Up @@ -63,7 +63,7 @@ task configurePopulateDependencies << {
populateDependencies.into("$dependency.group/$dependency.name/jars") {
from artifact.file // this will trigger the actual download if necessary
}

populateDependencies.from ("${metadata}/${dependency.group}/${dependency.name}/${dependency.version}") {
include "*.ivy.xml"
eachFile { it.path = "$dependency.group/$dependency.name/ivy-${dependency.version}.xml" }
Expand Down Expand Up @@ -94,7 +94,9 @@ task pluginsFromRepo {
tomcat: grailsVersion,
resources: "1.1.6",
webxml: "1.4.1",
jquery: "1.7.2"
jquery: "1.7.2",
'database-migration': "1.1",
cache: "1.0.0"
]

ext.dir = file("$buildDir/pluginsFromRepo")
Expand Down Expand Up @@ -137,7 +139,7 @@ task installResources(type: Copy) {
ant.copy(todir:projectDir) {
fileset(dir:"$buildDir/home-dir")
}

ant.chmod(dir: homeBinDir, perm: '755', includes: '*')
}

Expand Down
Expand Up @@ -19,17 +19,17 @@ class SimpleOrFileNameCompletor implements Completor {
}

SimpleOrFileNameCompletor(String[] fixedOptions) {
this.simpleCompletor = new SimpleCompletor(fixedOptions)
this.fileNameCompletor = new EscapingFileNameCompletor()
simpleCompletor = new SimpleCompletor(fixedOptions)
fileNameCompletor = new EscapingFileNameCompletor()
}

int complete(String buffer, int cursor, List candidates) {
// Try the simple completor first...
def retval = this.simpleCompletor.complete(buffer, cursor, candidates)
def retval = simpleCompletor.complete(buffer, cursor, candidates)

// ...and then the file path completor. By using the given candidate
// list with both completors we aggregate the results automatically.
def fileRetval = this.fileNameCompletor.complete(buffer, cursor, candidates)
def fileRetval = fileNameCompletor.complete(buffer, cursor, candidates)

// If the simple completor has matched, we return its value, otherwise
// we return whatever the file path matcher returned. This ensures that
Expand Down
Expand Up @@ -50,7 +50,7 @@
public class GrailsConsole {

private static GrailsConsole instance;

public static final String ENABLE_TERMINAL = "grails.console.enable.terminal";
public static final String ENABLE_INTERACTIVE = "grails.console.enable.interactive";
public static final String LINE_SEPARATOR = System.getProperty("line.separator");
Expand Down Expand Up @@ -154,7 +154,7 @@ private boolean isInteractiveEnabled() {
}

private boolean isActivateTerminal() {
return readPropOrTrue(ENABLE_TERMINAL);
return readPropOrTrue(ENABLE_TERMINAL);
}

private boolean readPropOrTrue(String prop) {
Expand Down
4 changes: 2 additions & 2 deletions grails-bootstrap/src/main/groovy/grails/util/BuildScope.java
Expand Up @@ -64,7 +64,7 @@ public static BuildScope getCurrent() {
* Returns whether the specified scope name(s) are valid given the current scope.
*
* @param scopeNames The list of scope names
* @return True if they are valid
* @return true if they are valid
*/
public static boolean isValid(String... scopeNames) {
BuildScope currentScope = getCurrent();
Expand All @@ -80,6 +80,6 @@ public static boolean isValid(String... scopeNames) {
* Enables this build scope as the curent system wide instance.
*/
public void enable() {
System.setProperty(KEY, this.toString());
System.setProperty(KEY, toString());
}
}
30 changes: 15 additions & 15 deletions grails-bootstrap/src/main/groovy/grails/util/BuildSettings.groovy
Expand Up @@ -1210,7 +1210,7 @@ class BuildSettings extends AbstractBuildSettings {
switch (e.eventType) {
case TransferEvent.TRANSFER_STARTED:
def resourceName = e.resource.name
if(!resourceName?.endsWith('plugins-list.xml')) {
if (!resourceName?.endsWith('plugins-list.xml')) {
resourceName = resourceName[resourceName.lastIndexOf('/') + 1..-1]
console.updateStatus "Downloading: ${resourceName}"
}
Expand Down Expand Up @@ -1291,14 +1291,14 @@ class BuildSettings extends AbstractBuildSettings {
// The logic here tries to establish if the plugin has been declared anywhere by the application. Only plugins that have
// been declared should have their transitive dependencies resolved. Unfortunately it is fairly complicated to establish what plugins are declared since
// there may be a mixture of plugins defined in BuildConfig, inline plugins and plugins installed via install-plugin
if(!isRegisteredInMetadata(pluginName) && notDefinedInBuildConfig(pluginName) && !isInlinePluginLocation(dir)) {
if (!isRegisteredInMetadata(pluginName) && notDefinedInBuildConfig(pluginName) && !isInlinePluginLocation(dir)) {
return
}

def pdd = dependencyManager.getPluginDependencyDescriptor(pluginName)
if(isInlinePluginLocation(dir) || (pdd && pdd.transitive)) {
if (isInlinePluginLocation(dir) || (pdd && pdd.transitive)) {
// bail out of the dependencies handled by external tool
if(isDependenciesExternallyConfigured()) return
if (isDependenciesExternallyConfigured()) return
// Try BuildConfig.groovy first, which should work
// work for in-place plugins.
def path = dir.absolutePath
Expand Down Expand Up @@ -1383,7 +1383,7 @@ class BuildSettings extends AbstractBuildSettings {

if (!projectTargetDirSet) {
projectTargetDir = new File(getPropertyValue(PROJECT_TARGET_DIR, props, "$baseDir/target"))
if(!projectTargetDir.absolute) {
if (!projectTargetDir.absolute) {
projectTargetDir = new File(baseDir, projectTargetDir.path)
}
}
Expand All @@ -1394,7 +1394,7 @@ class BuildSettings extends AbstractBuildSettings {
def warName = version ? "$baseDir/target/${appName}-${version}.war" : "$baseDir/target/${appName}.war"

projectWarFile = new File(getPropertyValue(PROJECT_WAR_FILE, props, warName))
if(!projectWarFile.absolute) {
if (!projectWarFile.absolute) {
projectWarFile = new File(baseDir, projectWarFile.path)
}
}
Expand All @@ -1414,38 +1414,38 @@ class BuildSettings extends AbstractBuildSettings {

if (!classesDirSet) {
classesDir = new File(getPropertyValue(PROJECT_CLASSES_DIR, props, "$projectWorkDir/classes"))
if(!classesDir.absolute) {
if (!classesDir.absolute) {
classesDir = new File(baseDir, classesDir.path)
}
}

if (!testClassesDirSet) {
testClassesDir = new File(getPropertyValue(PROJECT_TEST_CLASSES_DIR, props, "$projectWorkDir/test-classes"))
if(!testClassesDir.absolute) {
if (!testClassesDir.absolute) {
testClassesDir = new File(baseDir, testClassesDir.path)
}

}

if (!pluginClassesDirSet) {
pluginClassesDir = new File(getPropertyValue(PROJECT_PLUGIN_CLASSES_DIR, props, "$projectWorkDir/plugin-classes"))
if(!pluginClassesDir.absolute) {
if (!pluginClassesDir.absolute) {
pluginClassesDir = new File(baseDir, pluginClassesDir.path)
}

}

if (!pluginBuildClassesDirSet) {
pluginBuildClassesDir = new File(getPropertyValue(PROJECT_PLUGIN_BUILD_CLASSES_DIR, props, "$projectWorkDir/plugin-build-classes"))
if(!pluginBuildClassesDir.absolute) {
if (!pluginBuildClassesDir.absolute) {
pluginBuildClassesDir = new File(baseDir, pluginBuildClassesDir.path)
}

}

if (!pluginProvidedClassesDirSet) {
pluginProvidedClassesDir = new File(getPropertyValue(PROJECT_PLUGIN_PROVIDED_CLASSES_DIR, props, "$projectWorkDir/plugin-provided-classes"))
if(!pluginProvidedClassesDir.absolute) {
if (!pluginProvidedClassesDir.absolute) {
pluginProvidedClassesDir = new File(baseDir, pluginProvidedClassesDir.path)
}

Expand Down Expand Up @@ -1473,16 +1473,16 @@ class BuildSettings extends AbstractBuildSettings {

if (!testReportsDirSet) {
testReportsDir = new File(getPropertyValue(PROJECT_TEST_REPORTS_DIR, props, "${projectTargetDir}/test-reports"))
if(!testReportsDir.absolute) {
if (!testReportsDir.absolute) {
testReportsDir = new File(baseDir, testReportsDir.path)
}
}
}

if (!docsOutputDirSet) {
docsOutputDir = new File(getPropertyValue(PROJECT_DOCS_OUTPUT_DIR, props, "${projectTargetDir}/docs"))
if(!docsOutputDir.absolute) {
if (!docsOutputDir.absolute) {
docsOutputDir = new File(baseDir, docsOutputDir.path)
}
}
}

if (!testSourceDirSet) {
Expand Down
22 changes: 11 additions & 11 deletions grails-bootstrap/src/main/groovy/grails/util/Environment.java
Expand Up @@ -161,7 +161,7 @@ public static Environment getCurrentEnvironment() {

/**
* Returns true if the application is running in development mode (within grails run-app)
* @return True if the application is running in development mode
* @return true if the application is running in development mode
*/
public static boolean isDevelopmentMode() {
return getCurrent() == DEVELOPMENT && !(Metadata.getCurrent().isWarDeployed()) &&
Expand All @@ -170,7 +170,7 @@ public static boolean isDevelopmentMode() {

/**
* Check whether the application is deployed
* @return True if is
* @return true if is
*/
public static boolean isWarDeployed() {
return Metadata.getCurrent().isWarDeployed();
Expand All @@ -186,7 +186,7 @@ public static boolean isFork() {

/**
* Returns whether the environment is running within the Grails shell (executed via the 'grails' command line in a terminal window)
* @return True if is
* @return true if is
*/
public static boolean isWithinShell() {
return DefaultGroovyMethods.getRootLoader(Environment.class.getClassLoader()) != null;
Expand Down Expand Up @@ -322,7 +322,7 @@ Object execute() {
}

private EnvironmentBlockEvaluator(Environment e) {
this.current = e;
current = e;
}

@SuppressWarnings("unused")
Expand All @@ -335,19 +335,19 @@ public void environments(Closure<?> c) {
@SuppressWarnings("unused")
public void production(Closure<?> c) {
if (current == Environment.PRODUCTION) {
this.callable = c;
callable = c;
}
}
@SuppressWarnings("unused")
public void development(Closure<?> c) {
if (current == Environment.DEVELOPMENT) {
this.callable = c;
callable = c;
}
}
@SuppressWarnings("unused")
public void test(Closure<?> c) {
if (current == Environment.TEST) {
this.callable = c;
callable = c;
}
}

Expand All @@ -356,7 +356,7 @@ public Object methodMissing(String name, Object args) {
Object[] argsArray = (Object[])args;
if (args != null && argsArray.length > 0 && (argsArray[0] instanceof Closure)) {
if (current == Environment.CUSTOM && current.getName().equals(name)) {
this.callable = (Closure<?>) argsArray[0];
callable = (Closure<?>) argsArray[0];
}
return null;
}
Expand Down Expand Up @@ -410,12 +410,12 @@ public static boolean isInteractiveMode() {
public static boolean isInitializing() {
return initializingState;
}

public static void setInitializing(boolean initializing) {
initializingState=initializing;
initializingState = initializing;
System.setProperty(INITIALIZING, String.valueOf(initializing));
}

/**
* @return true if the reloading agent is active
*/
Expand Down
2 changes: 1 addition & 1 deletion grails-bootstrap/src/main/groovy/grails/util/Metadata.java
Expand Up @@ -56,7 +56,7 @@ private Metadata() {
}

private Metadata(File f) {
this.metadataFile = f;
metadataFile = f;
loadFromFile(f);
}

Expand Down

0 comments on commit 79a3f96

Please sign in to comment.