#75 Generic version branding

cpptasks (103)
Curt Arnold

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

    Curt Arnold - 2004-05-11

    Windows impl, gcc to come

  • Curt Arnold

    Curt Arnold - 2004-05-11

    Logged In: YES

    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.

  • Curt Arnold

    Curt Arnold - 2004-05-21

    Switchs from symbolic values to literals

  • Curt Arnold

    Curt Arnold - 2004-05-21

    Logged In: YES

    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.

  • kwas

    kwas - 2006-06-16

    Logged In: YES

    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.

  • Heath Nielson

    Heath Nielson - 2006-11-22

    Logged In: YES
    Originator: NO

    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 ");

  • Nobody/Anonymous

    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.


Log in to post a comment.