From ee2a09acf27512a7c8f6d46eaca5c6f1154d0ca9 Mon Sep 17 00:00:00 2001 From: paulodamaso Date: Thu, 7 May 2020 18:38:49 -0300 Subject: [PATCH] For #1: initial repo configuration --- .0pdd.yml | 7 ++ .appveyor.yml | 28 +++++ .github/ISSUE_TEMPLATE.md | 12 ++ .github/PULL_REQUEST_TEMPLATE.md | 14 +++ .gitignore | 2 + .pdd | 5 + .rultor.yml | 29 +++++ .travis.yml | 22 ++++ LICENSE.txt | 21 ++++ README.md | 18 +++ pom.xml | 105 ++++++++++++++++++ src/main/java/org/jpeek/plugin/JpeekMojo.java | 47 ++++++++ .../java/org/jpeek/plugin/package-info.java | 30 +++++ 13 files changed, 340 insertions(+) create mode 100644 .0pdd.yml create mode 100644 .appveyor.yml create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .gitignore create mode 100644 .pdd create mode 100644 .rultor.yml create mode 100644 .travis.yml create mode 100644 LICENSE.txt create mode 100644 pom.xml create mode 100644 src/main/java/org/jpeek/plugin/JpeekMojo.java create mode 100644 src/main/java/org/jpeek/plugin/package-info.java diff --git a/.0pdd.yml b/.0pdd.yml new file mode 100644 index 0000000..6a47354 --- /dev/null +++ b/.0pdd.yml @@ -0,0 +1,7 @@ +errors: + - pauloeduardolobo@gmail.com +format: + - short-title + - title-length=100 +tags: + - pdd diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..c2e0266 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,28 @@ +version: '{build}' +skip_tags: true +clone_depth: 10 +environment: + MAVEN_VERSION: 3.6.2 + matrix: + - JAVA_HOME: C:\Program Files\Java\jdk1.8.0 +install: + - ps: | + Add-Type -AssemblyName System.IO.Compression.FileSystem + if (!(Test-Path -Path "C:\maven" )) { + Write-Host "Downloading Maven $env:MAVEN_VERSION" + (new-object System.Net.WebClient).DownloadFile("https://repo1.maven.org/maven2/org/apache/maven/apache-maven/$env:MAVEN_VERSION/apache-maven-$env:MAVEN_VERSION-bin.zip", 'C:\maven-bin.zip') + [System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven") + } + - cmd: SET M2_HOME=C:\maven\apache-maven-%MAVEN_VERSION% + # Prepend Java entry, remove Ruby entry (C:\Ruby193\bin;) from PATH + - cmd: SET PATH=%M2_HOME%\bin;%JAVA_HOME%\bin;%PATH:C:\Ruby193\bin;=%; + - cmd: SET MAVEN_OPTS=-XX:MaxPermSize=1g -Xmx2g + - cmd: SET JAVA_OPTS=-XX:MaxPermSize=1g -Xmx2g + - cmd: mvn --version + - cmd: java -version +build_script: + - mvn clean install -Pqulice --errors --batch-mode + +cache: + - C:\maven\ -> appveyor.yml + - C:\Users\appveyor\.m2\ -> pom.xml diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..eb72eba --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,12 @@ +Make sure the title of the issue explains the problem you are having. Also, the description of the issue must clearly explain what is broken, not what you want us to implement. Go through this checklist and make sure you answer "YES" to all points: + + - You have all pre-requisites listed in README.md installed + - You are sure that you are not reporting a duplicate (search all issues) + - You say "is broken" or "doesn't work" in the title + - You tell us what you are trying to do + - You explain the results you are getting + - You suggest an alternative result you would like to see + +This article will help you understand what we are looking for: https://www.yegor256.com/2014/11/24/principles-of-bug-tracking.html + +Thank you for your contribution! diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..2f4295e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,14 @@ +Many thanks for your contribution, we truly appreciate it. We will appreciate it even more, if you make sure that you can say "YES" to each point in this short checklist: + + - You made a small amount of changes (less than 100 lines, less than 10 files) + - You made changes related to only one bug (create separate PRs for separate problems, or leave puzzles) + - You are ready to defend your changes (there will be a code review) + - You don't touch what you don't understand + - You ran the build locally and it passed + - Title begins with the issue's number, then a short title + - Description begins with the issue's number, then enumerates the changes - summarized - in bulletpoints + - Description does not contain GitHub keywords (https://help.github.com/articles/closing-issues-using-keywords/). + +This article will help you understand what we are looking for: https://www.yegor256.com/2015/02/09/serious-code-reviewer.html + +Thank you for your contribution! diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d513a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/.idea/ +/target/ diff --git a/.pdd b/.pdd new file mode 100644 index 0000000..0e362eb --- /dev/null +++ b/.pdd @@ -0,0 +1,5 @@ +--source=. +--verbose +--rule min-words:20 +--rule min-estimate:15 +--rule max-estimate:120 diff --git a/.rultor.yml b/.rultor.yml new file mode 100644 index 0000000..0cacdb6 --- /dev/null +++ b/.rultor.yml @@ -0,0 +1,29 @@ +docker: + image: yegor256/rultor-image:1.3 +assets: + settings.xml: yegor256/home#assets/jpeek/settings.xml + pubring.gpg: yegor256/home#assets/pubring.gpg + secring.gpg: yegor256/home#assets/secring.gpg +install: | + sudo update-java-alternatives -s java-1.8.0-openjdk-amd64 + pdd -f /dev/null +architect: +- paulodamaso +merge: + script: | + mvn clean install -Pqulice --errors --settings ../settings.xml + mvn clean site -Psite --errors --settings ../settings.xml +deploy: + script: | + mvn clean deploy -Pqulice --errors --settings ../settings.xml +release: + sensitive: + - settings.xml + script: |- + export GPG_TTY=$(tty) + gpg --import /home/r/pubring.gpg + gpg --allow-secret-key-import --no-tty --batch --import /home/r/secring.gpg + [[ "${tag}" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1 + mvn versions:set "-DnewVersion=${tag}" + git commit -am "${tag}" + mvn clean deploy -Pjpeek -Psonar -Pqulice -Psonatype --errors --settings ../settings.xml \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..a505559 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +dist: trusty +language: java +sudo: false +cache: + directories: + - $HOME/.m2 +script: + - set -e + - pdd -f /dev/null + - mvn clean install -Pqulice --errors --batch-mode +install: + - gem install pdd -v 0.20.5 + - gem install est -v 0.3.4 + - gem install xcop -v 0.6 +env: + global: + - MAVEN_OPTS="-Xmx256m" + - JAVA_OPTS="-Xmx256m" +jdk: + - openjdk8 +after_success: + - "bash <(curl -s https://codecov.io/bash)" diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..3ff01fc --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Yegor Bugayenko + +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 NON-INFRINGEMENT. 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. diff --git a/README.md b/README.md index e69de29..3691d9b 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,18 @@ +## How to use? + +Add the plugin execution to your `pom.xml`: + +``` + + org.jpeek + jpeek-maven-plugin + 0.0.1-SNAPSHOT + + + + jpeek-analysis + + + + +``` \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..2cf3d1d --- /dev/null +++ b/pom.xml @@ -0,0 +1,105 @@ + + + + 4.0.0 + org.jpeek + jpeek-maven-plugin + 1.0-SNAPSHOT + maven-plugin + jpeek-maven-plugin + Maven plugin for jpeek - Static collector of Java code metrics + https://github.com/yegor256/jpeek-maven-plugin + 2020 + + 1.8 + 1.8 + + + jPeek + https://github.com/yegor256/jpeek + + + + MIT + https://www.jpeek.org/LICENSE.txt + site + + + + GitHub + https://github.com/yegor256/jpeek-maven-plugin/issues + + + scm:git:git@github.com:yegor256/jpeek-maven-plugin.git + scm:git:git@github.com:yegor256/jpeek-maven-plugin.git + https://github.com/yegor256/jpeek-maven-plugin + + + rultor + https://www.rultor.com/s/jpeek-maven-plugin + + + + org.apache.maven + maven-plugin-api + 3.6.3 + + + org.apache.maven.plugin-tools + maven-plugin-annotations + 3.6.0 + provided + + + + + qulice + + + + com.qulice + qulice-maven-plugin + 0.18.17 + + + jcabi-qulice-check + verify + + check + + + file:${basedir}/LICENSE.txt + + duplicatefinder:.* + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/org/jpeek/plugin/JpeekMojo.java b/src/main/java/org/jpeek/plugin/JpeekMojo.java new file mode 100644 index 0000000..87e7a4b --- /dev/null +++ b/src/main/java/org/jpeek/plugin/JpeekMojo.java @@ -0,0 +1,47 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2020 Yegor Bugayenko + * + * 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 NON-INFRINGEMENT. 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. + */ +package org.jpeek.plugin; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; + +/** + * {@link org.apache.maven.plugin.AbstractMojo} implementation for jPeek. + * + * @since 0.1 + * @todo #1:30min Implement jpeek plugin execution + * JpeekMojo must execute jpeek and analyze project files upon build. + * Use the jpeek jar from manve repository to execute it with in the + * project. + */ +@Mojo(name = "jpeek-analysis", defaultPhase = LifecyclePhase.TEST) +public class JpeekMojo extends AbstractMojo { + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + //method body + } +} diff --git a/src/main/java/org/jpeek/plugin/package-info.java b/src/main/java/org/jpeek/plugin/package-info.java new file mode 100644 index 0000000..75a524d --- /dev/null +++ b/src/main/java/org/jpeek/plugin/package-info.java @@ -0,0 +1,30 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2020 Yegor Bugayenko + * + * 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 NON-INFRINGEMENT. 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. + */ + +/** + * JPeek web. + * + * @since 0.7 + */ +package org.jpeek.plugin;