Compiling resources and other file types

Jan 19, 2009 at 9:11 AM
We have a .NET project that uses forms localization with resources and other file types (eg. xml files).
Can we compile it with NPanday?
We tried, but NPanday ignores it.

Our project looks like:

root folder
-- project.cproj
----FormFolder
------MyForm.cs
------MyForm.resx
------MyForm.it.resx
----OtherFilesFolder
------MyBusinessFile.xml

we need in the target folder the following structure like Visual Studio:

myProject.dll
--it
----myProject.resources.dll
--OtherFilesFolder
----MyBusinessFile.xml

Is possibile?

Our pom.xml is like this:

<?xml version="1.0" encoding="utf-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <artifactId>dotnetproject</artifactId>
    <groupId>egov.factory</groupId>
    <version>1.0.0-SNAPSHOT</version>
  </parent>
 
  <groupId>Test.IT</groupId>
  <artifactId>ConsoleApplication1</artifactId>
  <packaging>exe</packaging>
  <name>ConsoleApplication1</name>
  <version>0.0.1-SNAPSHOT</version>
  <build>
    <sourceDirectory>.</sourceDirectory>
    <plugins>
      <plugin>
        <groupId>npanday.plugin</groupId>
        <artifactId>maven-compile-plugin</artifactId>
        <extensions>true</extensions>
      </plugin>

    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>Test.IT</groupId>
      <artifactId>ClassLibrary1</artifactId>
      <version>3.0.0.0</version>
      <type>library</type>
    </dependency>
  </dependencies>
</project>

Coordinator
Jan 19, 2009 at 9:15 AM
Hi,

If you can attach a sample project that could replicate this issue. that would be a lot helpful

Thanks,
Jan 19, 2009 at 9:58 AM
Hi, I uploaded an example project in the Issue tracker: http://www.codeplex.com/npanday/WorkItem/View.aspx?WorkItemId=8962

Thanks
Jan 19, 2009 at 10:32 AM
Regarding the resources files, during the compile phase i noted the following (resgen:generate-existing-resx-to-resource):

[INFO] [compile:process-test-sources]
[INFO] NPANDAY-905-001: No test source files to copy
[INFO] [resgen:copy-resources]
[INFO] [resgen:generate]
[INFO] [resgen:generate-existing-resx-to-resource]
[INFO] [compile:compile]
[INFO] NPANDAY-066-013: Found Vendor = Vendor = MICROSOFT, Vendor Version = 2.0.
50727, Framework Version = 2.0.50727, Executable Paths = [C:\WINDOWS\Microsoft.N
ET\Framework\v2.0.50727]

How can I specify the resources to compile? In the pom.xml file?

Thanks
Coordinator
Jan 20, 2009 at 12:43 AM
Hi,

If you want to use an interdependent project you first need to install the ClassLibrary1 into your local repo.
Right click over ClassLibrary1 project and use Current NPanday Project >>> Install.
After installing it to your local repo right click over the project that would use ClassLibrary1 and click Add Maven Artifact.
Locate ClassLibrary1 from the Local Tab.

Then Generate the solution's pom again.

If there are any other unclear parts feel free to ask.

Thanks,
Jan 20, 2009 at 10:09 AM
Hi,

our goal is to deploy one or more .NET Maven artifact with all the localization resources and/or other project configuration files (eg. xml with menu configuration).

I our example:1 dll, the exe file that depends from this dll, and for the exe file the localitazion resources (satellite dll's).

The following files are needed in the output folder / object installed as Maven artifact:

my.exe
dependand.dll
+-ConfigFolder
  +-myConfig.xml
+-it
  +-my.resources.dll (satellite assembly for resources in Culture IT)
  +-dependand.resources.dll (satellite assembly for resources in Culture IT of the dependand dll if available)
+-de
  +-my.resources.dll (satellite assembly for resources in Culture DE)
  +-dependand.resources.dll (satellite assembly for resources in Culture DE of the dependand dll if available)

It is possibile?
Jan 20, 2009 at 1:05 PM
I think the problem is related to the .resx files:
if you use the pom:
<?xml version="1.0" encoding="utf-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>

  <groupId>Test.IT</groupId>
  <artifactId>ConsoleApplication1</artifactId>
  <packaging>exe</packaging>
  <name>ConsoleApplication1</name>
  <version>0.0.1-SNAPSHOT</version>
  <build>
    <sourceDirectory>.</sourceDirectory>
    <resources>
        <resource><directory>FormFolder</directory></resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>npanday.plugin</groupId>
        <artifactId>maven-compile-plugin</artifactId>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>Test.IT</groupId>
      <artifactId>ClassLibrary1</artifactId>
      <version>3.0.0.0</version>
      <type>library</type>
    </dependency>
  </dependencies>
</project>

it will compile all files .cs and try to process the .resx files under folder FormFolder. But you get an error:

INFO: Registered service class org.openrdf.query.parser.sparql.SPARQLParserFactory
[INFO] Mojo Execution Time = 187
[INFO] [resolver:resolve]
[INFO] Mojo Execution Time = 0
[INFO] [NPanday.Plugin.Settings.JavaBinding:generate-settings]
[INFO] [compile:generate-assembly-info]
[INFO] NPANDAY-902-001: Found AssemblyInfo file(s), so will not generate one
[INFO] [compile:process-sources]
[INFO] NPANDAY-904-002: Copying source files: From = C:\Documents and Settings\xx\My Documents\Work\ConsoleApplication1\Conso
leApplication1,  To = C:\Documents and Settings\xx\My Documents\Work\ConsoleApplication1\ConsoleApplication1\target/build-sou
rces, File Count = 4
[INFO] [compile:process-test-sources]
[INFO] NPANDAY-905-001: No test source files to copy
[INFO] [resgen:copy-resources]
[INFO] NPANDAY-1500-003: Copied resource directory: Number of Resources = 5, Resource Directory = C:\Documents and Settings\xx\My Documents\Work\ConsoleApplication1\ConsoleApplication1\FormFolder, Destination Directory = C:\Documents and Settings\xx\
My Documents\Work\ConsoleApplication1\ConsoleApplication1\target\assembly-resources
[INFO] [resgen:generate]
[INFO] [resgen:generate-existing-resx-to-resource]
[ERROR] ResGen : error RG0000: Couldn't find input file "C:\Documents and Settings\xx\My Documents\Work\ConsoleApplication1\C
onsoleApplication1\Form1.de.resx"
[ERROR] 1 error(s).
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] NPANDAY-1501-002: Unable to execute resgen: Vendor = null, frameworkVersion = null

