Discussion:
The maximum number of directories in a multi-project envriontment
Rodolfo Gonzalez
2011-02-16 07:46:52 UTC
Permalink
Hi all,

I running gradle 0.9.2.
I was trying to figure out what is the maximum number of directories a gradle
project may have so I made
the following experiment.

The directory structure is as follows:

grad2/
build.gradle
settings.gradle
module1/
module2/
module3/
...

The content of the build.gradle file is:

subprojects {
task hello << { task -> println "I'm task1 of $task.project.name" }
}

The contents of the settings.gradle file is:

include 'module1', 'module2', 'module3', ...

Then I try to increase the number of modules to see what is the limit. Up to
250 modules everything works
fine but for 254 I get the following exception:

java.lang.NoSuchMethodError:
org.codehaus.groovy.runtime.ArrayUtil.createArray(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;L...



Do you think is that the limit for gradle? Or it's just because all the
modules are in the same directory?

I have created the following python script to recreate the case:

import os

lastEntry = 260

for i in range (1,lastEntry +1):
dirName = 'module' + str(i)
if not (os.path.exists (dirName)):
os.mkdir (dirName)
if i == 1:
print "include ",

print "'" + dirName + "'",
if i < lastEntry:
print ","

It can be run with:

python task.py > settings.gradle

Thanks a lot for help,

RODOLFO
Peter Niederwieser
2011-02-16 10:00:35 UTC
Permalink
Post by Rodolfo Gonzalez
Do you think is that the limit for gradle? Or it's just because all the
modules are in the same directory?
Sounds like a bug. Please create an issue, and add the full stack trace.

--
Peter Niederwieser 
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Creator, Spock Framework
http://spockframework.org
--
View this message in context: http://gradle.1045684.n5.nabble.com/The-maximum-number-of-directories-in-a-multi-project-envriontment-tp3387250p3387380.html
Sent from the gradle-user mailing list archive at Nabble.com.
Rene Groeschke
2011-02-16 13:22:27 UTC
Permalink
Hi,

seems that gradle is another victim of the poor ArrayUtils implentation
of groovy. This class was heavily discussed on the groovy mailinglist, I
rembember. Have a look at the code but don't bite into your keyboard.--
code available at
http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java

regards,
René
Post by Rodolfo Gonzalez
Hi all,
I running gradle 0.9.2.
I was trying to figure out what is the maximum number of directories a gradle
project may have so I made
the following experiment.
grad2/
build.gradle
settings.gradle
module1/
module2/
module3/
...
subprojects {
task hello << { task -> println "I'm task1 of $task.project.name" }
}
include 'module1', 'module2', 'module3', ...
Then I try to increase the number of modules to see what is the limit. Up to
250 modules everything works
org.codehaus.groovy.runtime.ArrayUtil.createArray(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;L...
Do you think is that the limit for gradle? Or it's just because all the
modules are in the same directory?
import os
lastEntry = 260
dirName = 'module' + str(i)
os.mkdir (dirName)
print "include ",
print "'" + dirName + "'",
print ","
python task.py > settings.gradle
Thanks a lot for help,
RODOLFO
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
------------------------------------
Rene Groeschke

rene-So656aZnn7pWk0Htik3J/***@public.gmane.org
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------
Peter Niederwieser
2011-02-16 14:13:48 UTC
Permalink
seems that gradle is another victim of the poor ArrayUtils implentation of
groovy. This class was heavily discussed on the groovy mailinglist, I
rembember.
I'm not aware of that discussion. What's wrong with this class?

--
Peter Niederwieser 
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Creator, Spock Framework
http://spockframework.org
--
View this message in context: http://gradle.1045684.n5.nabble.com/The-maximum-number-of-directories-in-a-multi-project-envriontment-tp3387250p3387694.html
Sent from the gradle-user mailing list archive at Nabble.com.
Rene Groeschke
2011-02-16 14:18:07 UTC
Permalink
Post by Peter Niederwieser
seems that gradle is another victim of the poor ArrayUtils implentation of
groovy. This class was heavily discussed on the groovy mailinglist, I
rembember.
I'm not aware of that discussion. What's wrong with this class?
The ArrayUtils limits array sizes hardly to max 255 entries. Maybe the
discussion was on another list than the groovy mailinglist? ...not sure
anymore.
regards,
René
Post by Peter Niederwieser
--
Peter Niederwieser
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Creator, Spock Framework
http://spockframework.org
--
------------------------------------
Rene Groeschke

rene-So656aZnn7pWk0Htik3J/***@public.gmane.org
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------
Peter Niederwieser
2011-02-16 14:21:49 UTC
Permalink
Post by Rene Groeschke
The ArrayUtils limits array sizes hardly to max 255 entries.
How does this manifest itself? The following works fine:

def list = (1..1000) as List
assert list.size() == 1000

def array = list as int[]
assert array.length == 1000

--
Peter Niederwieser 
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Creator, Spock Framework
http://spockframework.org
--
View this message in context: http://gradle.1045684.n5.nabble.com/The-maximum-number-of-directories-in-a-multi-project-envriontment-tp3387250p3387711.html
Sent from the gradle-user mailing list archive at Nabble.com.
Peter Niederwieser
2011-02-16 14:25:43 UTC
Permalink
That was probably a bad example. But this also works:

def array = new String[1000]
assert array.length == 1000

--
Peter Niederwieser 
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Creator, Spock Framework
http://spockframework.org
--
View this message in context: http://gradle.1045684.n5.nabble.com/The-maximum-number-of-directories-in-a-multi-project-envriontment-tp3387250p3387719.html
Sent from the gradle-user mailing list archive at Nabble.com.
Rene Groeschke
2011-02-16 15:08:32 UTC
Permalink
Hi Peter,
Well, I am not aware which groovy code uses the mentioned arraytutil
class. But as you can see in the source, its usage is hard limited to
255 entries. I guess, you are the groovy expert and as you mentioned the
snippets below with arrays of more than the 255 entries work just fine
in groovy. The stacktrace of rodolfos exception would be useful here.

BTW. I've tested the snippet of rodolfo with 1000 directories/modules
and they work fine (macosx) running it with 2000 directories/subprojects
ends with an outofmemory

regards,
René
Post by Peter Niederwieser
def array = new String[1000]
assert array.length == 1000
--
Peter Niederwieser
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Creator, Spock Framework
http://spockframework.org
--
------------------------------------
Rene Groeschke

rene-So656aZnn7pWk0Htik3J/***@public.gmane.org
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------
Peter Niederwieser
2011-02-16 15:20:57 UTC
Permalink
The ArrayUtil class is only meant to be used by the Groovy runtime, and
unless there is a bug in the runtime, there shouldn't be any problems. I
haven't followed the discussion you mentioned, but in general, such "ugly"
code is typical for alternative language implementations on the JVM, and not
automatically a sign of a problem.
Post by Rene Groeschke
The stacktrace of rodolfos exception would be useful here.
Yes. (Fortunately) I couldn't find any usages of ArrayUtil in Gradle code,
so apart from a reproducible example, the stack trace is our best chance to
find out what's going on.

--
Peter Niederwieser 
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Creator, Spock Framework
http://spockframework.org
--
View this message in context: http://gradle.1045684.n5.nabble.com/The-maximum-number-of-directories-in-a-multi-project-envriontment-tp3387250p3387820.html
Sent from the gradle-user mailing list archive at Nabble.com.
Rodolfo Gonzalez
2011-02-16 15:37:00 UTC
Permalink
Rene

I'm running gradle in a quite old Open Suse 10.3. Although I think gradle uses
its own groovy the version in the system is Groovy Version: 1.7.7 JVM:
1.6.0_01.
I'm actually getting two different stacktraces. for 254 modules directories, the
stack is:

org.gradle.api.LocationAwareGradleScriptException: Settings file
'/home/rgonzalez/provis/grad2/settings.gradle' line: 1
A problem occurred evaluating settings 'grad2'.
at
org.gradle.groovy.scripts.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:51)

at
org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:127)

at
org.gradle.initialization.ScriptEvaluatingSettingsProcessor.applySettingsScript(ScriptEvaluatingSettingsProcessor.java:64)

at
org.gradle.initialization.ScriptEvaluatingSettingsProcessor.process(ScriptEvaluatingSettingsProcessor.java:55)

at
org.gradle.initialization.PropertiesLoadingSettingsProcessor.process(PropertiesLoadingSettingsProcessor.java:37)

at
org.gradle.initialization.SettingsHandler.loadSettings(SettingsHandler.java:97)
at
org.gradle.initialization.SettingsHandler.findSettingsAndLoadIfAppropriate(SettingsHandler.java:87)

at
org.gradle.initialization.SettingsHandler.findAndLoadSettings(SettingsHandler.java:46)

at
org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:128)

at
org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:107)

at
org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:75)

at org.gradle.launcher.RunBuildAction.execute(RunBuildAction.java:41)
at org.gradle.launcher.RunBuildAction.execute(RunBuildAction.java:27)
at
org.gradle.launcher.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:209)

at
org.gradle.launcher.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:193)

at org.gradle.launcher.Main.execute(Main.java:55)
at org.gradle.launcher.Main.main(Main.java:40)
at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:46)
at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:28)
at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
Caused by: java.lang.NoSuchMethodError:
org.codehaus.groovy.runtime.ArrayUtil.createArray(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object
;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/O
bject;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/l
ang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Lj
ava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)[Ljava/lang/Object;

at
settings_1c2udbm6pnfs637c01g8ka7m84.run(/home/rgonzalez/provis/grad2/settings.gradle:1)

at
org.gradle.groovy.scripts.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:49)

... 19 more

For a bigger number 260 the stack is:

java.lang.ArrayIndexOutOfBoundsException: 260
at
org.codehaus.groovy.classgen.AsmClassGenerator.getCreateArraySignature(AsmClassGenerator.java:2225)

at
org.codehaus.groovy.classgen.AsmClassGenerator.makeCallSite(AsmClassGenerator.java:2181)

at
org.codehaus.groovy.classgen.AsmClassGenerator.makeCall(AsmClassGenerator.java:2008)

at
org.codehaus.groovy.classgen.AsmClassGenerator.makeCall(AsmClassGenerator.java:1994)

at
org.codehaus.groovy.classgen.AsmClassGenerator.makeInvokeMethodCall(AsmClassGenerator.java:1980)

at
org.codehaus.groovy.classgen.AsmClassGenerator.visitMethodCallExpression(AsmClassGenerator.java:2331)

at
org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:72)

at
org.codehaus.groovy.classgen.AsmClassGenerator.visitAndAutoboxBoolean(AsmClassGenerator.java:4111)

at
org.codehaus.groovy.classgen.AsmClassGenerator.evaluateExpression(AsmClassGenerator.java:1437)

at
org.codehaus.groovy.classgen.AsmClassGenerator.visitReturnStatement(AsmClassGenerator.java:1398)

at
org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:47)
at
org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35)

at
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:165)

at
org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:728)

at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
at
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101)

at
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112)

at
org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:616)

at
org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:591)

at
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123)

at
org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:686)

at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1039)
at
org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)

at
org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:276)

at
org.codehaus.groovy.control.CompilationUnit$11.call(CompilationUnit.java:742)
at
org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:936)

at
org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:513)

at
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:491)

at
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:468)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287)
at
org.gradle.groovy.scripts.DefaultScriptCompilationHandler.compileScript(DefaultScriptCompilationHandler.java:108)

at
org.gradle.groovy.scripts.DefaultScriptCompilationHandler.compileToDir(DefaultScriptCompilationHandler.java:57)

at
org.gradle.groovy.scripts.CachingScriptCompilationHandler.compileToDir(CachingScriptCompilationHandler.java:33)

at
org.gradle.groovy.scripts.DefaultScriptCompilerFactory$ScriptCompilerImpl.loadViaCache(DefaultScriptCompilerFactory.java:90)

at
org.gradle.groovy.scripts.DefaultScriptCompilerFactory$ScriptCompilerImpl.compile(DefaultScriptCompilerFactory.java:69)

at
org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:121)

at
org.gradle.initialization.ScriptEvaluatingSettingsProcessor.applySettingsScript(ScriptEvaluatingSettingsProcessor.java:64)

at
org.gradle.initialization.ScriptEvaluatingSettingsProcessor.process(ScriptEvaluatingSettingsProcessor.java:55)

at
org.gradle.initialization.PropertiesLoadingSettingsProcessor.process(PropertiesLoadingSettingsProcessor.java:37)

at
org.gradle.initialization.SettingsHandler.loadSettings(SettingsHandler.java:97)
at
org.gradle.initialization.SettingsHandler.findSettingsAndLoadIfAppropriate(SettingsHandler.java:87)

at
org.gradle.initialization.SettingsHandler.findAndLoadSettings(SettingsHandler.java:46)

at
org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:128)

at
org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:107)

at
org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:75)

at org.gradle.launcher.RunBuildAction.execute(RunBuildAction.java:41)
at org.gradle.launcher.RunBuildAction.execute(RunBuildAction.java:27)
at
org.gradle.launcher.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:209)

at
org.gradle.launcher.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:193)

at org.gradle.launcher.Main.execute(Main.java:55)
at org.gradle.launcher.Main.main(Main.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)
at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:46)
at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:28)
at org.gradle.launcher.GradleMain.main(GradleMain.java:24)







----- Original Message ----
From: Rene Groeschke <gradle-So656aZnn7pWk0Htik3J/***@public.gmane.org>
To: user-J5J7/IX65zpnkHa44VUL00B+***@public.gmane.org
Sent: Wed, 16 February, 2011 16:08:32
Subject: Re: [gradle-user] Re: The maximum number of directories in a
multi-project envriontment

Hi Peter,
Well, I am not aware which groovy code uses the mentioned arraytutil
class. But as you can see in the source, its usage is hard limited to
255 entries. I guess, you are the groovy expert and as you mentioned the
snippets below with arrays of more than the 255 entries work just fine
in groovy. The stacktrace of rodolfos exception would be useful here.

BTW. I've tested the snippet of rodolfo with 1000 directories/modules
and they work fine (macosx) running it with 2000 directories/subprojects
ends with an outofmemory

regards,
René
Post by Peter Niederwieser
def array = new String[1000]
assert array.length == 1000
--
Peter Niederwieser
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Creator, Spock Framework
http://spockframework.org
--
------------------------------------
Rene Groeschke

rene-So656aZnn7pWk0Htik3J/***@public.gmane.org
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Peter Niederwieser
2011-02-16 16:51:36 UTC
Permalink
Can you paste the first few lines of this file?
/home/rgonzalez/provis/grad2/settings.gradle

--
Peter Niederwieser 
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Creator, Spock Framework
http://spockframework.org
--
View this message in context: http://gradle.1045684.n5.nabble.com/The-maximum-number-of-directories-in-a-multi-project-envriontment-tp3387250p3387997.html
Sent from the gradle-user mailing list archive at Nabble.com.
Peter Niederwieser
2011-02-16 17:12:14 UTC
Permalink
Eventually figured it out. You are facing a Groovy limitation. If a method
defined like so:

def foo(int[] args) { ... }

is invoked like so:

foo(1,2,3,4, ...)

Then you can't have more than 255 method arguments.

A simple workaround is to do the following in your settings.gradle:

include "foo"
include "bar"
include "baz"
...

If you have a Gradle build with more than 255 subprojects (and for a good
reason), it might be time to think about other ways than to list each
subproject explicitly. For example, you could scan the root project
directory for subprojects.

--
Peter Niederwieser 
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Creator, Spock Framework
http://spockframework.org
--
View this message in context: http://gradle.1045684.n5.nabble.com/The-maximum-number-of-directories-in-a-multi-project-envriontment-tp3387250p3388036.html
Sent from the gradle-user mailing list archive at Nabble.com.
Rene Groeschke
2011-02-16 18:27:59 UTC
Permalink
Hi,
Post by Peter Niederwieser
Eventually figured it out. You are facing a Groovy limitation. If a method
def foo(int[] args) { ... }
foo(1,2,3,4, ...)
Then you can't have more than 255 method arguments.
include "foo"
include "bar"
include "baz"
...
If you have a Gradle build with more than 255 subprojects (and for a good
reason), it might be time to think about other ways than to list each
subproject explicitly. For example, you could scan the root project
directory for subprojects.
We often have subprojects which have a common prefix like "myProjectAPI,
myProjectServices, myProjectUI. What about allowing wildcards in my
settings.gradle? this could end up in a settings.gradle file like this:

-----
include "myProject*"
-----


regards,
René
Post by Peter Niederwieser
--
Peter Niederwieser
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Creator, Spock Framework
http://spockframework.org
--
------------------------------------
Rene Groeschke

rene-So656aZnn7pWk0Htik3J/***@public.gmane.org
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------
Jim Moore
2011-02-16 19:07:05 UTC
Permalink
You can see this kind of thing in the Gradle source base itself for the
subprojects.
Post by Peter Niederwieser
Hi,
Post by Peter Niederwieser
Eventually figured it out. You are facing a Groovy limitation. If a
method
Post by Peter Niederwieser
def foo(int[] args) { ... }
foo(1,2,3,4, ...)
Then you can't have more than 255 method arguments.
include "foo"
include "bar"
include "baz"
...
If you have a Gradle build with more than 255 subprojects (and for a good
reason), it might be time to think about other ways than to list each
subproject explicitly. For example, you could scan the root project
directory for subprojects.
We often have subprojects which have a common prefix like "myProjectAPI,
myProjectServices, myProjectUI. What about allowing wildcards in my
-----
include "myProject*"
-----
regards,
René
Post by Peter Niederwieser
--
Peter Niederwieser
Developer, Gradle
http://www.gradle.org
Trainer & Consultant, Gradle Inc.
http://www.gradle.biz
Creator, Spock Framework
http://spockframework.org
--
------------------------------------
Rene Groeschke
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
Merlyn Albery-Speyer
2011-02-17 07:52:28 UTC
Permalink
Hey René,

Me personally, I like the specificity. I have a maven project with
subprojects that I'm converting to gradle right now, and I could
easily have already run into trouble by now with a tempting wildcard.
The immediate use-case that jumps to mind is:

------
include "*"
------

and the resulting confusion that that might bring.

Cheers,
Merlyn
Post by Rene Groeschke
We often have subprojects which have a common prefix like
"myProjectAPI,
myProjectServices, myProjectUI. What about allowing wildcards in my
-----
include "myProject*"
-----
Merlyn Albery-Speyer
2011-02-16 15:27:59 UTC
Permalink
It looks like it may be a Java 1.4 / performance hack. This is all
I've found in JIRA on ArrayUtils:

http://jira.codehaus.org/browse/GROOVY-4157
http://jira.codehaus.org/browse/GROOVY-3366

There's no direct reference to ArrayUtils in the Gradle code and it's
not clear to me when ArrayUtils is used by Groovy itself.
Date: February 16, 2011 5:22:27 AM PST
Subject: Re: [gradle-user] The maximum number of directories in a
multi-project envriontment
Hi,
seems that gradle is another victim of the poor ArrayUtils
implentation
of groovy. This class was heavily discussed on the groovy
mailinglist, I
rembember. Have a look at the code but don't bite into your
keyboard.--
code available at
http://svn.codehaus.org/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/ArrayUtil.java
regards,
René
Loading...