sun_checks.xml location in checkstyle-idea.xml - classpath

My checkstyle-idea.xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA">
<option name="configuration">
<map>
<entry key="active-configuration" value="CLASSPATH:/sun_checks.xml:The default CheckStyle rules" />
<entry key="check-nonjava-files" value="false" />
<entry key="check-test-classes" value="false" />
<entry key="location-0" value="CLASSPATH:/sun_checks.xml:The default CheckStyle rules" />
<entry key="suppress-errors" value="false" />
<entry key="thirdparty-classpath" value="" />
</map>
</option>
</component>
</project>
And i can't seem to find this file in my Ubuntu 14.04. Searched everywhere. The only solution i see is to download it and replace that location.
But is there a way to understand where it is located now?
My /etc/environment doesn't contain it also. So where is it? Because CheckStyle works and checks the code in Idea.

The Checkstyle-IDEA plugin contains a copy of the Sun Checks (sun_checks.xml). It is contained in the root of the plugin's JAR file. The plugin JAR is usually located at:
Linux: ~/.<PRODUCT><VERSION>/config/plugins/CheckStyle-IDEA/lib/checkstyle-idea-4.5.2.jar
Windows: C:\Users\<YourUserName>\.<PRODUCT><VERSION>\config\plugins\CheckStyle-IDEA\lib\checkstyle-idea-4.5.2.jar
Version numbers may differ in your case. The part .<PRODUCT><VERSION> should appear as something like .IdeaIC13 (for IntelliJ IDEA version 13).
Note that you should not need to find this file. You should never change it or touch it in any way. If you need to change the rules configuration, create your own rule set and use that. You may of course create your own rule set based on a copy of sun_checks.xml.

For mac I located it by typing:
sudo find / -iname Checkstyle-IDEA
Which lead me to
~/Library/Application Support/IntelliJIdea15/CheckStyle-IDEA/lib
I was then able to open the jar with an archive program and make a copy of the sun_checks.xml for my own customization.

Related

How to quickly copy the current editing file name or full file path in Eclipse (Luna)?

This 'solution' doesn't look to work any longer in the Luna version:
Copy path/file name in Eclipse to clipboard
This is actually a must have feature for a rich IDE!
You can use start explorer (alternate link) or Copy path plugin.
Short cut key to copy path to clipboard in star explorer is : Ctrl+Alt+
C
Standard eclipse eclipse doest have such key. You can select resource in Package/Project/Navigator view and press Alt+Enter to open property dialog and then copy path from here.
I am using Eclipse Java EE IDE for Web Developers.Version: Luna Release (4.4.0)
Build id: 20140612-0600
You can right mouse click on the file and select "Copy Qualified Name".
For this particular example, the path in clipboard is
/TestingProject/src/com/website/testing/App1.java
Use the EasyShell plugin
If using Eclipse 4.14 or later, from Dec 2019 or later, neither StartExplorer nor Path Tools nor Copy as Path works.
Instead, use EasyShell, which works great!
Instructions:
Unsure no text or code is selected.
Right-click anywhere in your open Eclipse file editor, including on empty space near your code, or in the Project Explorer pane.
Go to "EasyShell" --> "Copy Full Path to Clipboard", or "Copy Qualified Name to Clipboard" (see screenshot below).
You now have the file path copied. Paste it wherever you want.
Totally unrelated aside
Additional note: as far as good Ecliplse plugins go in general, I also highly recommend the DevStyle plugin, set to "Dark Gray (Darkest Dark)" Workbench theme, with the DevStyle "Editor theme" (syntax highlighting) set to Sublime Text 3 (Monokai), by Jeremy Shepherd <-- Update Feb 2020: dead links. Instead, I've copied and pasted the contents of Jeremy Shepherd's .xml file at the bottom of this answer.
Sublime Text 3 (Monokai) - by Jeremy Shepherd--theme-25808.xml:
<?xml version="1.0" encoding="utf-8"?>
<colorTheme id="25808" name="Sublime Text 3 (Monokai)" modified="2014-04-11 19:52:55" author="Jeremy Shepherd">
<searchResultIndication color="#757575" />
<filteredSearchResultIndication color="#757575" />
<occurrenceIndication color="#000000" />
<writeOccurrenceIndication color="#000000" />
<findScope color="#111111" />
<deletionIndication color="#D25252" />
<sourceHoverBackground color="#000000" />
<singleLineComment color="#75715E" italic="false" />
<multiLineComment color="#75715E" italic="false" />
<commentTaskTag color="#CCDF32" italic="false" underline="true" strikethrough="false" />
<javadoc color="#76725E" italic="false" />
<javadocLink color="#76725E" italic="false" underline="true" strikethrough="false" />
<javadocTag color="#FD2971" italic="false" />
<javadocKeyword color="#C2BFA6" italic="false" />
<class color="#56D8F0" bold="false" underline="false" strikethrough="false" />
<interface color="#D197D9" />
<method color="#FFFFFF" />
<methodDeclaration color="#7BE12A" />
<bracket color="#D8D8D8" />
<number color="#7FB347" />
<string color="#E7DD6C" />
<operator color="#D8D8D8" />
<keyword color="#F12971" bold="false" />
<annotation color="#FFFFFF" />
<staticMethod color="#BED6FF" />
<localVariable color="#E7F8F2" />
<localVariableDeclaration color="#F12971" />
<field color="#7BE12A" />
<staticField color="#EFC090" />
<staticFinalField color="#EFC090" />
<deprecatedMember color="#D25252" underline="false" strikethrough="true" />
<enum color="#7BE12A" />
<inheritedMethod color="#BED6FF" />
<abstractMethod color="#BED6FF" />
<parameterVariable color="#79ABFF" />
<typeArgument color="#BFA4A4" />
<typeParameter color="#BFA4A4" />
<constant color="#EFB571" />
<background color="#272822" />
<currentLine color="#3E3D32" />
<foreground color="#F8F8F2" />
<lineNumber color="#72736A" />
<selectionBackground color="#757575" />
<selectionForeground color="#D0D0D0" />
</colorTheme>
Sublime Text 3 (Monokai) - by Jeremy Shepherd--theme-25808.epf:
Too long to post here. See my dotfiles project to download it instead.

