[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sonar-dev
Subject:    RE: [sonar-dev] Get root file system
From:       "Schulz, Christian" <Christian.Schulz () astrium ! eads ! net>
Date:       2013-05-24 12:51:57
Message-ID: 43DBE62975E8DB45B539A4B3AAA27C9AB2F027 () ffwexmc2 ! de ! astrium ! corp
[Download RAW message or body]

Hello Julien,



thanks for your fast answer.

I was trying to get the root file system to create an approach for the scm stats \
plugin to

Support multi module, but finally there is another point, which should be handled \
first.



Best Regards,



Christian Schulz



From: Julien HENRY [mailto:julien.henry@sonarsource.com]
Sent: Thursday, May 23, 2013 11:57 AM
To: dev@sonar.codehaus.org
Subject: Re: [sonar-dev] Get root file system



Hi,

I think the FileSystem of the root module is instantiated when analysis of the root \
module starts, ie after all other modules. It explains why \
module1.getRoot().getFileSystem() is null.

So short answer to "How can I acquire the root file system (from a module)?" is: not \
possible.

But maybe that if you explain what you want to achieve we could help.

++

Julien



2013/5/23 Schulz, Christian <Christian.Schulz@astrium.eads.net>

Hello,

In my sensor I try to get the root file system from the root project.

The old interface has the method getFileSystem in the interface Project, it is \
replaced

by IoC in 3.5.

I have following project structure:

Main

> -> module1

> -> module2

sonar-project.properties:

# required metadata

sonar.projectKey=test3

sonar.projectName=test3

sonar.projectVersion=1

# path to source directories (required)

sonar.modules=module1,module2

The analysis starts always with the children. In my case it was module1.

Old api:

   if (project.isModule()) {

        project.getFileSystem().getBasedir()

        project.getRoot().getFileSystem()  -> NPE

New api:

public TestSensor(ModuleFileSystem mfs) {



I haven't tried it yet with the following structure to test if the parent module has \
one.

Main

> -> module1

> > -> module2

How can I acquire the root file system?

Best Regards,

Christian Schulz

This email (including any attachments) may contain confidential and/or
privileged information or information otherwise protected from disclosure.
If you are not the intended recipient, please notify the sender immediately,
do not copy this message or any attachments and do not use it for any
purpose or disclose its content to any person, but delete this message and
any attachments from your system.
Astrium disclaims any and all liability if this email transmission
was virus corrupted, altered or falsified.
----------------------------------------------------------------------------
Astrium GmbH
Vorsitzender des Aufsichtsrates: Thomas S. Müller -
Geschäftsführung: Evert Dudok (Vorsitzender), Jens Schomburgk,
Dr. Johannes von Thadden
Sitz der Gesellschaft: München -
Registergericht: Amtsgericht München, HRB Nr. 107647
----------------------------------------------------------------------------
Weitere Informationen über EADS Astrium unter www.astrium.eads.net




This email (including any attachments) may contain confidential and/or
privileged information or information otherwise protected from disclosure.
If you are not the intended recipient, please notify the sender immediately,
do not copy this message or any attachments and do not use it for any
purpose or disclose its content to any person, but delete this message and
any attachments from your system.
Astrium disclaims any and all liability if this email transmission
was virus corrupted, altered or falsified.
----------------------------------------------------------------------------
Astrium GmbH
Vorsitzender des Aufsichtsrates:  Günter Stamerjohanns
Geschäftsführung: Evert Dudok (Vorsitzender), Jens Schomburgk,
Dr. Johannes von Thadden
Sitz der Gesellschaft: München -
Registergericht: Amtsgericht München, HRB Nr. 107647
----------------------------------------------------------------------------
Weitere Informationen über EADS Astrium unter www.astrium.eads.net


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word \
14 (filtered medium)"><style><!-- /* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
pre
	{mso-style-priority:99;
	mso-style-link:"HTML Vorformatiert Zchn";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New","serif";}
span.HTMLVorformatiertZchn
	{mso-style-name:"HTML Vorformatiert Zchn";
	mso-style-priority:99;
	mso-style-link:"HTML Vorformatiert";
	font-family:Consolas;
	mso-fareast-language:DE;}
span.E-MailFormatvorlage20
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div \
class=WordSection1><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hello \
Julien,<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>thanks for \
your fast answer.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I was \
trying to get the root file system to create an approach for the scm stats plugin \
to<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Support \
multi module, but finally there is another point, which should be handled \
first.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best \
Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span lang=EN-US \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Christian \
Schulz<o:p></o:p></span></p><p class=MsoNormal><span \
lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Julien HENRY \
[mailto:julien.henry@sonarsource.com] <br><b>Sent:</b> Thursday, May 23, 2013 11:57 \
AM<br><b>To:</b> dev@sonar.codehaus.org<br><b>Subject:</b> Re: [sonar-dev] Get root \
file system<o:p></o:p></span></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><div><div><div><div><div><p class=MsoNormal \
style='margin-bottom:12.0pt'>Hi,<o:p></o:p></p></div><p class=MsoNormal \
style='margin-bottom:12.0pt'>I think the FileSystem of the root module is \
instantiated when analysis of the root module starts, ie after all other modules. It \
explains why module1<span lang=EN-US \
style='font-family:Consolas;color:black'>.getRoot().getFileSystem(<u>)</u> is \
null.</span><o:p></o:p></p></div><p class=MsoNormal \
style='margin-bottom:12.0pt'><span lang=EN-US \
style='font-family:Consolas;color:black'>So short answer to &quot;</span><span \
lang=EN-US style='font-family:"Calibri","sans-serif"'>How can I acquire the root file \
system (from a module)?&quot; is: not possible.</span><o:p></o:p></p></div><p \
class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>But maybe that if you explain what you \
want to achieve we could help.<br><br>++</span><o:p></o:p></p></div><p \
class=MsoNormal><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>Julien</span><o:p></o:p></p></div><div><p \
class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p><div><p \
class=MsoNormal>2013/5/23 Schulz, Christian &lt;<a \
href="mailto:Christian.Schulz@astrium.eads.net" \
target="_blank">Christian.Schulz@astrium.eads.net</a>&gt;<o:p></o:p></p><div><p><span \
lang=EN-US style='font-family:"Calibri","sans-serif"'>Hello,</span><o:p></o:p></p><p><span \
lang=EN-US style='font-family:"Calibri","sans-serif"'>In my sensor I try to get the \
root file system from the root project.</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>The old interface has the method \
getFileSystem in the interface Project, it is replaced</span><o:p></o:p></p><p><span \
lang=EN-US style='font-family:"Calibri","sans-serif"'>by IoC in \
3.5.</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>I have following project \
structure:</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>Main</span><o:p></o:p></p><p><span \
lang=EN-US style='font-family:"Calibri","sans-serif"'>| -&gt; \
module1</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>| -&gt; \
module2</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>sonar-project.properties:</span><o:p></o:p></p><p><span \
lang=EN-US style='font-family:"Calibri","sans-serif"'># required \
metadata</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>sonar.projectKey=test3</span><o:p></o:p></p><p><span \
lang=EN-US style='font-family:"Calibri","sans-serif"'>sonar.projectName=test3</span><o:p></o:p></p><p><span \
lang=EN-US style='font-family:"Calibri","sans-serif"'>sonar.projectVersion=1</span><o:p></o:p></p><p><span \
lang=EN-US style='font-family:"Calibri","sans-serif"'># path to source directories \
(required)</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>sonar.modules=module1,module2</span><o:p></o:p></p><p><span \
lang=EN-US style='font-family:"Calibri","sans-serif"'>The analysis starts</span><span \
lang=EN-US> </span><span lang=EN-US style='font-family:"Calibri","sans-serif"'>always \
with the children. In my case it was module1.</span><o:p></o:p></p><p><span \
lang=EN-US style='font-family:"Calibri","sans-serif"'>Old \
api:</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:Consolas;color:black'>&nbsp;&nbsp;</span><b><span lang=EN-US> \
</span></b><b><span lang=EN-US \
style='font-family:Consolas;color:#7F0055'>if</span></b><span lang=EN-US \
style='font-family:Consolas;color:black'> (project.isModule()) \
{</span><o:p></o:p></p><p><span \
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i> </i></span><i><span \
lang=EN-US style='font-family:Consolas;color:#0000C0'>project</span></i><span \
lang=EN-US style='font-family:Consolas;color:black'>.getFileSystem().getBasedir(<u>)</u></span><o:p></o:p></p><p><span \
lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span lang=EN-US \
style='font-family:Consolas;color:black'>project.getRoot().getFileSystem(<u>)</u>&nbsp; \
-&gt; NPE</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>New api:</span><o:p></o:p></p><p><b><span \
style='font-family:Consolas;color:#7F0055'>public</span></b><u> </u><u><span \
style='font-family:Consolas;color:black'>TestSensor(ModuleFileSystem \
mfs)</span></u><span style='font-family:Consolas;color:black'> \
{</span><o:p></o:p></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<o:p></o:p></p><p><span lang=EN-US style='font-family:"Calibri","sans-serif"'>I \
haven&#8217;t tried it yet with the following structure to test if the parent module \
has one.</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>Main</span><o:p></o:p></p><p><span \
lang=EN-US style='font-family:"Calibri","sans-serif"'>| -&gt; \
module1</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>|&nbsp;</span><span lang=EN-US> \
</span><span lang=EN-US style='font-family:"Calibri","sans-serif"'>| -&gt; \
module2</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>How can I acquire the root file \
system?</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>Best \
Regards,</span><o:p></o:p></p><p><span lang=EN-US \
style='font-family:"Calibri","sans-serif"'>Christian \
Schulz</span><o:p></o:p></p></div><table class=MsoNormalTable border=0 \
cellpadding=0><tr><td style='background:white;padding:.75pt .75pt .75pt \
.75pt'><pre><span style='color:black'>This email (including any attachments) may \
contain confidential and/or<o:p></o:p></span></pre><pre><span \
style='color:black'>privileged information or information otherwise protected from \
disclosure.<o:p></o:p></span></pre><pre><span style='color:black'>If you are not the \
intended recipient, please notify the sender \
immediately,<o:p></o:p></span></pre><pre><span style='color:black'>do not copy this \
message or any attachments and do not use it for \
any<o:p></o:p></span></pre><pre><span style='color:black'>purpose or disclose its \
content to any person, but delete this message and<o:p></o:p></span></pre><pre><span \
style='color:black'>any attachments from your \
system.<o:p></o:p></span></pre><pre><span style='color:black'>Astrium disclaims any \
and all liability if this email transmission<o:p></o:p></span></pre><pre><span \
style='color:black'>was virus corrupted, altered or \
falsified.<o:p></o:p></span></pre><pre><span \
style='color:black'>----------------------------------------------------------------------------<o:p></o:p></span></pre><pre><span \
style='color:black'>Astrium GmbH<o:p></o:p></span></pre><pre><span \
style='color:black'>Vorsitzender des Aufsichtsrates: Thomas S. Müller \
-<o:p></o:p></span></pre><pre><span style='color:black'>Geschäftsführung: Evert Dudok \
(Vorsitzender), Jens Schomburgk,<o:p></o:p></span></pre><pre><span \
style='color:black'>Dr. Johannes von Thadden<o:p></o:p></span></pre><pre><span \
style='color:black'>Sitz der Gesellschaft: München \
-<o:p></o:p></span></pre><pre><span style='color:black'>Registergericht: Amtsgericht \
München, HRB Nr. 107647<o:p></o:p></span></pre><pre><span \
style='color:black'>----------------------------------------------------------------------------<o:p></o:p></span></pre><pre><span \
style='color:black'>Weitere Informationen über EADS Astrium unter <a \
href="http://www.astrium.eads.net" \
target="_blank">www.astrium.eads.net</a><o:p></o:p></span></pre></td></tr></table></div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p></div></div></body></html> <table><tr><td \
bgcolor=#ffffff><font color=#000000><pre>This email (including any attachments) may \
contain confidential and/or privileged information or information otherwise protected \
from disclosure. If you are not the intended recipient, please notify the sender \
immediately, do not copy this message or any attachments and do not use it for any
purpose or disclose its content to any person, but delete this message and
any attachments from your system.
Astrium disclaims any and all liability if this email transmission
was virus corrupted, altered or falsified.
----------------------------------------------------------------------------
Astrium GmbH
Vorsitzender des Aufsichtsrates:  Günter Stamerjohanns
Geschäftsführung: Evert Dudok (Vorsitzender), Jens Schomburgk,
Dr. Johannes von Thadden
Sitz der Gesellschaft: München -
Registergericht: Amtsgericht München, HRB Nr. 107647
----------------------------------------------------------------------------
Weitere Informationen über EADS Astrium unter \
www.astrium.eads.net</pre></font></td></tr></table>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic