Author Topic: New inter-target dependency feature  (Read 10030 times)

Offline zieQ

  • Almost regular
  • **
  • Posts: 155
New inter-target dependency feature
« on: August 04, 2005, 01:02:35 pm »
I have now implemented per-target dependencies feature INTERNALLY, with minimal change to the SDK. I have greatly modified the compiler plugin so we may test it a little (in HEAD) before it comes to the v1 release. I said internally, that means that some gui/interface stuff should now be developed to cope with the modifications I have done. I have updated the MSVC importers to add the dependencies in targets, so these are the only ways to test inter-target dependencies for now.

Since I'm going to take vacations very soon till end of August, I do not have time to implement the GUI stuff for now. So I post my TODO list so as people could implement the missing features if they want a dependency handling to come very soon.

Added in the SDK, in ProjectBuildTarget:
- a reference to the parent project for each target, so as to switch to the correct project before compiling. Now, we could retrieve the fullname of a target: "projectname - targetname" with the method GetFullTitle(). This is usefull to choose the targets to compile in the Batch build dialog or the targets to depend on in the dependency dialog
- AddTargetDep(ProjectBuildTarget* target) && GetTargetDeps()
To add/retrieve the (direct) dependencies of the current target

Added in the compiler plugins, CompilerGCC
- support for batch compile/clean
- support to calculate the dependency list for targets
- CompileDeps, CleanDeps, RebuildDeps which are dependency-enabled counterparts of Compile, Clean and Rebuild
- Redirected the OnCompile/OnClean to use the dependency-enabled methods instead of the other ones.

TODO (for me):
- update XXXAll so as to respect a correct build order of the targets
- redirect OnRebuild?

TODO:
- implement a dialog to set the target dependencies, that is which target the current target depend on.
This could be implemented with, at the top, a choice of the project/target whose dependencies are to be edited and below a checklistbox of the targets to depend on (using GetFullTitle so the project name appear too). Note that, as a first step we may propose all other targets, but in Visual Studio, the choice is restricted to targets that do not make a circular dependency loop, to prevent some problems during compilation. So prepare to extend the dialog/list to support this feature, I will not be hard to implement after.
- implement a batch build dialog for the compiler plugin Checklistbox with all targets for which we want to make an action. Two action buttons: clean and compile, that respectively perform batch clean and batch
compile. Maybe more buttons? Ok/close button.
- update the menus accordingly
- make the dependencies (and external deps too, see RFE) saved in the codeblock project/workspace files.
- provide a way to link the dependent target automatically instead of adding them into the LinkLibs of the target. This is not really important for now but should be an added value. I things it implies modifying the directcommand/makefile commands to allow that.

As a side note, I find that the compiler plugin is especially not clear, it's really a pain to add something in it and very error prone. I would not be surprised if there were/will be some bugs in it. I'll post something about this later.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: New inter-target dependency feature
« Reply #1 on: August 04, 2005, 08:58:26 pm »
Quote
I would not be surprised if there were/will be some bugs in it
I'm not :lol:

Anyway, I'm also thinking of the pains we have to do to modify the structure of the compiler objects (SDK), they definitely need a revamp.

I was thinking of using XML-like tree nodes, so that a node can query (ands save) TONS of information from it. It looks like it would be the perfect implementation for a project or compiler options...

Offline zieQ

  • Almost regular
  • **
  • Posts: 155
Re: New inter-target dependency feature
« Reply #2 on: August 23, 2005, 10:06:25 am »
Well, I NEED HELP to develop the GUI stuff. Volunteers?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: New inter-target dependency feature
« Reply #3 on: August 23, 2005, 05:17:18 pm »
I volunteer for this work! Just gimme the drawings, the specs, and I'll do it.

Offline zieQ

  • Almost regular
  • **
  • Posts: 155
Re: New inter-target dependency feature
« Reply #4 on: August 23, 2005, 06:30:02 pm »
Look at the first 2 items on the TODO (not for me) list, that's the most important parts for now, i.e.
- target dependencies editing
- batch build dialog

Hope the description is clear enough :wink: The behavior (actions associated to controls) could be implemented later for the batch build dialog. For target dependencies editing, I commited some changes in the sdk. Everything needed to implement the dialog is in the sdk except the circular dependency check where we may disable some checkbox in realtime. Implementing an empty method for now should help me later ;)
« Last Edit: August 23, 2005, 06:36:05 pm by zieQ »

