Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Complex build for C# projects with custom tools
I've got a slightly complex build process for the project I'm working on.
I'm using ANTLR to generate parsers and lexers, and using custom-built tools
to generate various data files which are needed for starting up a debug
instance.

I'm looking for something in VS 2003 similar to a makefile's capability to
specify files, how to build them and what they depend on.

For example:

---8<---
ScriptLexer.cs : confscript.g
antlr confscript.g
--->8---

I've tried associating a batch file with the project, but there's a problem:
VS.NET doesn't detect that source code files have changed as a result of
tool execution and seems to use buffered in-memory versions of old source,
and so I need to build 2, 3 or more times before I have a debug executable
which correctly reflects the current state.

As I'm sure you can imagine, a number of times I've tried to debug a problem
that I'd already fixed - but the debug .exe was out of date.

At this stage, I've started using GNU make from the command-line to build my
project. What can I do to make VS.NET understand my dependencies?

-- Barry Kelly



Report this thread to moderator Post Follow-up to this message
Old Post
Barry Kelly
10-20-04 01:57 PM


Re: Complex build for C# projects with custom tools
Have you not tried NAnt?

"Barry Kelly" <barry.j.kelly.at.gmail.com> wrote in message
news:egSH8cptEHA.2128@TK2MSFTNGP11.phx.gbl...
> I've got a slightly complex build process for the project I'm working on.
> I'm using ANTLR to generate parsers and lexers, and using custom-built
tools
> to generate various data files which are needed for starting up a debug
> instance.
>
> I'm looking for something in VS 2003 similar to a makefile's capability to
> specify files, how to build them and what they depend on.
>
> For example:
>
> ---8<---
> ScriptLexer.cs : confscript.g
>     antlr confscript.g
> --->8---
>
> I've tried associating a batch file with the project, but there's a
problem:
> VS.NET doesn't detect that source code files have changed as a result of
> tool execution and seems to use buffered in-memory versions of old source,
> and so I need to build 2, 3 or more times before I have a debug executable
> which correctly reflects the current state.
>
> As I'm sure you can imagine, a number of times I've tried to debug a
problem
> that I'd already fixed - but the debug .exe was out of date.
>
> At this stage, I've started using GNU make from the command-line to build
my
> project. What can I do to make VS.NET understand my dependencies?
>
> -- Barry Kelly
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Paul Wistrand
10-22-04 01:56 PM


Re: Complex build for C# projects with custom tools
> "Barry Kelly" <barry.j.kelly.at.gmail.com> wrote in message
> news:egSH8cptEHA.2128@TK2MSFTNGP11.phx.gbl...
> 
>
"Paul Wistrand" <pwistrand@hotmail.com> wrote in message
news:%23eb$TrBuEHA.1308@tk2msftngp13.phx.gbl...
>
> Have you not tried NAnt?

I don't perceive NAnt as being part of Visual Studio. That is, I don't
expect I could depend on it being installed when the project is checked out
of source control on a new machine.

I'm not sure it gives me any benefits above make; I already know how to use
make. How do I benefit by learning how to use another third-party tool, when
what I want should be included in the IDE?

-- Barry



Report this thread to moderator Post Follow-up to this message
Old Post
Barry Kelly
10-26-04 02:00 PM


Re: Complex build for C# projects with custom tools
"Barry Kelly" <barry.j.kelly.at.gmail.com> wrote in message
news:egSH8cptEHA.2128@TK2MSFTNGP11.phx.gbl...

> I've tried associating a batch file with the project, but there's a
> problem: VS.NET doesn't detect that source code files have changed as a
> result of tool execution and seems to use buffered in-memory versions of
> old source, and so I need to build 2, 3 or more times before I have a
> debug executable which correctly reflects the current state.
>
> As I'm sure you can imagine, a number of times I've tried to debug a
> problem that I'd already fixed - but the debug .exe was out of date.
>
> At this stage, I've started using GNU make from the command-line to build
> my project. What can I do to make VS.NET understand my dependencies?

Have you checked in the VS options and ensured that the
Environment->Documents option "Detect when file is changed outside the
environment" is checked?

I use compilation steps like that fairly often and don't really have issues.




Report this thread to moderator Post Follow-up to this message
Old Post
Daniel O'Connell [C# MVP]
10-26-04 02:00 PM


