Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6780333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:29:37+00:00 2026-05-26T16:29:37+00:00

I have a set of template files like <!– @TEMPLATE@ –> <!– @DONOTEDIT@ –>

  • 0

I have a set of template files like

<!-- @TEMPLATE@ -->
<!-- @DONOTEDIT@ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SuperDuper @VARIANT@</title>
</head>
<body>
...
  @PRODUCTCODENAME@
...
</body>

which I want to deploy using NAnt so that the embedded keywords are instantiated, as in

<target name="deployTemplates">
  <property name="_buildstamp" value="${DestDir}/templates_buildstamp"/>
  <uptodate property="_uptodate" verbose="${Verbose}">
    <sourcefiles basedir="${TemplateDir}">
      <include name="**"/>
    </sourcefiles>
    <targetfiles>
      <include name="${_buildstamp}"/>
    </targetfiles>
  </uptodate>
  <if test="${not _uptodate}">
    <copy todir="${CourseDestDir}" verbose="${Verbose}" overwrite="True">
      <!-- Have to specify the fileset again to maintain directory structure. -->
      <fileset basedir="${TemplateDir}">
        <include name="**"/>
      </fileset>
      <filterchain>
        <replacetokens>
          <token key="DONOTEDIT" value="Do not edit, will be overwritten."/>
          <token key="PRODUCTCODENAME" value="${Product}"/>
          <token key="VARIANT" value="${Variant}"/>
        </replacetokens>
      </filterchain>
    </copy>
    <touch file="${_buildstamp}"/>
  </if>
</target>

but how do I embed the name of the individual template files in each deployed file, that is, get @TEMPLATE@ replaced by the location of the template file so that others will know where to make permanent changes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:29:38+00:00Added an answer on May 26, 2026 at 4:29 pm

    Looking into NAnt source code and <filterchain> documentation – you will have to implement a custom Filter, which makes the current file name available for replacements. The existing filters do not expose this information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have template base.html and some children templates. I don't know how to set
I have a template set up that I'm making ajax calls to via jQuery.
I have an array set inside a velocity template that contains some paths. The
I have the whole MVC-Model set up and use HTML views as templates. But
I store my templates as files, and would like to have the opportunity to
I have my language files all set up, and everything is great when it
How do I set the path in for coldfusion file/template so that files referenced
I have a content type which displays an image. When this image is displayed
I have a code snippet like this, to be compiled under VC++ 2010. std::set<int>
We have set up a system where notifications get sent to a user with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.