Share

ANT Contrib

Tracker: Bugs

5 Generic version branding - ID: 941119
Last Update: Comment added ( nobody )

Have committed the shell for generic version as part of
bug 940985. Currently, multiple versioninfo elements
may be placed as children of project or cc elements.
However, at this time, versioninfo elements have no
effect on the generated executables and are marked as
experimental in the generated documentation.

When placed under project and given an id, the version
info can be referenced or extended by versioninfo
elements under cc elements.

When placed under cc, the first active versioninfo will
be used to generate the appropriate resources or modify
module naming.
samples/cppunit.ant has and will continue to have
examples of the use of versioninfo.


Curt Arnold ( carnold ) - 2004-04-24 02:53

5

Open

None

Curt Arnold

cpptasks

None

Public


Comments ( 5 )




Date: 2007-08-01 17:11
Sender: nobody

Logged In: NO

The patch above worked for me too. Thanks God I found this comment! :)
Please apply the patch ("VS_VERSION_INFO VERSIONINFO" -> "1 VERSIONINFO")
and release some newer version.
TIA,
--oleg


Date: 2006-11-22 21:48
Sender: heathn


I too had a problem getting the version resource recognized by Windows.
However, including windows.h did not fix the problem for me. When
constructing the VERSIONINFO block I noticed that the version ID was set to
VS_VERSION_INFO. The Microsoft docs
(http://msdn2.microsoft.com/en-gb/library/aa381058.aspx) clearly state that
this value must be a 1. When I made the change, windows recognized the
version resource block. Patch:

--- src/net/sf/antcontrib/cpptasks/platforms/WindowsPlatform.java.orig
2006-05-19 08:48:38.000000000 -0600
+++ src/net/sf/antcontrib/cpptasks/platforms/WindowsPlatform.java
2006-11-22 13:32:42.343750000 -0700
@@ -217,7 +217,7 @@

//writer.write("#include \"windows.h\"\n");

- writer.write("VS_VERSION_INFO VERSIONINFO\n");
+ writer.write("1 VERSIONINFO\n");
StringBuffer buf = new StringBuffer("FILEVERSION ");
encodeVersion(buf, parseVersion(versionInfo.getFileversion()));
buf.append("\nPRODUCTVERSION ");


Date: 2006-06-16 15:08
Sender: kwas

Logged In: YES
user_id=1405186

Commenting #include "windows.h" wasn't a good idea :(
Although MSDN says that we'll need windows.h only if we want
use named constants in .rc file, actually version info won't
be shown at all if we don't include windows.h (version
information is written to .exe or .dll, but doesn't show up
in file properties). So uncommenting line in
net.sf.antcontrib.cpptasks.platforms.WindowsPlatform that
writes #include "windows.h" to generated versioninfo.rc will
make version info accessible from file properties. At least
for msrc. I use MSVS 2003 on Win XP SP2.


Date: 2004-05-21 02:35
Sender: carnoldProject Admin

Logged In: YES
user_id=27193

The attach patch removes the include of windows.h and
switches from symbolic constants to literals.

Borland's resource compiler does not have windows.h in its
default include path and apparently ignores brc32.cfg.

The patch places the symbolics in the generated code, which
should hopefully preserve the readability.


Date: 2004-05-11 04:49
Sender: carnoldProject Admin

Logged In: YES
user_id=27193

The attached file is an initial implementation for Windows
compilers (tested with msvc and bcc). If a versioninfo is
specified, versioninfo.rc will be created and added to the
compile set. A resource compiler must be specified to
compile the file. See samples/cppunit.ant for a usage
example and the javadoc of
net.sf.antcontrib.cpptasks.VersionInfo for documentation.


Log in to comment.




Attached Files ( 2 )

Filename Description Download
bug941119.txt Windows impl, gcc to come Download
cpptasks-version2.patch Switchs from symbolic values to literals Download

Changes ( 2 )

Field Old Value Date By
File Added 87878: cpptasks-version2.patch 2004-05-21 02:35 carnold
File Added 86755: bug941119.txt 2004-05-11 04:49 carnold