Offline zieQ

  • Almost regular
  • **
  • Posts: 155
Re: New inter-target dependency feature
« Reply #5 on: August 23, 2005, 06:43:28 pm »
Here are some screenshots from MSVC to inspire from



[attachment deleted by admin]

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: New inter-target dependency feature
« Reply #6 on: August 23, 2005, 06:46:00 pm »
wait wait wait, what TODO list? I can search the WHOLE project for todo's, but it'd help if you gave me the filenames at least :P

And what are those buttons in the screenshots supposed to do? I mean, there's clean in there... is this our same "clean" and rebuild? :-? i got confused now...

Offline zieQ

  • Almost regular
  • **
  • Posts: 155
Re: New inter-target dependency feature
« Reply #7 on: August 23, 2005, 06:47:58 pm »
Well, the TODO list of the first post of this thread :p

Build, Clean buttons refer to batch build feature, i.e. you select a list of targets to be built or cleaned or rebuilt...
If you want, when you hit clean, it cleans all the selected targets (see the checkboxes?). The selection is conserved when you close and reopen the dialog so it's a really cool feature ;)
« Last Edit: August 23, 2005, 06:51:13 pm by zieQ »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: New inter-target dependency feature
« Reply #8 on: August 23, 2005, 07:14:50 pm »
Hmm... build, batch build, er.... mind explaining more how it's supposed to work?

Offline zieQ

  • Almost regular
  • **
  • Posts: 155
Re: New inter-target dependency feature
« Reply #9 on: August 23, 2005, 07:37:45 pm »
As a first approximation, build is quite the same as compile.

In MSVC:
compile: process (compile) only the current source file
build: process (compile and link) the current project/target
batch build: process (compile and link) a list of projects/targets

"build" invoke the linker after all compilations whereas "compile" just invoke the compiler, maybe that's why the terms are different is MSVC or in some other software.
In C::B terms, this is respectively called "compile single file", "compile" (and "batch compile" which do not exist yet). I think the term "build" is more appropriate (maybe since I have a MSVC background :p ) but I don't really care for now.

So the batch build dialog allow to select a bunch of targets and perform a build (i.e compile) or a clean for these selected targets, and the selection is remembered from call to call.
Maybe we may call it "Batch processing" and add compile, recompile and clean buttons to match the terms used in C::B

Edit: humm, not exactly. In C::B there's "compile" and "rebuild" (and not recompile). Not really coherent though :P
« Last Edit: August 23, 2005, 07:49:21 pm by zieQ »

Offline takeshi miya

  • Lives here!
  • ****
  • Posts: 1487
Re: New inter-target dependency feature
« Reply #10 on: August 23, 2005, 09:06:59 pm »
haha, true, the first times I used C::B, I was wondering where "Build" and "Batch build" was =P

Offline zieQ

  • Almost regular
  • **
  • Posts: 155
Re: New inter-target dependency feature
« Reply #11 on: August 25, 2005, 09:32:14 am »
Don't know if C::B users would mind if we change the terms from compile to build. Opinions?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: New inter-target dependency feature
« Reply #12 on: August 25, 2005, 10:01:24 am »
Don't know if C::B users would mind if we change the terms from compile to build. Opinions?

Maybe you should start a new topic for this question, if you want to get more answers :P
Btw, I have no problem if it's called "compile" or "build".

Yiannis.
Be patient!
This bug will be fixed soon...

Offline grv575

  • Official tester
  • Regular
  • ***
  • Posts: 381
Re: New inter-target dependency feature
« Reply #13 on: August 25, 2005, 12:31:04 pm »
I think most of the ides have adapted to:
"build" a project
"compile" (current) file
So I would think to leave the compile current file menu item in
and reword to build in order to compile all project files which have changed.

Offline zieQ

  • Almost regular
  • **
  • Posts: 155
Re: New inter-target dependency feature
« Reply #14 on: August 25, 2005, 01:22:41 pm »
Maybe you should start a new topic for this question, if you want to get more answers :P

Yes you are true :wink: . So this post is only for volunters to help me and discuss the new inter-target dependencies feature  :roll: