How to include required files for a Jenkins Job (Delphi) - delphi

As stated in my title, basically I'm struggling on how to go about to include required files for a Delphi program to compile. I'm experimenting with Jenkins and using the execute Windows batch command for building the Delphi program (Delphi 2006 is used). It would be nice if there is some sort of generic method to find/include the required files since including it manually defeats the point of automation. Does anyone have experience with this? Or maybe know a script or batch that can include the needed files?
Thanks in advance if anyone can help!

When you use dcc32.exe directly, be sure, that all required include paths are set correctly in dcc32.cfg (-I). See here.Another option would be to use msbuild to build your projects.

Related

Incrementing Delphi XE project version number from command line

I have a Delphi XE project and I'm trying to change the version number of the program before building it with MSBuild. Version number information is located in the DPROJ file but if I change these values the version number does not change. I think the reason for this is that when you change version number in the IDE, Delphi saves the changes to both DPROJ and RES files.
Is there a way to compile the RES file from the command line with the changes in DPROJ file? I found this question which suggested saving the version number in an INC file and including that to the project but this feels a bit more complex solution compared to just making changes in DPROJ.
shameless plug: http://www.dummzeuch.de/delphi/dzprepbuild/englisch.html
I ended up solving my problem with this answer. First I unchecked "Include version information in project" in Project Options and added VersionInformation.rc with dummy data. When my build batch file is executed, it generates the correct RC file and because that RC file is added in to the Delphi project, MSBuild uses the contained information for built executable.
I use FinalBuilder to handle the version info. Isn't the stripped version bundled with your Delphi? If not, it is definitely worth the money. Makes releasing a one click action.
Yes you are right. Delphi keeps the version number in both project file and resource file. Unfortunately, resource files' structure is a bit complicated so it is not easy to update programmatically. When I came across this need, I ended up using a tool "SetVersion.exe" which did the job for me. It might help you as well. See this link.
EDIT
Actually now I remember, I used a different tool named "ChangeRes.exe" and it worked smoothly (but it is not free). You can try both and see which one works for you.
Some years ago, I have writed a script to build and increment build number using ruby and rake. Very easy to use.
After the build, the script calls Inno Setup and generates a new installer.

how to use NCover in console/command line?

i've downloaded a free version of ncover here -> http://sourceforge.net/projects/ncover/
but unortunately i am unable to find steps on how to use it in the command line.
any help would be great, thanks!
Have a look at this question.
There are two free versions of NCover available: The SourceForge one (which is discontinued and not working well as Try's comment on Ira Baxter's answer shows) and the Gnoso one (which used to be free and has gone commercial after version 1.5.8). Get the latter one from here.
In case it helps somebody else. I was able to get NCover 1.5.8 (one that comes with TestDriven.NET) working nicely with nunit.
NCover.Console.exe nunit-console-x86.exe /noshadow yourAssembly.dll
The only trick was to makes sure CoverLib.dll COM component is properly registered
regsrv32 CoverLib.dll
Otherwise you'd get "Profiled Process Terminated" error, and then making sure we are passing /noshadow parameter to nunit, otherwise NCover would fail to load symbols for the assembly (at least in my case).
Have a look at this question.
Steps to solve
1.Need to monitor the execution of Test cases Using ncover-console.exe
"[path]\NCover.Console.exe" "[path]\nunit- console.exe" "E:\Myapp\test.sln" /xml="[PATH]\TestResult.xml"
This will create a .nccov file
2.Create coverage html report from .nccov file using NCover.Reporting.exe
"[path]\NCover\NCover.Reporting.exe" "[path]\coverage.nccov" //or FullCoverageReport:Html:output

Generate Javadoc for just interfaces using Ant?

