You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by "Lars Corneliussen (JIRA)" <ji...@apache.org> on 2011/04/12 06:24:05 UTC

[jira] [Commented] (NPANDAY-385) JavaBindings-Generator for .NET-Mojos is fragile (and not working for NPanday.Plugin.SettingsGenerator)

    [ https://issues.apache.org/jira/browse/NPANDAY-385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018739#comment-13018739 ] 

Lars Corneliussen commented on NPANDAY-385:
-------------------------------------------

Part of the review on Mailing list:

{code}
Am 12.04.11 04:45, schrieb Brett Porter:
>> >>  >>  Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.Plugin.MojoGenerator/src/main/csharp/NPanday/Plugin/MojoGenerator/Generator.cs
>> >>  URL:http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.Plugin.MojoGenerator/src/main/csharp/NPanday/Plugin/MojoGenerator/Generator.cs?rev=1025511&r1=1025510&r2=1025511&view=diff
>> >>  ==============================================================================
>> >>  --- incubator/npanday/trunk/dotnet/assemblies/NPanday.Plugin.MojoGenerator/src/main/csharp/NPanday/Plugin/MojoGenerator/Generator.cs (original)
>> >>  +++ incubator/npanday/trunk/dotnet/assemblies/NPanday.Plugin.MojoGenerator/src/main/csharp/NPanday/Plugin/MojoGenerator/Generator.cs Wed Oct 20 11:37:11 2010
>> >>  @@ -100,11 +100,9 @@ namespace NPanday.Plugin.MojoGenerator
>> >>                  jcuLocal.unmarshall(javaClass, fileInfo);
>> >>              }
>> >>             
>> >>  -            ResourceManager resourceManager = new ResourceManager("NPanday.Plugin.MojoGenerator",
>> >>  -                                                                  Assembly.GetExecutingAssembly());
>> >>  -            String pomXml = (String) resourceManager.GetObject("pom-java.xml");
>> >>  -            TextReader reader = new StringReader(pomXml);
>> >>  -            XmlSerializer serializer = new XmlSerializer(typeof(NPanday.Model.Pom.Model));
>> >>  +            TextReader reader = new StreamReader(Assembly.GetExecutingAssembly().
>> >>  +            GetManifestResourceStream(Assembly.GetExecutingAssembly().GetManifestResourceNames()[0]));
>> >>  +            XmlSerializer serializer = new XmlSerializer(typeof(NPanday.Model.Pom.Model));
>> >>              NPanday.Model.Pom.Model model = (NPanday.Model.Pom.Model) serializer.Deserialize(reader);   
>> >>              model.artifactId = artifactId + ".JavaBinding";
>> >>              model.groupId = groupId;
> >  >  I'm not sure I understand this change. Is it reading the POM as the first resource from an asembly?
> >  
{code}

> JavaBindings-Generator for .NET-Mojos is fragile (and not working for NPanday.Plugin.SettingsGenerator)
> -------------------------------------------------------------------------------------------------------
>
>                 Key: NPANDAY-385
>                 URL: https://issues.apache.org/jira/browse/NPANDAY-385
>             Project: NPanday
>          Issue Type: Bug
>          Components: Maven Plugins
>    Affects Versions: 1.3.1-incubating
>            Reporter: Lars Corneliussen
>             Fix For: Backlog
>
>
> When building plugins\netplugins\NPanday.Plugin.Settings
> {code}
> [INFO] [mojo-generator:generate-bindings {execution: default-generate-bindings}]
> [INFO] NPANDAY-068-005: Choose executable path's parent as execution path: C:\Workbench\NPanday\svn-trunk\plugins\netplugins\NPanday.Plugin.Settings\target
> NPanday: Start Process = 28.03.2011 09:32:20
> "targetAssemblyFile=C:\Workbench\NPanday\svn-trunk\plugins\netplugins\NPanday.Plugin.Settings\target\NPanday.Plugin.Settings.dll" "outputDirectory=C:\Workbench\NPanday\svn-trunk\plugins\netplugins\NPanday.Plugin.Settings" "groupId=npanday.plugin" "artifactId=NPanday.Plugin.Settings" "artifactVersion=2.0-SNAPSHOT" "startProcessAssembly=C:\Workbench\NPanday\svn-trunk\plugins\netplugins\NPanday.Plugin.Settings\target\NPanday.Plugin.MojoGenerator.exe" "pluginArtifactPath=C:\Workbench\NPanday\svn-trunk\plugins\netplugins\NPanday.Plugin.Settings\target\NPanday.Plugin.dll"
> Creating Plugin Domain Manager
> Loading Generator: C:\Workbench\NPanday\svn-trunk\plugins\netplugins\NPanday.Plugin.Settings\target
> Creating Plugin Domain Manager
> Assembly :mscorlib
> Assembly :NPanday.Plugin
> Assembly :NPanday.Plugin.Settings
> File Exists = True
> System.InvalidOperationException: There is an error in XML document (1, 1). ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
>    at System.Xml.XmlTextReaderImpl.Throw(Exception e)
>    at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
>    at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
>    at System.Xml.XmlReader.MoveToContent()
>    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderModel.Read50_project()
>    --- End of inner exception stack trace ---
>    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
>    at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader)
>    at NPanday.Plugin.MojoGenerator.Generator.BuildPluginProject(AppDomain applicationDomain, FileInfo pluginArtifact, FileInfo outputDirectory, String groupId, String artifactId, String version)
> NPanday: End Process = 28.03.2011 09:32:20; exit code = 0
> [INFO] snapshot npanday:dotnet-repository:2.0-SNAPSHOT: checking for updates from apache.snapshots
> [INFO] [repository:convert-artifact {execution: default-convert-artifact}]
> 28.03.2011 09:32:22 info.aduna.lang.service.ServiceRegistry <init>
> INFO: Registered service class org.openrdf.query.parser.serql.SeRQLParserFactory
> {code}
> I just had a quick look into 'dotnet\assemblies\NPanday.Plugin.MojoGenerator\src\main\csharp\NPanday\Plugin\MojoGenerator\Generator.cs'. It's just taking the first embedded resource.
> {code}
> TextReader reader = new StreamReader(Assembly.GetExecutingAssembly().
> GetManifestResourceStream(Assembly.GetExecutingAssembly().GetManifestResourceNames()[0]));
> XmlSerializer serializer = new XmlSerializer(typeof(NPanday.Model.Pom.Model));
> {code}
> This needs to be improved.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira