FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Does not compile in 2.0

 
Post new topic   Reply to topic     Forum Index -> CDC
View previous topic :: View next topic  
Author Message
CrypticMetaphor88



Joined: 07 Dec 2010
Posts: 4

PostPosted: Tue Dec 07, 2010 10:29 pm    Post subject: Does not compile in 2.0 Reply with quote

JoeCoder wrote:
This is a shameless self promotion. Even worse, I've cross-posted in the Build/Bud forums!

I wanted to draw attention to my own build tool, CDC. It's a single source file build script written in D and passes its command line arguments directly to dmd/gdc/ldc, except that it also accepts folders as well as files. So if all of your source files are in a folder named code/src, you could do something like:
Code:
dmd -run cdc.d code/src -of../bin/foo.exe -run

Which would compile all of the source files, place foo.exe in the ../bin folder, and then run it.

It seems to work with all of the D1 compilers and with tango as well as phobos, but I could use some help making it work with D2 as well. I haven't tested it at all on Mac.

CDC is also a library for building D code. I used it with Yage to create a custom build script that creates libraries, documentation, and embedded files, all in only a few lines of additional code. I feel that using D itself is more powerful than a config file.

I'm not trying to compete with DSSS. CDC is for those looking for a very minimal and lightweight build script that can be included with your project.


I've read your post in the dsss forum, thought it would be more appropriate to post my reply here.

the compile error I get:
Code:

cdc.d(159): Error: function std.string.find is deprecated


using dmd compiler 2.50, I've never programmed in D1, I just discovered D a week ago or so and have been messing around with it since. Don't know too much about D yet, but It's not too different from C/C++, C#, Java, so I'll try to read your code and maybe help you improve the program!

edit:
by the way
Code:

dmd -run cdc.d code/src -of../bin/foo.exe -run


-run twice? Is that a feature? ^_^
Back to top
View user's profile Send private message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Wed Dec 08, 2010 3:20 am    Post subject: Reply with quote

The first '-run' is for DMD to run CDC, and the second one is to pass a '-run' to the DMD command line to compile foo.exe. Basically, everything after '-run' is expected to be in the format "<source-file> <extra-args...>" where extra-args is passed to the compiled program as it's ran... It would probably be best if DMD adopted the increasingly common approach of placing pass-through arguments after a special '--' indicator. Making it:
Code:
dmd -run cdc -- code/src -of../bin/foo -run


Similar to how a Gentoo user would use:
Code:
revdep-rebuild -q -- -aq

To get revdep-rebuild to pass the '-aq' args forward to the emerge command.

It does look redundant, though. Probably better to stick with examples without their own '-run' going through.

(O hai, don't mind me coming out of nowhere!)
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Wed May 18, 2011 10:12 pm    Post subject: Reply with quote

I updated cdc to compile properly under D2 once again (2.053). Sorry for such a delay. I always forget to check this forum.
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Wed May 18, 2011 10:14 pm    Post subject: Reply with quote

If anyone else would like to help me maintain CDC to keep pace with changes in GDC, LDC, and DMD, just let me know. I'll give you svn write access.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> CDC All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group