Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-09-2008, 10:15 AM
ShiamakD ShiamakD is online now
Registered User
 
Join Date: 04-28-2008
Location: us
Posts: 32
Reading a value of Macro from a external file

Hi,

Is there a way to read a value of macro defined in a file.

i have a header file something like this
#define WIN2K_VERSION 1,0,WIN2K_BLD_ID// for FILEVERSION/PRODUCTVERSION
#define STR_PRODUCT_NAME "Test Dummy Software"// for "ProductName"
#define STR_BUILD_NUMBER "1.0.0.20080208" // for "FileVersion"/"ProductVersion" NN is being excluded for this demo
#define STR_APP_VERSION "1.0" // Test Dummy About box
#define szAppBuildNumber _T("(Build 1.0.0.20080208)") // for About dialogs
#define szAppBuildDate "2020080208"// numeric, 10-digit build ID
#define STR_COMPANY_NAME "Siemens HealthCare Diagnostics" // for "CompanyName"
#define szAppCompanyName _T( STR_COMPANY_NAME )// IDC_APP_COMPANY_NAME
#define STR_COPYRIGHT "Copyright © Siemens HealthCare Diagnostics 2008. All Rights Reserved" // for "LegalCopyright"
#define szAppCopyright _T( STR_COPYRIGHT ) // for About dialogs

Where different strings gets updated at the BUILD time, what i wanna do is create a macro in my Visual Build script then read the VALUE of macro defined/updated in my file then allocate the READ value to my visual build macro and then use it for PROPERTIES section of Make VS 2005 .


To make myself more clear , lets say STR_szAppBuildNumber in my exteral file hold the value of build number that changes everyday, now I would like to read this value of szAppBuildNumer string and allocate this value to a MACRO defined within VisualBuild script , and then use the VisualBuild macro to assing this value to CONFIGURATIOn of PROPERTIES?

Is it possible?

Also does VisualBuild allows a user to ADD additional property strings (in C# its is called assemblyAttributes).

TIA
Reply With Quote
  #2  
Old 05-09-2008, 05:04 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Re: Reading a value of Macro from a external file

Quote:
Originally posted by ShiamakD
Hi,

Is there a way to read a value of macro defined in a file.

...

Where different strings gets updated at the BUILD time, what i wanna do is create a macro in my Visual Build script then read the VALUE of macro defined/updated in my file then allocate the READ value to my visual build macro and then use it for PROPERTIES section of Make VS 2005 .

To make myself more clear , lets say STR_szAppBuildNumber in my exteral file hold the value of build number that changes everyday, now I would like to read this value of szAppBuildNumer string and allocate this value to a MACRO defined within VisualBuild script , and then use the VisualBuild macro to assing this value to CONFIGURATIOn of PROPERTIES?

Is it possible?
Yes, see attached sample.

Quote:
Also does VisualBuild allows a user to ADD additional property strings (in C# its is called assemblyAttributes).
Yes, for each property specified on the Properties tab of the Make VS 2005 action (for managed projects), if the corresponding assembly attribute doesn't exist, it will be added to the project's assemblyinfo file. To add other attributes, use the Replace in File action (see attachment).
Attached Files
File Type: bld findtext2.bld (6.7 KB, 1710 views)
Reply With Quote
  #3  
Old 05-12-2008, 12:56 PM
ShiamakD ShiamakD is online now
Registered User
 
Join Date: 04-28-2008
Location: us
Posts: 32
Re: Re: Reading a value of Macro from a external file

Quote:
Originally posted by kinook
[B]Yes, see attached sample.

Yes, for each property specified on the Properties tab of the Make VS 2005 action (for managed projects), if the corresponding assembly attribute doesn't exist, it will be added to the project's assemblyinfo file. To add other attributes, use the Replace in File action
Hi,

I was able to sucessfully add new AssemblyName as per your instructions. however upon compiling new DLL i recieved following error

Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs
Properties\AssemblyInfo.cs(27,12): error CS0246: The type or namespace name 'AssemblyInternalBuild' could not be found (are you missing a using directive or an assembly reference?)
Done building project "WindowsApplication1.csproj" -- FAILED.

Did i miss something, why cmpiler was not able to find 'AssemblyInternalBuild' ?

TIA
Reply With Quote
  #4  
Old 05-12-2008, 01:09 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Apparently AssemblyInternalBuild is not a valid assembly attribute name.
Reply With Quote
  #5  
Old 05-12-2008, 01:11 PM
ShiamakD ShiamakD is online now
Registered User
 
Join Date: 04-28-2008
Location: us
Posts: 32
Quote:
Originally posted by kinook
Apparently AssemblyInternalBuild is not a valid assembly attribute name.
So then it looks like new assemblyAttribuributes can not be added ?

TIA
Reply With Quote
  #6  
Old 05-12-2008, 01:16 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
http://www.codinghorror.com/blog/archives/000142.html
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 06:14 PM.


Copyright © 1999-2023 Kinook Software, Inc.