Skip to content

Commit

Permalink
[ENGOPS-3548] Changes to allow packaging of code standards for maven use
Browse files Browse the repository at this point in the history
  • Loading branch information
Hilario Fernandes committed Sep 15, 2017
1 parent 235b816 commit b724252
Show file tree
Hide file tree
Showing 11 changed files with 195 additions and 12 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
bin/
target/
dist/
js-lib/
lib/
test-lib/
eclipse-bin/
override.properties
testdata.log
testdata.properties
testdata.script
.classpath
.project
.DS_Store
.idea
projects/
plugins/
build-res/dojo-*
build-res/module-scripts/
*.class
*.jar
*.war
*.ear
*.iml
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2002 - 2017, Pentaho Corporation (Pentaho)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ CheckStyle will soon be integrated into our build system. Until that time, you'l
### Installation (Eclipse):

- Install CheckStyle plugin http://eclipse-cs.sf.net/update/
- Configure the plugin to use the `pentaho_checkStyle.xml`; give it the raw github URL: https://raw.githubusercontent.com/pentaho/pentaho-coding-standards/master/pentaho_checkStyle.xml
(that will also dynamically retrieve the Pentaho suppressions.xml referenced in the checker)
- Configure the Eclipse Code Formatter to use the attached pentaho_formatter.xml
- Configure the plugin to use the `checkstyle/pentaho_checks.xml`; give it the raw github URL [here](https://raw.githubusercontent.com/pentaho/pentaho-coding-standards/master/checkstyle/pentaho_checks.xml)
- Configure the Eclipse Code Formatter to use the attached `ide/eclipse_formatter.xml`

The Eclipse CheckStyle plugin documentation my be helpful: http://eclipse-cs.sourceforge.net

Expand All @@ -20,11 +19,10 @@ The Eclipse CheckStyle plugin documentation my be helpful: http://eclipse-cs.sou
- Select "8.0" in the "Checkstyle version" dropdown
- Select "Only Java sources (including tests) in the "Scan Scope" dropdown
- Click "Apply"
- Select "Use a checkstyle file accessible via HTTP" with the raw github URL:
https://raw.githubusercontent.com/pentaho/pentaho-coding-standards/master/pentaho_checkStyle.xml
- Alternatively, you can select "Usa a local Checkstyle file". Clone this repo and use the `pentaho_checkStyle.xml`.
- Select "Use a checkstyle file accessible via HTTP" with the raw github URL [here](https://raw.githubusercontent.com/pentaho/pentaho-coding-standards/master/checkstyle/pentaho_checks.xml)
- Alternatively, you can select "Use a local Checkstyle file". Clone this repo and use the `checkstyle/pentaho_checks.xml`.
- Configure code style
- Copy the codeStyleSettings.xml into your IntelliJ project folder (`{{IdeaIntelliJProjectFolder}}/.idea/codeStyleSettings.xml`). Overwrite if it's already there.
- Copy the`ide/intelliJ_codeStyleSettings.xml` into your IntelliJ project folder (`{{IdeaIntelliJProjectFolder}}/.idea/codeStyleSettings.xml`). Overwrite if it's already there.
- Open IntelliJ, set the Project Settings -> Code Style -> Scheme to "Project"

## Additional Information
Expand Down
18 changes: 18 additions & 0 deletions assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>archive</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<includes>
<include>checkstyle/**</include>
<include>pmd/**</include>
<include>ide/**</include>
</includes>
</fileSet>
</fileSets>
</assembly>
2 changes: 0 additions & 2 deletions checkstyle-maven.properties

This file was deleted.

File renamed without changes.
3 changes: 0 additions & 3 deletions pentaho_checkStyle.xml → checkstyle/pentaho_checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
<property name="onCommentFormat" value="CHECKSTYLE:([^:]+):ON"/>
<property name="checkFormat" value="$1"/>
</module>
<module name="SuppressionFilter">
<property name="file" value="https://raw.githubusercontent.com/pentaho/pentaho-coding-standards/master/suppressions.xml"/>
</module>
<module name="TreeWalker">
<module name="FileContentsHolder"/>
<module name="ArrayTypeStyle">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
127 changes: 127 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<groupId>org.pentaho</groupId>
<artifactId>coding-standards</artifactId>
<version>8.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Pentaho Coding Standards</name>

<scm>
<connection>scm:git:git@github.com:pentaho/pentaho-coding-standards.git</connection>
<url>https://github.com/pentaho/pentaho-coding-standards</url>
<developerConnection>scm:git:git@github.com:pentaho/pentaho-coding-standards.git</developerConnection>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<repository>
<id>pentaho.public.release.repo</id>
<name>Pentaho Public Release Repository</name>
<url>${pentaho.public.release.repo}</url>
</repository>
<snapshotRepository>
<id>pentaho.public.snapshot.repo</id>
<name>Pentaho Public Snapshot Repository</name>
<url>${pentaho.public.snapshot.repo}</url>
</snapshotRepository>
</distributionManagement>

<properties>
<pentaho.public.release.repo>http://nexus.pentaho.org/content/repositories/public-release/</pentaho.public.release.repo>
<pentaho.public.snapshot.repo>http://nexus.pentaho.org/content/repositories/public-snapshot/</pentaho.public.snapshot.repo>
<pentaho.private.release.repo>http://nexus.pentaho.org/content/repositories/private-release/</pentaho.private.release.repo>
<pentaho.private.snapshot.repo>http://nexus.pentaho.org/content/repositories/private-snapshot/</pentaho.private.snapshot.repo>

<build-helper-maven-plugin.version>1.9.1</build-helper-maven-plugin.version>
<maven-assembly-plugin.version>3.0.0</maven-assembly-plugin.version>

<license.licenseName>mit</license.licenseName>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
<executions>
<!-- individual files for ease of use -->
<execution>
<id>attach-checkstyle</id>
<phase>prepare-package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>checkstyle/pentaho_checks.xml</file>
<type>xml</type>
<classifier>checkstyle</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
<execution>
<id>attach-checkstyle-suppressions</id>
<phase>prepare-package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>checkstyle/pentaho_suppressions.xml</file>
<type>xml</type>
<classifier>checkstyle-suppressions</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
<execution>
<id>attach-checkstyle-xsl</id>
<phase>prepare-package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>checkstyle/checkstyle-noframes-sorted.xsl</file>
<type>xsl</type>
<classifier>checkstyle-noframes-sorted</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit b724252

Please sign in to comment.