What are the steps needed in DITA-OT to pass ANT command line parameters to custom plugin's override XSLT-script

This question follows this: Is it possible to pass custom ANT parameters into custom plugin with DITA-OT?
I have plugin folder called: com.mymods.pdf under DITA-OT/plugins folder. Under is explained the structure and files shortly (follows this example closely http://dita-ot.github.io/1.8/readme/dita2pdf-customization.html). Plugin works but now I want to pass ANT command line parameters into mycustom.xsl:
com.mymods.pdf/
cfg/
common/
vars/
en.xml
fo/
attrs/
mycustom.xsl
xsl/
mycustom.xsl
catalog.xml
integrator.xml
plugin.xml
build_mymods_pdf_template.xml (dita2com.mymods.pdf.init target is here and it depends on dita2pdf2)
build.xml (<project><import file="build_mymods_pdf.xml"/></project>)
insertParameters.xml (see the linked question for contents)
So where I need to apply changes and/or add new files?
I use the plugin from other location with "mainANT.xml" which has target and transtype for using "dita2mymodsPDF".
plugin.xml code:
<?xml version='1.0' encoding='UTF-8'?>
<plugin id="com.mymods.pdf">
<require plugin="org.dita.pdf2" />
<feature extension="dita.conductor.transtype.check" value="com.mymods.pdf" />
<feature extension="dita.transtype.print" value="com.mymods.pdf" />
<feature extension="dita.conductor.target.relative" file="integrator.xml" />
<feature extension="dita.conductor.com.mymods.pdf.param" file="insertParameters.xml"/>
<extension-point id="dita.conductor.com.mymods.pdf.param" name="PDF XSLT parameters"/>
</plugin>
build_mymods_pdf_template.xml code:
<?xml version='1.0' encoding='UTF-8'?>
<project name="com.mymods.pdf" default="com.mymods.pdf">
<property name="transtype" value="com.mymods.pdf"/>
<target name="dita2com.mymods.pdf.init">
<property location="${dita.plugin.com.mymods.pdf.dir}/cfg" name="customization.dir" />
<property location="${dita.plugin.com.mymods.pdf.dir}/xsl/fo/topic2fo_shell_fop.xsl" name="args.xsl.pdf" />
<property name="args.chapter.layout" value="BASIC" />
<property name="args.bookmark.style" value="COLLAPSED" />
<!--property name="args.fo.include.rellinks" value="nofamily" /-->
</target>
<target depends="dita2com.mymods.pdf.init, dita2pdf2" name="dita2com.mymods.pdf" />
</project>
Also integrator.xml code:
<?xml version='1.0' encoding='UTF-8'?>
<project name="com.mymods.pdf">
<target name="dita2com.mymods.pdf.init">
<property location="${dita.plugin.com.mymods.pdf.dir}/cfg" name="customization.dir" />
<property location="${dita.plugin.com.mymods.pdf.dir}/xsl/fo/topic2fo_shell_fop.xsl" name="args.xsl.pdf" />
<property name="args.chapter.layout" value="BASIC" />
<property name="args.bookmark.style" value="COLLAPSED" />
<!--property name="args.fo.include.rellinks" value="nofamily" /-->
</target>
<target depends="dita2com.mymods.pdf.init, dita2pdf2" name="dita2com.mymods.pdf" />
</project>
Not totally sure whether integrator.xml or build_mymods_pdf_template.xml is like it actually should. But this fileset works and uses mycustom.xsl (other for attributes and other for XSLT overrides). Now the problem is that how to get my own custom ANT parameters so the plugin can see its value.
This is really easy for pdf2 plugin but still can't yet get it working inside my com.mymods.pdf . I think I don't need to post catalog.xml because it just tells where are "mycustom.xsl" files that are working properly.
Really easy way, not the cleanest way to do this is:
Note: This applies for DITA-OT 1.8.4 check suitability for other versions.
Create your custom PDF plugin as told in: http://dita-ot.github.io/1.8/readme/dita2pdf-customization.html
Create "insertParameters.xml" as in: http://dita-ot.github.io/1.8/dev_ref/plugin-xsltparams.html
In my case with following custom parameters:
<?xml version='1.0' encoding='UTF-8'?>
<dummy>
<!-- EXAMPLE: <param name="paramNameinXSLT" expression="${antProperty}" if="antProperty"/> -->
<param name="custom.data1" expression="${custom.data1}" if="custom.data1"/>
<param name="custom.data2" expression="${custom.data2}" if="custom.data2"/>
</dummy>
Now drop this "insertParameters.xml" into DITA-OT\plugins\org.dita.pdf2
Create processing to custom.xsl under xsl\custom.xsl.
Here is an example code snippet for custom.xsl
<?xml version='1.0' encoding='UTF-8'?>
<snippet>
<xsl:param name="custom.data1"/>
<xsl:param name="custom.data2"/>
<fo:block><xsl:value-of select="$custom.data1"/></fo:block>
<fo:block><xsl:value-of select="$custom.data2"/></fo:block>
</snippet>
Run integrator.xml to integrate changes into your DITA-OT.
Give in command line commands for running your PDF scenario like: "ant dita2mypdf -f -Dcustom.data1="myCustomParameter1value" -Dcustom.data2="myCustomParameter2value"
Run the process to create PDF and your parameters should be visible!
What this question was really intended to achieve to get a step by step instruction to set all these things to work 100% in the custom plugin that not a single thing needs to be added into DITA-OT default plugins (not even single file into pdf2 folder as in this solution). This could make updating DITA-OT remarkably easier for future.
The cleaner? alternative to this approach is
add a placeholder insertParameters.xml to the root of the DITA-OT 1.8.5. The file does not exist in the standard DITA-OT 1.8.5
<?xml version='1.0' encoding='UTF-8'?>
<dummy>
<param name="dummy" expression="{$dummy} if="dummy"/>
</dummy>
add the override insertParameters.xml to the root of your plugin
<?xml version='1.0' encoding='UTF-8'?>
<dummy>
<param name="my.runtime.parameter" expression="{$my.runtime.parameter} if="my.runtime.parameter"/>
</dummy>
Then run ant -f integrator.xml
Without knowing precisely which parameters you need to pass, it's difficult to answer this question. However, let's assume you're invoking this from the command line and you've defined a transtype of mymodspdf. The command would look like this:
ant -f build.xml -Dtranstype mymodspdf -Dmyparameter1 paramval1 -Dmyparameter2 paramval2
HTH,
Julio J. Vazquez
Write Spirit
http://www.writespiritservices.com

How can I let CruiseControl.NET/nant run all Unittest projects postfixed with .Test?

In our continuous integration setup, I would like to set up CruisControl.NET to automatically run all our unittests. However, I don't want to have to specify every unittest dll seperately in the configuration.
All the unittest projects are all postfixed with .Test (and all non-unittest projects are not). How can I configure CruiseControl.NET to run all the unittests from these projects (I am using v1.5.7256.1 of CruiseControl.NET)?
My current config attempt:
<nunit>
<path>$(nunit.path)</path>
<assemblies>
<assembly>$(working.dir)\**\*.Test.dll</assembly>
</assemblies>
</nunit>
I'm finding it very difficult to find documentation on this specific nunit element. Most pages I can find talk about using exec, nunit2 or another nunit element or the nunit-console commandline options.
I don't have much experience with managing the build environment and am working on an existing configuration where every assembly was specified separately in the following manner.
<nunit>
<path>$(nunit.path)</path>
<assemblies>
<assembly>$(artifact.dir)\test1.dll</assembly>
<assembly>$(artifact.dir)\test2.dll</assembly>
</assemblies>
</nunit>
Hence my failed attempt using wild cards.
EDIT:
Here is some extra xml of my configuration file to show the context a little bit:
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<project name="MyProject">
<!-- whole bunch of other elements -->
<tasks>
<nunit>
<!-- see above -->
</nunit>
</tasks>
</project>
</cruiscontrol>
After Mightmuke's suggestion, I tried replacing the <nunit> element with his suggestion, but got the following exception: Unable to instantiate CruiseControl projects from configuration document. Configuration document is likely missing Xml nodes required for properly populating CruiseControl configuration. Unable to load array item 'property' - Cannot convert from type System.String to ThoughtWorks.CruiseControl.Core.ITask for object with value: ""
Then I tried to move the <property> and <foreach> element outside the element. Then I get the exception: Unused node detected: <property name="nunit.filelist" value="" />
I'm now trying to find out more about the <foreach> element and where I can put that, but somehow I find it hard to find any documentation about it.
EDIT2:
I found the documentation of the nunit task I'm using: http://ccnet.sourceforge.net/CCNET/NUnit%20Task.html
I specifies the element to be of type String[]. I'm not sure what that means... but it seems from the example that it just means that it must contain a list of child elements of the same name in Singular form.
PS: I realize this question is getting a bit out of hand... When the whole thing is solved, I'll try to edit it in such a format so that it might be useful to someone else later.
This is an example configuration if you were to use the nunit console.
<property name="nunit.filelist" value="" />
<foreach item="File" property="testfile" verbose="true">
<in>
<items basedir=".">
<include name="${working.dir}\**\*.Test.dll" />
</items>
</in>
<do>
<property name="nunit.filelist" value="${nunitfile.list + ' ' + testfile}" />
</do>
</foreach>
<exec program="nunit-console-x86.exe" failonerror="true" verbose="true">
<arg value="${nunit.filelist}" />
<arg value="/xml=nunit-results.xml" />
<arg value="/nologo" />
<arg value="/nodots" />
</exec>
This hasn't been tested, and there are likely better ways to skin it, but it will hopefully provide a starting point for you.

NAnt and build version

I use Nant for automating ClickOnce build. So after building the application I need to know what is its version (for purpose of folder creation). Also I need build autoincrementing.
For building I use msbuild.exe /t:publish
For this you can use your source code repository revision number/hash as that is often used when using subversion or git repositories.
You can also make use of a buildserver like cruisecontrol (ccnet) this will do this build version incrementing for you.
As far as I understood, you would like to do version detection/management with minimal effort.
Why don't you use AssemblyInfo auto-increment capabilities. Putting [assembly: AssemblyVersion("1.0.*")] into your AssemblyInfo.cs will increment the build number with every build. Find more information in this answer.
After compilation you can detect the assembly version via NAnt function assemblyname::get-version:
assemblyname::get-version(assemblyname::get-assembly-name('MyAssembly.dll'))
Update:
If you can't use Assembly info auto-increment capabilities, you might let NAnt create AssemblyInfo.cs with every build using NAntContrib's <version>-task.
<loadtasks assembly="C:\PathToNAntContibTasks\NAnt.Contrib.Tasks.dll" />
<target name="assemblyinfo" description="generates AssemblyInfo.cs">
<property
name="working.dir"
value="C:\src\foo" />
<property
name="build.number.path"
value="${path::combine(working.dir, 'build.number')}" />
<echo
file="${build.number.path}"
message="0.0.0.0"
unless="${file::exists(build.number.path)}" />
<version
buildtype="Increment"
path="${build.number.path}"/>
<foreach
item="File"
property="assemblyinfo.path">
<in>
<items>
<include name="${path::combine(working.dir, '**\AssemblyInfo.cs')}" />
</items>
</in>
<do>
<asminfo output="${assemblyinfo.path}" language="CSharp">
<imports>
<import namespace="System.Reflection" />
</imports>
<attributes>
<attribute type="AssemblyVersionAttribute" value="${buildnumber.version}" />
</attributes>
</asminfo>
</do>
</foreach>
</target>

WiX plugin installer needs to reference primary installation

I have created a second plugin for my primary program which allows it to open additional file extensions. Now when creating the "Verb" element to associate the new file extension with the executable of the primary executable (installed from a different installer which I also created) I do not know how to reference said executable.
<!-- Associate file type -->
<ProgId Id='myfile' Description='My file'>
<Extension Id='ext' ContentType='application/ext'>
<Verb Id='open' Command='Open' TargetFile="INSERT MAGIC HERE" Argument='"%1"' />
</Extension>
</ProgId>
thanks
brian
If you know the GUID of the Component that installed the file that is the target of the shortcut a ComponentSearch is the easiest way to get what you want. Something like:
<Property Id="TARGET_FILE">
<ComponentSearch Id="FindTargetFile" Guid="{GUID-OF-TARGET-FILE-COMPONENT}" Type="file">
<FileSearch Id="FoundTargetFile" Name="file.exe" />
</ComponentSearch>
</Property>
<Component>
<ProgId Id='myfile' Description='My file'>
<Extension Id='ext' ContentType='application/ext'>
<Verb Id='open' Command='Open' TargetProperty="[TARGET_FILE]" Argument='"%1"' />
</Extension>
</ProgId>
</Component>