Embedded error: NPANDAY-070-000: Execution Path = unknown, Command = [C:\Documents and Settings\xx\My Documents\Work\ConsoleA
pplication1\ConsoleApplication1\Form1.de.resx, C:\Documents and Settings\xx\My Documents\Work\ConsoleApplication1\ConsoleAppl
ication1\target\assembly-resources\resource\Form1.de.resources]
NPANDAY-040-001: Could not execute: Command = CMD.EXE /X /C resgen "C:\Documents and Settings\xx\My Documents\Work\ConsoleApp
lication1\ConsoleApplication1\Form1.de.resx" "C:\Documents and Settings\xx\My Documents\Work\ConsoleApplication1\ConsoleAppli
cation1\target\assembly-resources\resource\Form1.de.resources", Result = -1
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11 seconds
[INFO] Finished at: Tue Jan 20 14:42:31 CET 2009
[INFO] Final Memory: 11M/25M
[INFO] ------------------------------------------------------------------------

because the plugin searches the .resx under the root folder and not in the specified subfolders.
2)
then the other issue is we copy the resx files in root folder, the compilation will go on but we get it don't link the resources (in visual studio several dll are generated) but only (for the example of first post)
target/assembly-resources/resources/Form1.de.resources,Form1.it.resources,Form1.resources and not the expected translated dlls
3)
the final step would be that, if the expected dlls are generated, they will be handled as subartifacts

if the issues of above are simply not implemented features, can we develop this?
Coordinator
Jan 21, 2009 at 1:07 AM
Hi.

NPanday has started to support this feature however the code was still having problem that is why it was discontinued for the mean time. This is currently listed as one of the higher priority items in the road map

and we will get back to you as soon as we start developing this feature.

Thanks,
Mar 13, 2009 at 8:35 PM
the fix for cultured satellites assemblies is attached in issue:
http://npanday.codeplex.com/WorkItem/View.aspx?WorkItemId=9074
the remaining problem is that the satellites dll are installed to maven repo but not to the gac
I will look at the installer plugin
Developer
Apr 27, 2010 at 9:41 AM
ermanov1 wrote:
Hi,

our goal is to deploy one or more .NET Maven artifact with all the localization resources and/or other project configuration files (eg. xml with menu configuration).

I our example:1 dll, the exe file that depends from this dll, and for the exe file the localitazion resources (satellite dll's).

The following files are needed in the output folder / object installed as Maven artifact:

my.exe
dependand.dll
+-ConfigFolder
  +-myConfig.xml
+-it
  +-my.resources.dll (satellite assembly for resources in Culture IT)
  +-dependand.resources.dll (satellite assembly for resources in Culture IT of the dependand dll if available)
+-de
  +-my.resources.dll (satellite assembly for resources in Culture DE)
  +-dependand.resources.dll (satellite assembly for resources in Culture DE of the dependand dll if available)

It is possibile?

Is this still current? We are working on a good solution for this. Would you be willing to test it when it is ready?

Apr 27, 2010 at 7:04 PM

yes is current. we delayed the porting to maven of our project but I can try your solution and let you know the results.

Our goal would be have the same outputs (with same structure) as Visual Studio does.

Apr 29, 2010 at 12:22 PM

For us is current too.

We can try it when it is ready.

Developer
May 27, 2010 at 7:43 AM
Sadly we didn't manage to include this in the 1.2 which we will release quite soon. But we are working on it. You can track the work here: http://npanday.codeplex.com/WorkItem/View.aspx?WorkItemId=12868