#314 ResGen task does not use dynamicprefix

0.85
closed-fixed
Tasks (408)
5
2005-02-24
2005-02-23
stj3570
No

--- Description ---
The Resgen task is not using the dynamic prefix (passed
through the <resourcefileset>) properly.

Currently it is just prefixing the value of the dynamic
prefix to the resource filename while creating a
.resource file. It does not resolve the complete
subfolder names to generate the appropriate .resource
file.

--- Steps To Reproduce ---
(see attached repro)
1) Create a resource file Foo.en-us.resx, under the
relative project path .\Bar\

2) Compile the resource file using the following NAnt task
<resgen>
<resources prefix="Example" dynamicprefix="true">
<include name="**\*.resx" />
</resources>
</resgen>

3) Execute NAnt.exe 0.85 in the project root directory

--- Expected Result ---
A file named "Example.Bar.Foo.en-us.resources" should
be created in the subdirectory .\Bar\

--- Actual Result ---
The file is incorrectly named
"Example.Foo.en-us.resources" ; the dynamic prefix from
the subdirectory "Bar" is missing.

--- Suggested Fix ---

The function ResourceFileSet::GetManifestResourceName()
gets the correct resource name. It should be used by
the ResGen task.

Edit project file
".\src\NAnt.DotNet\Tasks\ResGenTask.cs" line # 346:

Current Line #346:
> FileInfo outputFile = GetOutputFile(new
FileInfo(filename), Resources.Prefix);

Fixed Line # 346:
> FileInfo outputFile = new FileInfo(
Resources.GetManifestResourceName(filename, filename));

Discussion

  • stj3570

    stj3570 - 2005-02-23

    Bug Repro Archive

     
  • stj3570

    stj3570 - 2005-02-23

    Fixed ResGenTask.cs

     
  • stj3570

    stj3570 - 2005-02-23

    Logged In: YES
    user_id=1066215

    CORRECTION: Should fix lines # 374-375 and # 411-412

     
  • Gert Driesen

    Gert Driesen - 2005-02-24
    • assigned_to: nobody --> drieseng
    • status: open --> closed-fixed
     
  • Gert Driesen

    Gert Driesen - 2005-02-24

    Logged In: YES
    user_id=707851

    This is now fixed in CVS. The patch you supplied was not
    correct though, as it did not honor the "todir" attribute.

    But thanks anyway !

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks