Wanting to build and test a bunch of Borland Delphi 6 projects that are integrated with ASP.NET services. Had been using WANT and CruiseControl for building Delphi. With TFS Build agent we can tie all together and do some testing. I am looking for guidance and direction.
One issue I see is that there is no "solution" in a Delphi project to be given to MSBuild as a '<'SolutionToBuild'>'.
<SolutionToBuild Include="There is no such thing as a Delphi.sln">
<Targets></Targets>
<Properties></Properties>
</SolutionToBuild>
Also, I have references to <UsingTask> but am a little unsure how to use them. The <UsingTask> allows run custom task for Delphi command-line compile.
Your guidance would be appreciated.
Can you upgrade? Delphi 2006+ uses MSBuild by default. There is nothing to configure.
You can use MSBuild to run the Delphi command line compiler. It's been a while, but I'm pretty sure either the IDE supports command line compilation or there is a stand-alone compiler that can be run from the command line. In either case, you would need to create an <Exec> task that runs the appropriate command line build tool with the required parameters.
When you say you have "references to <UsingTask>" do you mean that you are importing an external MSBuild task? The <UsingTask> element is used to pull in a custom MSBuild task that resides in an external assembly (DLL). Once the task is imported, you use it just like you would any other built-in task.
Related
I am developing a Web API solution. This EXE listens and responds to localhost:8080/abc/.
I have developed a Test solution for this executable.These tests simply verify responses from localhost:8080/abc/.
I have already successfully created a build definition that:
Gets and compiles the solution.
Gets and compiles the tests.
Runs the tests.
My problem here is, the tests are failing, because the EXE isn't up and running. How do I bring up the EXE for the tests, and kill it after the tests are done? Could this be done solely in the build definition itself? Say via MSBuild Arguments in the "Build process parameters"? Hopefully there is a simple solution to this...
Thanks in advance!
I can't manage to solve this in the build definition alone.
I found the solution in modifying the build template (via Edit Build Definition... -> Process), by adding InvokeProcess controls in the build flow. Have these controls call BAT files that instead run / kill the EXE.
I’m working with a VS2010 solution that has multiple projects (normal assemblies, an ASP.NET MVC project, a Windows Azure project, and a SQL project). I am trying to figure out how to set up a TFS build definition to deploy both the Windows Azure project and the SQL project.
I know how to do a Windows Azure deployment, and have a custom build task in the Windows Azure project file (.ccproj) that does the deployment. I can easily create a build definition that runs against the .ccproj file, passing in some MSBuild command line arguments as parameters, and works as expected.
I can create another build definition that runs against the SQL project (.sqlproj) file, passing to MSBuild the build targets and parameters needed to build and publish the SQL project. That works as expected.
As two distinct build definitions what I have works. Easy enough.
What I have yet to figure out is how to combine these two build definitions into one. Is that even possible (without a lot of work)? Ideally I’d be able to kick off a new build that will build the projects and deploy them both (just as they do as separate build definitions) as part of a single unit of work.
I have tried using the solution file as the item to build, and specifying the build targets as /t:<project>:<target>;<project>:<target>. But, apparently that syntax only works for targets in the base set and not any custom targets or those imported by other .targets files (or so that’s my understanding).
What is the best (simplest) way to accomplish what I’m looking to do?
Sure you can totally do this! Basically, you need to have a target in each project with the same name. Then you change the DependsOn list for each to include the project specific list of targets. Example:
Project 1:
<Target Name="MyBuild" DependsOnTargets="AzureTarget1,AzureTarget2" />
Project 2:
<Target Name="MyBuild" DependsOnTargets="SQLTarget1,SQLTarget2" />
Then you can tell the build definition to build the MyBuild target on each and it should invoke the appropriate DependsOn targets.
This is a very simple example of how to do this, but you can make this much more robust if you also use MSBuild Traversal projects and an MSBuild traversal task much like the method described in the following article under the "Building Large Source Trees" section:
http://msdn.microsoft.com/en-us/magazine/dd483291.aspx#id0100082
I'd like to make builds from the command line and I'm wondering if there's a way how to execute the command line compiler with selected build configuration ?
I know there is option --no-config which won't load default dcc32.cfg file but I would like to set the build configuration I've prepared in my project.
I would like to run something like
dcc32.exe --some-option RELEASE Win32 PLATFORM
Is there some option for selecting build configuration ?
Thank you
You need to be using msbuild rather than dcc32 for this:
msbuild myproject.dproj /p:Config=RELEASE;Platform=Win32
Make sure you have called the rsvars.bat file from the RAD Studio bin folder before you attempt to call msbuild. This sets up the necessary environment variables.
The great thing about the modern msbuild based build system, as implemented in Delphi, is that you can quite easily ensure that your command line builds are identical to your IDE builds.
As far as I know, you can use the dcc64.exe to compile for 64-bit if you do not want to use MSBuild. It is in the same folder as the dcc32.exe (and dccosx.exe for compile for OSX)
Using Delphi 2009 (or higher) and the ITE (Internal Translation Manager), how can I build the language projects from the command line? The projects are for example
Project\Languages\DEU\Project_DEU.bdsproj
Project\Languages\ENG\Project_ENG.bdsproj
Theses bdsproj files are not MSBuild projects, so do I have to call DCC32 and pass all search paths and compiler parameters using a script file, or is there a way to use MSBuild for this task, if I specifiy a special build target?
You could have a separate .groupproj including the .dproj files.
When running msbuild.exe with ANT's exec task, errors in the .net code do not result in the build process failing.
Why would this be?
I use Nant to run some MSBuild tasks. Every time I use the failonbuild attribute of that task, it fails for me. Looking at Apache's documentation for Ant, it would appear the same attribute is there as well. Are you using this attribute?
I arrived at a solution and used Exec's failonerror, works like a charm.
What do you let the msbuild task do ?
When I used NAnt previously, I used the task to build a VS.NET solution.
Right now, I'm not using NAnt anymore, I use msbuild instead. :)