do things lazy

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

do things lazy

Stefan Groschupf
Hi,
I think it is important do as much as you can lazy.
For example if I run a non sense command or no one with katta gradle  
does all the resolution stuff to tell me in the end that there is no  
such task.
No tasks have been specified and the project has not defined any  
default tasks.

So takes almost 10 sekund to find out I made nonsense. In general do  
as much as you can lazy makes a lot of sense and will make gradle  
"feel" much faster.
Stefan




jemez:katta-trunk joa23$ sh gradlew
GRADLE_WRAPPER_ALWAYS_UNPACK env variable: null
GRADLE_WRAPPER_ALWAYS_DOWNLOAD env variable: null
Buildfilename: build.gradle
================================================ Start building buildSrc
No build sources found.
:: loading settings :: url = jar:file:/Users/joa23/.gradle/wrapper/
dists/gradle-0.4/lib/ivy-2.0.0.cr1_20080911151837.jar!/org/apache/ivy/
core/settings/ivysettings.xml
:: resolving dependencies :: org.gradle#build;SNAPSHOT
        confs: [build]
:: resolution report :: resolve 99ms :: artifacts dl 1ms
        :: modules in use:
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |       build      |   0   |   0   |   0   |   0   ||   0   |   0   |
        ---------------------------------------------------------------------
++ Loading Project objects
++ Configuring Project objects
Project= : evaluated.
++++ Starting build for primary task 'clean'.
Executing: :clean
DAG must not be rebuild as the task chain before was dag neutral!
++++ Starting build for primary task 'uploadLibs'.
Executing: :init
Executing: :resources
Executing: :compile
:: resolving dependencies :: org.gradle#buildSrc;SNAPSHOT
        confs: [compile]
:: resolution report :: resolve 4ms :: artifacts dl 0ms
        :: modules in use:
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      compile     |   0   |   0   |   0   |   0   ||   0   |   0   |
        ---------------------------------------------------------------------
     [mkdir] Created dir: /Users/joa23/Documents/workspaces/katta/
katta-trunk/buildSrc/build/classes
   [groovyc] Compiling 1 source file to /Users/joa23/Documents/
workspaces/katta/katta-trunk/buildSrc/build/classes
Executing: :testResources
Executing: :testCompile
Executing: :test
Executing: :archive_jar
       [jar] Building jar: /Users/joa23/Documents/workspaces/katta/
katta-trunk/buildSrc/build/buildSrc-SNAPSHOT.jar
Executing: :libs
Executing: :uploadLibs
Publishing configurations: ["libs"]
Publishing to Resolver build-resolver
        published buildSrc to /Users/joa23/Documents/workspaces/katta/katta-
trunk/.gradle/build-resolver/org.gradle/buildSrc/SNAPSHOT/jars/
buildSrc.jar
        published ivy to /Users/joa23/Documents/workspaces/katta/katta-
trunk/.gradle/build-resolver/org.gradle/buildSrc/SNAPSHOT/ivys/ivy.xml
Check if build artifact exists: ${buildArtifactFile(buildResolverDir)}
================================================ Finished building  
buildSrc
:: resolving dependencies :: org.gradle#build;SNAPSHOT
        confs: [build]
        found #jsch;0.1.39 in buildLib
        found #ant-jsch;1.7.0 in buildLib
        found org.gradle#buildSrc;SNAPSHOT in build-resolver
:: resolution report :: resolve 234ms :: artifacts dl 75ms
        :: modules in use:
        #ant-jsch;1.7.0 from buildLib in [build]
        #jsch;0.1.39 from buildLib in [build]
        org.gradle#buildSrc;SNAPSHOT from build-resolver in [build]
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |       build      |   3   |   3   |   0   |   0   ||   3   |   0   |
        ---------------------------------------------------------------------
Adding to classpath: /Users/joa23/Documents/workspaces/katta/katta-
trunk/src/build/resources/lib/jsch-0.1.39.jar
Adding to classpath: /Users/joa23/Documents/workspaces/katta/katta-
trunk/src/build/resources/lib/ant-jsch-1.7.0.jar
Adding to classpath: /Users/joa23/Documents/workspaces/katta/katta-
trunk/.gradle/build-resolver/org.gradle/buildSrc/SNAPSHOT/jars/
buildSrc.jar
++ Loading Project objects
++ Configuring Project objects
Project= : evaluated.

Build failed with an exception.
Run with -s or -d option to get more details. Run with -f option to  
get the full (very verbose) stacktrace.

No tasks have been specified and the project has not defined any  
default tasks.

BUILD FAILED

Total time: 8.28 secs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101tec Inc., Menlo Park, California
web:  http://www.101tec.com
blog: http://www.find23.net




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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: do things lazy

hans_d
Administrator
Hi Stefan,

On Oct 7, 2008, at 9:07 AM, Stefan Groschupf wrote:

> Hi,
> I think it is important do as much as you can lazy.
> For example if I run a non sense command or no one with katta  
> gradle does all the resolution stuff to tell me in the end that  
> there is no such task.
> No tasks have been specified and the project has not defined any  
> default tasks.
>
> So takes almost 10 sekund to find out I made nonsense. In general  
> do as much as you can lazy makes a lot of sense and will make  
> gradle "feel" much faster.

