|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
question about codeHi,
I'm looking at buildr code and I see that the 'package' task depends on the 'build' task (package.rb), and that 'build' is the default (rake) task (build.rb). But when I run buildr, the 'package' task is called (since jars are created). Where is this task called? Thanks, Ittay -- -- Ittay Dror <ittay.dror@...> |
|
|
Re: question about codeOn Sun, Jul 13, 2008 at 8:11 AM, Ittay Dror <ittay.dror@...> wrote:
> I'm looking at buildr code and I see that the 'package' task depends on the > 'build' task (package.rb), and that 'build' is the default (rake) task > (build.rb). But when I run buildr, the 'package' task is called (since jars > are created). Where is this task called? Maybe some sub-projects in your build depend on other sub-project packages to build? (say that 3 times fast!) alex |
|
|
Re: question about codeOn Sun, Jul 13, 2008 at 8:11 AM, Ittay Dror <ittay.dror@...> wrote:
> Hi, > > I'm looking at buildr code and I see that the 'package' task depends on the > 'build' task (package.rb), and that 'build' is the default (rake) task > (build.rb). But when I run buildr, the 'package' task is called (since jars > are created). Where is this task called? Each project has a package task that also runs that project's build task, and each sub-project's package task, and all the packaging tasks for that project: one for each package created by calling package(type). The later would have names like target/foo-bar-1.2.jar. Each of these packages (i.e. foo-bar-1.2.jar) also have a dependency on the project's build task. So if one project depends on another project's package, that other project would run its build task. Assaf |
|
|
Re: question about codeAssaf Arkin wrote: > On Sun, Jul 13, 2008 at 8:11 AM, Ittay Dror <ittay.dror@...> wrote: > > >> Hi, >> >> I'm looking at buildr code and I see that the 'package' task depends on the >> 'build' task (package.rb), and that 'build' is the default (rake) task >> (build.rb). But when I run buildr, the 'package' task is called (since jars >> are created). Where is this task called? >> > > > Each project has a package task that also runs that project's build task, > and each sub-project's package task, and all the packaging tasks for that > project: one for each package created by calling package(type). The later > would have names like target/foo-bar-1.2.jar. > > Each of these packages (i.e. foo-bar-1.2.jar) also have a dependency on the > project's build task. So if one project depends on another project's > package, that other project would run its build task. > shouldn't 'build' be the task that is called when buildr (rake) is called with no arguments? or put it another way, where in the code is 'package' called explicitly to start the build? -- -- Ittay Dror <ittay.dror@...> |
|
|
Re: question about codeOn Sun, Jul 13, 2008 at 8:04 PM, Ittay Dror <ittay.dror@...> wrote:
> > > Assaf Arkin wrote: > >> On Sun, Jul 13, 2008 at 8:11 AM, Ittay Dror <ittay.dror@...> wrote: >> >> >> >>> Hi, >>> >>> I'm looking at buildr code and I see that the 'package' task depends on >>> the >>> 'build' task (package.rb), and that 'build' is the default (rake) task >>> (build.rb). But when I run buildr, the 'package' task is called (since >>> jars >>> are created). Where is this task called? >>> >>> >> >> >> Each project has a package task that also runs that project's build task, >> and each sub-project's package task, and all the packaging tasks for that >> project: one for each package created by calling package(type). The later >> would have names like target/foo-bar-1.2.jar. >> >> Each of these packages (i.e. foo-bar-1.2.jar) also have a dependency on >> the >> project's build task. So if one project depends on another project's >> package, that other project would run its build task. >> >> > yes, but from what i see, the default task for rake is 'build', so > shouldn't 'build' be the task that is called when buildr (rake) is called > with no arguments? That's true. If your buildfile has one project and you run buildr with no arguments, it builds that project but doesn't package anything. If you have foo and bar, and foo depends on a jar generated by bar, than now you have a dependency: foo depends on bar.jar, so when foo builds, it invokes that task which builds bar and packages bar.jar. That's opportunistic. Since you're not running buildr package, foo will not package itself, neither will any other package defined by bar but never referenced. Only foo's dependency gets packaged. Assaf > or put it another way, where in the code is 'package' called explicitly to > start the build? > >> Assaf >> >> >> >> >>> Thanks, >>> Ittay >>> >>> -- >>> -- >>> Ittay Dror <ittay.dror@...> >>> >>> >>> >>> >>> >> >> >> > > -- > -- > > Ittay Dror <ittay.dror@...> > > |
|
|
Re: question about codeHi Assaf,
Assaf Arkin wrote: > > That's true. If your buildfile has one project and you run buildr with no > arguments, it builds that project but doesn't package anything. > > If you have foo and bar, and foo depends on a jar generated by bar, than now > you have a dependency: foo depends on bar.jar, so when foo builds, it > invokes that task which builds bar and packages bar.jar. > can you point me where in the code this is done? I can see that the method 'package' creates a task and makes it depend on 'build', and i also see that 'with' in CompileTask converts specs to artifacts, which in the case of Project just takes the packages tasks of the project. What I don't see is where the dependency on those package tasks is created. (it looks like @dependencies in CompileTask is just set to an array of tasks and then is mapped to an array of strings before passing it to the compiler object) Thank you, Ittay > That's opportunistic. Since you're not running buildr package, foo will not > package itself, neither will any other package defined by bar but never > referenced. Only foo's dependency gets packaged. > > Assaf > > > >> or put it another way, where in the code is 'package' called explicitly to >> start the build? >> >> >>> Assaf >>> >>> >>> >>> >>> >>>> Thanks, >>>> Ittay >>>> >>>> -- >>>> -- >>>> Ittay Dror <ittay.dror@...> >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> >> -- >> -- >> >> Ittay Dror <ittay.dror@...> >> >> >> > > -- -- Ittay Dror <ittay.dror@...> |
|
|
Re: question about codeOn Tue, Jul 15, 2008 at 7:51 AM, Ittay Dror <ittay.dror@...> wrote:
> Hi Assaf, > > Assaf Arkin wrote: > >> >> That's true. If your buildfile has one project and you run buildr with no >> arguments, it builds that project but doesn't package anything. >> >> If you have foo and bar, and foo depends on a jar generated by bar, than >> now >> you have a dependency: foo depends on bar.jar, so when foo builds, it >> invokes that task which builds bar and packages bar.jar. >> >> > can you point me where in the code this is done? I can see that the method > 'package' creates a task and makes it depend on 'build', and i also see that > 'with' in CompileTask converts specs to artifacts, which in the case of > Project just takes the packages tasks of the project. What I don't see is > where the dependency on those package tasks is created. (it looks like > @dependencies in CompileTask is just set to an array of tasks and then is > mapped to an array of strings before passing it to the compiler object) invoke_prerequisites adds the source directories and dependencies to the list of prerequisites before invoking them all. The reason, if you're curious, is to satisfy another -- no longer in existence -- feature; if this was rewritten today, probably go straight in the same enhance block as compile. Assaf > > > Thank you, > Ittay > >> That's opportunistic. Since you're not running buildr package, foo will >> not >> package itself, neither will any other package defined by bar but never >> referenced. Only foo's dependency gets packaged. >> >> Assaf >> >> >> >> >>> or put it another way, where in the code is 'package' called explicitly >>> to >>> start the build? >>> >>> >>> >>>> Assaf >>>> >>>> >>>> >>>> >>>> >>>> >>>>> Thanks, >>>>> Ittay >>>>> >>>>> -- >>>>> -- >>>>> Ittay Dror <ittay.dror@...> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>> -- >>> -- >>> >>> Ittay Dror <ittay.dror@...> >>> >>> >>> >>> >> >> >> > > -- > -- > > Ittay Dror <ittay.dror@...> > > |
| Free Forum Powered by Nabble | Forum Help |