Re: Complex build for C# projects with custom tools
> I don't perceive NAnt as being part of Visual Studio. That is, I don't
> expect I could depend on it being installed when the project is checked
out
> of source control on a new machine.
Interestingly enough most NAnt users (and its Java parent Ant) prefer to use
because of its independence from the IDE. Hence why most open source
projects use it (I see that the ANTLR C# runtime is built using NAnt). NAnt
has becoming ubiquitous enough that MS have decided to clone it for its next
version of VS as MSBuild.

> I'm not sure it gives me any benefits above make; I already know how to
use
> make.
Well it ships with an extensive set of predefined tasks beyond what
makefiles offer and provides a framework to develop your own tasks. Many
people also use it because it will execute tasks beyond just the build
process e.g.. deployment, integration. Will it provide the answer to your
particular problem? I have no idea. I only suggested it so that you would
have somewhere to look to try and solve your problem.

> How do I benefit by learning how to use another third-party tool, when
> what I want should be included in the IDE?
There are many things I'd like to see in my expensive IDE as well. Eclipse,
a free IDE,  will have been offering refactoring in the IDE for over two
years before VS 2005 ships. Frustrating but a reality.

In any event I'm not trying to suggest that NAnt is the greatest and best
thing out there just that if you can't get things to work you might want to
take a look at it.

----- Original Message -----
From: "Barry Kelly" <barry.j.kelly.at.gmail.com>
Newsgroups: microsoft.public.vstudio.general
Sent: Tuesday, October 26, 2004 9:24 AM
Subject: Re: Complex build for C# projects with custom tools



Report this thread to moderator Post Follow-up to this message
Old Post
Paul Wistrand
10-26-04 02:00 PM


Re: Complex build for C# projects with custom tools
"Daniel O'Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> wrote in
message news:OmaYagzuEHA.2684@TK2MSFTNGP12.phx.gbl...

Aside: If that's your real name, ...

> "Barry Kelly" <barry.j.kelly.at.gmail.com> wrote in message
> news:egSH8cptEHA.2128@TK2MSFTNGP11.phx.gbl...
> 
> Have you checked in the VS options and ensured that the
> Environment->Documents option "Detect when file is changed outside the
> environment" is checked?

I do, both the higher level "Detect changes" and the sub-tick "Automatically
load if not changed".

-- Barry Kelly



Report this thread to moderator Post Follow-up to this message
Old Post
Barry Kelly
10-26-04 08:58 PM


Re: Complex build for C# projects with custom tools
"Barry Kelly" <barry.j.kelly.at.gmail.com> wrote in message
news:udbjKU2uEHA.1264@TK2MSFTNGP12.phx.gbl...
> "Daniel O'Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> wrote in
> message news:OmaYagzuEHA.2684@TK2MSFTNGP12.phx.gbl...
>
> Aside: If that's your real name, ...

It is, without the [C# MVP] part of course, ;).

What brings that up?

> 
>
> I do, both the higher level "Detect changes" and the sub-tick
> "Automatically load if not changed".
>

Hmm, that is odd. I was compiling a compiler using a pre-build step before
and that was working ok, and I have one project inwhich I build my files
externally.

How did you associate the bat file?



Report this thread to moderator Post Follow-up to this message
Old Post
Daniel O'Connell [C# MVP]
10-26-04 08:58 PM


Re: Complex build for C# projects with custom tools
"Daniel O'Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> wrote in
message news:Oa5fzf2uEHA.3808@TK2MSFTNGP15.phx.gbl...
>
> "Barry Kelly" <barry.j.kelly.at.gmail.com> wrote in message
> news:udbjKU2uEHA.1264@TK2MSFTNGP12.phx.gbl... 
>
> It is, without the [C# MVP] part of course, ;).
>
> What brings that up?

Well, here in Ireland, it would be a little too grand to be believed. You'd
have been bullied at school for having pompous, hubristic, over-proud
parents :)
 
>
> Hmm, that is odd. I was compiling a compiler using a pre-build step before
> and that was working ok, and I have one project inwhich I build my files
> externally.
>
> How did you associate the bat file?

Project | Properties | Build Events | Pre-build event command line:

$(ProjectDir)build-grammar.cmd

Contents of build-grammar.cmd:

---8<---
@echo off

rem First, go to the project directory.

cd ../..

rem Next, build the grammar.

antlr pipe-expr.g
antlr type-checker.g
--->8---

On second glance, "../.." looks Unix, but it works perfectly fine.

-- Barry Kelly



Report this thread to moderator Post Follow-up to this message
Old Post
Barry Kelly
10-26-04 08:58 PM


Re: Complex build for C# projects with custom tools
"Barry Kelly" <barry.j.kelly.at.gmail.com> wrote in message
news:egSH8cptEHA.2128@TK2MSFTNGP11.phx.gbl...
> I've got a slightly complex build process for the project I'm working on.
> [...]
> VS.NET doesn't detect that source code files have changed as a result of
> tool execution and seems to use buffered in-memory versions of old source,
> and so I need to build 2, 3 or more times before I have a debug executable
> which correctly reflects the current state.

It's extremely reproducible right now. Just as I'm typing in this post, any
syntax error requires two builds to show up, and any fix requires two builds
to get the error to go away again.

-- Barry Kelly



Report this thread to moderator Post Follow-up to this message
Old Post
Barry Kelly
10-26-04 08:58 PM


Re: Complex build for C# projects with custom tools
"Barry Kelly" <barry.j.kelly.at.gmail.com> wrote in message
news:%23M6tRM3uEHA.1564@TK2MSFTNGP09.phx.gbl...

> ---8<---
> @echo off
>
> rem First, go to the project directory.
>
> cd ../..
>
> rem Next, build the grammar.
>
> antlr pipe-expr.g
> antlr type-checker.g
> --->8---

Even when I insert commands to delete the generated files (in case ANTLR
does something odd which makes the files look unchanged) before running
ANTLR, it still takes two cycles.

-- Barry Kelly



Report this thread to moderator Post Follow-up to this message
Old Post
Barry Kelly
10-26-04 08:58 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Studio archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:31 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.