I know this problem and it bugs me also when executing the Gradle  
build. There is a Jira for this. I'm in the train right now, so I  
can't provide the link. The problem is that the Katta build sources  
(which include custom Katta build logic needed by the build script to  
work) are not cached. They are always build anew although they  
usually rarely change. If they were cached you would get a pretty  
immediate response and in general the build would be faster.

- Hans

> Stefan
>
>
>
>
> jemez:katta-trunk joa23$ sh gradlew
> GRADLE_WRAPPER_ALWAYS_UNPACK env variable: null
> GRADLE_WRAPPER_ALWAYS_DOWNLOAD env variable: null
> Buildfilename: build.gradle
> ================================================ Start building  
> buildSrc
> No build sources found.
> :: loading settings :: url = jar:file:/Users/joa23/.gradle/wrapper/
> dists/gradle-0.4/lib/ivy-2.0.0.cr1_20080911151837.jar!/org/apache/
> ivy/core/settings/ivysettings.xml
> :: resolving dependencies :: org.gradle#build;SNAPSHOT
> confs: [build]
> :: resolution report :: resolve 99ms :: artifacts dl 1ms
> :: modules in use:
> ---------------------------------------------------------------------
> |                  |            modules            ||   artifacts   |
> |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
> ---------------------------------------------------------------------
> |       build      |   0   |   0   |   0   |   0   ||   0   |   0   |
> ---------------------------------------------------------------------
> ++ Loading Project objects
> ++ Configuring Project objects
> Project= : evaluated.
> ++++ Starting build for primary task 'clean'.
> Executing: :clean
> DAG must not be rebuild as the task chain before was dag neutral!
> ++++ Starting build for primary task 'uploadLibs'.
> Executing: :init
> Executing: :resources
> Executing: :compile
> :: resolving dependencies :: org.gradle#buildSrc;SNAPSHOT
> confs: [compile]
> :: resolution report :: resolve 4ms :: artifacts dl 0ms
> :: modules in use:
> ---------------------------------------------------------------------
> |                  |            modules            ||   artifacts   |
> |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
> ---------------------------------------------------------------------
> |      compile     |   0   |   0   |   0   |   0   ||   0   |   0   |
> ---------------------------------------------------------------------
>     [mkdir] Created dir: /Users/joa23/Documents/workspaces/katta/
> katta-trunk/buildSrc/build/classes
>   [groovyc] Compiling 1 source file to /Users/joa23/Documents/
> workspaces/katta/katta-trunk/buildSrc/build/classes
> Executing: :testResources
> Executing: :testCompile
> Executing: :test
> Executing: :archive_jar
>       [jar] Building jar: /Users/joa23/Documents/workspaces/katta/
> katta-trunk/buildSrc/build/buildSrc-SNAPSHOT.jar
> Executing: :libs
> Executing: :uploadLibs
> Publishing configurations: ["libs"]
> Publishing to Resolver build-resolver
> published buildSrc to /Users/joa23/Documents/workspaces/katta/
> katta-trunk/.gradle/build-resolver/org.gradle/buildSrc/SNAPSHOT/
> jars/buildSrc.jar
> published ivy to /Users/joa23/Documents/workspaces/katta/katta-
> trunk/.gradle/build-resolver/org.gradle/buildSrc/SNAPSHOT/ivys/ivy.xml
> Check if build artifact exists: ${buildArtifactFile(buildResolverDir)}
> ================================================ Finished building  
> buildSrc
> :: resolving dependencies :: org.gradle#build;SNAPSHOT
> confs: [build]
> found #jsch;0.1.39 in buildLib
> found #ant-jsch;1.7.0 in buildLib
> found org.gradle#buildSrc;SNAPSHOT in build-resolver
> :: resolution report :: resolve 234ms :: artifacts dl 75ms
> :: modules in use:
> #ant-jsch;1.7.0 from buildLib in [build]
> #jsch;0.1.39 from buildLib in [build]
> org.gradle#buildSrc;SNAPSHOT from build-resolver in [build]
> ---------------------------------------------------------------------
> |                  |            modules            ||   artifacts   |
> |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
> ---------------------------------------------------------------------
> |       build      |   3   |   3   |   0   |   0   ||   3   |   0   |
> ---------------------------------------------------------------------
> Adding to classpath: /Users/joa23/Documents/workspaces/katta/katta-
> trunk/src/build/resources/lib/jsch-0.1.39.jar
> Adding to classpath: /Users/joa23/Documents/workspaces/katta/katta-
> trunk/src/build/resources/lib/ant-jsch-1.7.0.jar
> Adding to classpath: /Users/joa23/Documents/workspaces/katta/katta-
> trunk/.gradle/build-resolver/org.gradle/buildSrc/SNAPSHOT/jars/
> buildSrc.jar
> ++ Loading Project objects
> ++ Configuring Project objects
> Project= : evaluated.
>
> Build failed with an exception.
> Run with -s or -d option to get more details. Run with -f option to  
> get the full (very verbose) stacktrace.
>
> No tasks have been specified and the project has not defined any  
> default tasks.
>
> BUILD FAILED
>
> Total time: 8.28 secs
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 101tec Inc., Menlo Park, California
> web:  http://www.101tec.com
> blog: http://www.find23.net
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





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

    http://xircles.codehaus.org/manage_email