Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Regex in .vbproj questionRegex in .vbproj question
Previous
 
Next
New Post
9/30/2009 6:38 PM
 

 

Hey All

I'm trying to automate versioning of the .dnn files through the project file for my module. I've got it almost working but I've only got one .dll out of the three in the package that I need to update the version on so I thought I'd try to reference the carriage return or newline property in my .dnn file.

This is what's in my .dnn file that needs to be changed:

<name>SOB.CRTS.dll</name>
<version>01.00.00</version>

This is my regex line:

<FileUpdate Files=@(dnnFile)" Regex="&lt;name&gt;SOB.CRTS.dll&lt;/name&gt;\s&lt;version&gt;.*&lt;/version&gt;" ReplacementText="&lt;name&gt;SOB.CRTS.dll&lt;/name&gt;\s&lt;version&gt;$(Major).$(Minor).&(Build).$(Revision)&lt;/version&gt;" />

From what I've read \s is supposed to take care of any tabs, spaces, or carriage returns. I've also tried \n and \r in place of the \s. If I just regex on the version line it works fine but overwrites the versions on the other .dlls as well.

Any ideas?

 
New Post
9/30/2009 7:45 PM
 

 I ran into the same issue and after about 20 minutes of trying exactly the same regex options and failing, I just ended up changing the DNN manifest to put both <name> and <version> on a single line... the DNN installer doesn't seem to mind, then the regex FileUpdate function can target an individual assembly and update the version number... 

<name>SOB.CRTS.dll</name><version>01.00.00</version>

 
New Post
9/30/2009 8:50 PM
 

Since the \s character class would match one and only one whitespace character, I believe you would need to follow it with the * quantifier since each line of the manifest would end with both carriage return and line feed characters. Also, the manifest most likely would indent lines with multiple spaces or tabs. So, try using

      \s*

between </name> and <version>

Another possibility would be to use the dot character class followed by the * quantifier, that is .*, but to match the new line character would require that the Regex Singleline option be turned on - not sure if you can add the attribute Singleline="True" in the FileUpdate task.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
10/1/2009 12:13 AM
 

 Thanks guys. I'll try your suggestions tomorrow to see which works out. My understanding of /s was that it took care of any whitespace, tabs, and carriage returns but I could very easily be wrong. A thought that has crossed my mind was that maybe I needed a \s\n\s (the \n would be in case it reads the .dnn file as a newline rather than a carriage return).

 
New Post
10/1/2009 3:22 PM
 

Almost got it.

<FileUpdate Files="@(dnnFile)" Regex="&lt;name&gt;SOB\.CRTS\.dll&lt;/name&gt;\s*&lt;version&gt;.*&lt;/version&gt;" ReplacementText="&lt;name&gt;SOB.CRTS.dll&lt;/name&gt;Chr(13)&lt;version&gt;$(Major).$(Minor).$(Build).$(Revision)&lt;/version&gt;" />

That will do the replacement like I want but I'd like to keep the lines separated if I can figure it out. Right now if I put a \n, \r, Chr(13), etc it puts that actual text into the .dnn file.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Regex in .vbproj questionRegex in .vbproj question


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out