Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Creating checkstyle configuration file
Creating checkstyle configuration file [message #1413450] Thu, 28 August 2014 14:43 Go to next message
Jonathan Dumont is currently offline Jonathan DumontFriend
Messages: 58
Registered: March 2011
Location: Laval
Member
Hi,

I try to build our shared IDE with an Oomph setup. I'm getting close to the expecting result, but there are still some little tasks to complete manually, like the Checkstyle configuration.

Indeed, we use a custom checkstyle configuration, stored in a configuration project in our workspace. Thus, in the preferences dialog we create a new configuration, with a type "Project relative configuration". This is not stored in a preference, but in a file checkstyle-config.xml, in the folder ".metadata\.plugins\net.sf.eclipsecs.core" of the workspace.

My question is : What is the best way to manage the checkstyle configuration with the Oomph setup ? Must I use a basic Resource creation task to create the config file ?

Thanks
Re: Creating checkstyle configuration file [message #1413474 is a reply to message #1413450] Thu, 28 August 2014 16:12 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Jonathan,

We don't use Checkstyle ourselves and don't know the format and semantics of its configuration files, so I'm not sure I
can give the best advice. A ResourceCreationTask with a targetURL =
${workspace.location|uri}/.metadata/.plugins/net.sf.eclipsecs.core/checkstyle-config.xml might do the job for you. It
doesn't seem very composable but maybe that's not your immediate problem.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 28.08.2014 um 16:43 schrieb Jonathan Dumont:
> Hi,
>
> I try to build our shared IDE with an Oomph setup. I'm getting close to the expecting result, but there are still some
> little tasks to complete manually, like the Checkstyle configuration.
>
> Indeed, we use a custom checkstyle configuration, stored in a configuration project in our workspace. Thus, in the
> preferences dialog we create a new configuration, with a type "Project relative configuration". This is not stored in
> a preference, but in a file checkstyle-config.xml, in the folder ".metadata\.plugins\net.sf.eclipsecs.core" of the
> workspace.
>
> My question is : What is the best way to manage the checkstyle configuration with the Oomph setup ? Must I use a basic
> Resource creation task to create the config file ?
>
> Thanks


Re: Creating checkstyle configuration file [message #1413556 is a reply to message #1413474] Thu, 28 August 2014 20:58 Go to previous messageGo to next message
Jonathan Dumont is currently offline Jonathan DumontFriend
Messages: 58
Registered: March 2011
Location: Laval
Member
Hi Eike,

I have finally found a solution similar to your suggestion : I have created a Resource Creation task with the following properties :
targetURL="platform:/meta/net.sf.eclipsecs.core/checkstyle-config.xml"
encoding="UTF-8"
excludedTriggers="BOOTSTRAP"
content='your checkstyle config file content'


Notice that as the resource creation is done in the workspace metadata, it can't be done with the bootstrap trigger.
Re: Creating checkstyle configuration file [message #1413669 is a reply to message #1413556] Fri, 29 August 2014 05:48 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 28.08.2014 um 22:58 schrieb Jonathan Dumont:
> Hi Eike,
>
> I have finally found a solution similar to your suggestion : I have created a Resource Creation task with the
> following properties : targetURL="platform:/meta/net.sf.eclipsecs.core/checkstyle-config.xml"
> encoding="UTF-8"
> excludedTriggers="BOOTSTRAP"
> content='your checkstyle config file content'
>
> Notice that as the resource creation is done in the workspace metadata, it can't be done with the bootstrap trigger.
The URL I posted should work in bootstrap, too.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: Creating checkstyle configuration file [message #1719458 is a reply to message #1413669] Fri, 08 January 2016 08:15 Go to previous messageGo to next message
Avneesh Singh is currently offline Avneesh SinghFriend
Messages: 22
Registered: September 2015
Junior Member
Hi,
Is your Checkstyle config working now??

Thanks,
Avneesh
Re: Creating checkstyle configuration file [message #1742808 is a reply to message #1719458] Wed, 07 September 2016 18:06 Go to previous messageGo to next message
Andreas  Hoehmann is currently offline Andreas HoehmannFriend
Messages: 14
Registered: July 2009
Location: Leipzig
Junior Member
Hi all, I know this thread is a little bit old Smile I'm trying the same as the author of this thread and the end result is not perfect. I put this to my installation.setup:

<setupTask
      xsi:type="setup:CompoundTask"
      id="checkstyle.prefs"
      disabled="false"
      name="Checkstyle Setup">
    <setupTask
        xsi:type="setup:ResourceCreationTask"
        excludedTriggers="BOOTSTRAP"
        filter=""
        content="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>&#xA;&#xA;&lt;checkstyle-configurations file-format-version=&quot;5.0.0&quot; default-check-configuration=&quot;GOOS Checkstyle&quot;>&#xA;  &lt;check-configuration name=&quot;GOOS Checkstyle&quot; location=&quot;configuration\checkstyle\goos-checkstyle.xml&quot; type=&quot;external&quot; description=&quot;&quot;>&#xA;    &lt;additional-data name=&quot;protect-config-file&quot; value=&quot;true&quot;/>&#xA;  &lt;/check-configuration>&#xA;&lt;/checkstyle-configurations>&#xA;"
        targetURL="${workspace.location|uri}/.metadata/.plugins/net.sf.eclipsecs.core/checkstyle-config.xml"
        encoding="UTF-8">
      <description></description>
    </setupTask>
  </setupTask>


But now every time I'm using this eclipse to start a (new) workspace ... oomph is asking for the "workspace.location". Hmm ... I think this could be done better Smile Why oomph doesn't know the "current" workspace location? Is there another placeholder for that.

Kind Regards
Andreas Höhmann
Re: Creating checkstyle configuration file [message #1742831 is a reply to message #1742808] Thu, 08 September 2016 04:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
This deals with the same issue: https://www.eclipse.org/forums/index.php/m/1738209/?srch=workspace.location+osgi.#msg_1738209

The workspace.location variable is induced by a Workspace task, but there will only be such a task if your workspace.setup references a project stream. In general you can use ${osgi.instance.area|file} to refer to the workspace location if the task is performing in an IDE with a workspace.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Creating checkstyle configuration file [message #1742984 is a reply to message #1742831] Fri, 09 September 2016 05:50 Go to previous message
Andreas  Hoehmann is currently offline Andreas HoehmannFriend
Messages: 14
Registered: July 2009
Location: Leipzig
Junior Member
Perfect! Works for me. Thxs Very Happy
Previous Topic:Resource Copy of newer resource version
Next Topic:Concurrent access to bundle pool with several users
Goto Forum:
  


Current Time: Sat Apr 20 00:48:34 GMT 2024

Powered by FUDForum. Page generated in 0.04209 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top