I am using Apache Ant to generate Javadoc for my program which has many projects (or modules). However, I want to generate Javadoc for Interfaces only, and I do not know how to check if a file is a class or interface in Ant. Someone suggested me that I should use <fileset> and specify a list of files to exclude or include. However, there are hundreds of files in my program and specifying a list of class files to exclude is impossible.
Does anyone have some ideas, please?
I don't believe this is possible unless you write your own custom ant-task, (which wouldn't be that hard actually) and reference that in your Ant-script.
Another, (much uglier) way would be to generate the complete java-doc and remove non-interface files. These could for instance be identified by looking at the allclasses-frame.html:
ComponentView
<I>Composite</I>
where you have both the type (in the title=...) and file (href=...) available.
Have you considered writing your own doclet? Instead of trying to get ant to do the work, create a doclet that knows how to discard every non-interface. Then, using the javadoc task in ant is simple.
Hope that helps.

Building Installation Disk for My Delphi 2010 Application

Can someone please give me a step by step on how to build an installation disk for my Delphi 2010 application?
I have tried both InstallAware Express Edition which comes with Delphi 2010 but keeps on giving me error message for it continue to look for *120.bpl instead of *140.bpl
I have also tried InnoSetup with ISTool but fail to work, which I believe I am not setting it up properly.... (e.g. failed to include all required packages)
My Apps is a simple database enquiry which I used dbExpress to connect to my ms-sql database.
I have also tried switching the flag in Delphi 2010 for "Built with Packages", no luck also...
Please help....
I am leaning toward using InnoSetup instead, but can someone tell me what is the typical set up is like... much appreciated.
Cheers.
The best place for support on an innosetup script, is the innosetup newsgroups. If you ask your question there, they would want to know more detail about what you are trying to do. Your app is going to set up some database stuff, so a lot more detail is required if you want an answer.
Innosetup is definitely is the easiest and fastest route to a setup.exe, which when placed on a CD, would make an "install CD". (Who uses CDs anymore anyways?)
In Thunderbird/OutlookExpress/WindowsMail, add an nntp server called news.jrsoftware.org,
and subscribe to the newsgroup "Jrsoftware.innosetup.code" and "jrsoftware.innosetup", and ask your question. Post your script. Show your error messages. Explain your database configuration strings, and how you are installing any dbExpress runtime components, if any apply to your application.
dbexpress in Delphi 2010 don't need nothing to be registered when deployed.
You simply need to create a folder with:
your executable.
all the required packages.
libmysql.dll
dbxmys.dll
midas.dll (if you are not using midaslib in your uses clause)
This is a easy work for an installer.
We've used Wise Installation for many years. Very easy to build install scripts. Works great.

Ant automation of InstallAnywhere installers - console mode

My problem is to create an ant target for automating our installer running in console mode.
The installer is created using InstallAnywhere 2008, which UniversalExtractor recognizes as a 7-zip archive. Once I have the archive unpacked, it appears that the task can use an input file to drive the console (at the very least, it appears that emitting a quit shuts everything down correctly, and output is captured).
So it looks to me as though I have all of the pieces I need for proving out this idea except a clean way to perform-self-extraction-then-stop. Searching for a command-line argument to stop the auto execution has not produced a likely candidate, and the only suitable ant task I've found ( http://www.pharmasoft.be/7z/ ) isn't so clearly documented that I have a lot of confidence in it.
The completed completed is expected to work in Windows, Linux, and a small handful of other Unix environments.
What's the best practice to use here?
Since you control the installer creation, can you run the self-extraction step on your machine, package the results before the installer is launched in a ZIP file, etc. and use that instead of the single file executable? Not very elegant but it may work.
Also, I am a bit hesitant to blatantly promote my project :) but since it has been a while since you asked the question and nobody has answered, have you considered an alternative? Our project InstallBuilder allows you to install in unattended mode directly, without having to autoextract the contents. Just invoke the executable with --mode unattended, pass any additional options you may need from the command line or an external file and you are good to go. We have a lot of ex-InstallAnywhere customers :)

Resources