Skip to content

Commit

Permalink
Build automation using Gradle and Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-keller committed Jul 23, 2015
1 parent ff3150f commit 6792b46
Show file tree
Hide file tree
Showing 18 changed files with 621 additions and 245 deletions.
2 changes: 1 addition & 1 deletion .idea/libraries/jetty_runner_libs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions .idea/libraries/jetty_runner_test_libs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

318 changes: 150 additions & 168 deletions .idea/workspace.xml

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions .travis.yml
@@ -0,0 +1,22 @@
language: java

jdk:
- oraclejdk8

os:
- linux

branches:
only:
- master

cache:
directories:
- $HOME/.gradle

before_script:
- git fetch
- git rebase

script:
- gradle clean test check --info
23 changes: 23 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,23 @@
The MIT License (MIT)

Copyright (c) - 2014 - Gui Keller

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.

http://opensource.org/licenses/MIT
2 changes: 1 addition & 1 deletion META-INF/plugin.xml
@@ -1,7 +1,7 @@
<idea-plugin version="2">
<id>JettyRunner-GK</id>
<name>IDEA Jetty Runner</name>
<version>1.1.2</version>
<version>1.1.3</version>
<vendor email="guikeller@gmail.com" url="https://github.com/guikeller/jetty-runner">IntelliJ Jetty Runner</vendor>

<description><![CDATA[
Expand Down
68 changes: 1 addition & 67 deletions README.md
Expand Up @@ -20,73 +20,7 @@ tags: jetty, container, webapp, runner, tomcat, runner <br>
6) Uses jetty-runner-9.2.5</b> <br>
<br>
<br>
<b>1.1.2</b> Leaves Falling - Tidy Up! <br>
What's new: <br>
<b>1)</b> Internal code refactoring, updated tests, updated documentation, added a license (MIT). <br>
<b>2)</b> Removed donation links, if you're interested in making a donation contact me. <br>
<br>
<b>1.1.1</b> Leaves Falling <br>
What's new: <br>
<b>1)</b> Fixed bug around saving configurations - GitHub Issue #12 <br>
<b>2)</b> Added new feature, env vars - GitHub Issue #13 <br>
<br>
<b>1.0.0</b> The Big 1.0! <br>
What's new: <br>
<b>1)</b> Fixed a bug where changing the running port does not take effect - GitHub Issue #8 <br>
<b>2)</b> Bumped configuration to version v1.0.0 <br>
<br>
<b>0.0.9</b> Ninth release; <br>
What's new: <br>
<b>1)</b> Changed the colour of the donation link in the configuration window. <br>
<b>2)</b> Corrected some spelling mistakes / wording. <br>
<b>3)</b> Links now open in a new window or tab. <br>
The plugin seems pretty stable, I will wait a bit before bumping to v1.0.0<br>
Many thanks for all the contributions and bug reports on GitHub. Cheers!<br>
<br>
<b>0.0.8</b> Eighth release; <br>
What's new: <br>
<b>1)</b> New transparent icon. <br>
<b>2)</b> Refactoring to support IDEA 14. <br>
<b>3)</b> Corrected an error message - spelling mistake. <br>
<b>4)</b> Updated documentation and requirements for version 0.0.8 <br>
<br>
<b>0.0.7</b> Seventh release - dcritchl; <br>
What's new: <br>
<b>1)</b> Switched from jetty-runner-8.1.9 (servlet-api-2.5) to jetty-runner-9.2.5 (servlet-api-3.1). <br>
<b>2)</b> Fixed a bug where test classes and resources were being added to Jetty's classpath. <br>
<b>3)</b> Updated documentation and requirements for version 0.0.7 <br>
<br>
<b>0.0.6</b> - Sixth release; <br>
What's new: <br>
<b>1)</b> Added build before launch as requested. <br>
<b>2)</b> Added known limitations and more info around jetty. <br>
<br>
<b>0.0.5</b> - Fifth release - tchudyk; <br>
What's new: <br>
<b>1)</b> Added the VM Args field to the conf panel - optional. <br>
<b>2)</b> Bug fixing the jetty xml field/parameter, thanks to: tchudyk - github. <br>
<b>3)</b> Tidied up the code and docs a bit more. <br>
<br>
<b>0.0.4</b> - Fourth release; <br>
What's new: <br>
<b>1)</b> More unit tests - important bits tested (some felt in the too hard basket). <br>
<b>2)</b> Compiled to be compatible with JVM6. <br>
<b>3)</b> Tidied up the code and docs a bit more. <br>
<br>
<b>0.0.3</b> - Third release; <br>
What's new: <br>
<b>1)</b> Run and Debug Configurations now work! <br>
<b>2)</b> Internal code refactoring and documentation. <br>
<b>3)</b> UI Layout created using IntelliJ. <br>
<b>4)</b> Some Unit Tests - a starting point. <br>
<br>
<b>0.0.2</b> - Second release; <br>
What's new:<br>
<b>1)</b> Debugger port selector. <br>
<b>2)</b> Better UI Layout. <br>
<b>3)</b> Required values are automatically discovered and set!<br>
<br>
<b>0.0.1</b> - First release; Uses: <b>jetty-runner-8.1.9</b> (jetty-7.6.13)<br>
TODO - Insert links here to the generated reports
<br>
Pull requests are welcome.<br>
Thanks for dropping by.<br/>
134 changes: 134 additions & 0 deletions build.gradle
@@ -0,0 +1,134 @@
// Plugins repository
buildscript {
repositories {
mavenCentral()
}
dependencies {
// Cobertura code coverage with unit tests
classpath "net.saliman:gradle-cobertura-plugin:2.2.7"
}
}

// Plugins used
apply plugin: 'java'
apply plugin: 'idea'

apply plugin: 'pmd'
apply plugin: 'findbugs'
apply plugin: 'checkstyle'
apply plugin: 'cobertura'


// Source and Target are Java 7
sourceCompatibility = 1.7
targetCompatibility = 1.7

// Repositories for the project itself
// Files under lib and maven central
repositories {
flatDir {
dirs 'lib/compile', 'lib/test'
}

maven {
// My own m2 repo with the IntelliJ CE jars
url 'https://copy.com/3PHpwV7ZNMgo4YzU/public/repo'
}

mavenCentral();
}

// Project dependencies
dependencies {
// Third Party dependencies - Local lib folder
compile(name : 'eclipse-jetty-runner-9.2.5');
// IntelliJ CE Dependencies - Copy.com/Repo
compile('com.github.guikeller.jetty-runner:util:14.1.4');
compile('com.github.guikeller.jetty-runner:idea:14.1.4');
compile('com.github.guikeller.jetty-runner:idea_rt:14.1.4');
compile('com.github.guikeller.jetty-runner:openapi:14.1.4');
compile('com.github.guikeller.jetty-runner:annotations:14.1.4');
compile('com.github.guikeller.jetty-runner:jdom:14.1.4');
compile('com.github.guikeller.jetty-runner:extensions:14.1.4');
// IntelliJ CE Dependencies - Test - Copy.com/Repo
testCompile('com.github.guikeller.jetty-runner:trove4j:14.1.4');
testCompile('com.github.guikeller.jetty-runner:picocontainer:14.1.4');
testCompile('com.github.guikeller.jetty-runner:log4j:14.1.4');
testCompile('com.github.guikeller.jetty-runner:slf4j-api-1.7.10:14.1.4');
testCompile('com.github.guikeller.jetty-runner:slf4j-log4j12-1.7.10:14.1.4');
// Unit Test Dependencies - Local lib folder
testCompile(name : 'cglib-nodep-2.2.2');
testCompile(name : 'javassist-3.18.2-GA');
testCompile(name : 'objenesis-2.1');
testCompile(name : 'junit-4.11');
testCompile(name : 'mockito-all-1.9.5');
testCompile(name : 'powermock-mockito-1.5.5-full');
}


// Configuring plugins - Code Analysis

// JUnit
test {
reports {
junitXml.enabled = false
html.enabled = true
}
}

// FindBugs
tasks.withType(FindBugs) {
ignoreFailures = true
reports {
xml.enabled = false
html.enabled = true
}
}

// Checkstyle
tasks.withType(Checkstyle) {
ignoreFailures = true
configFile = new File('src/test/resources/checkstyle.xml')
}

// checkstyle to generate html
task checkstyleHtml << {
ant.xslt(in: checkstyleMain.reports.xml.destination,
style: 'src/test/resources/checkstyle.xslt',
out: new File(checkstyleMain.reports.xml.destination.parent, 'main.html'))
}
checkstyleMain.finalizedBy checkstyleHtml

// PMD
tasks.withType(Pmd) {
ignoreFailures = true
reports {
xml.enabled = false
html.enabled = true
}
}

// add CPD to check (Copy Paste Detector)
check << {
// Create dir
File outDir = new File('build/reports/cpd/')
outDir.mkdirs()
// Runs defines and runs the task
ant.taskdef(name: 'cpd', classname: 'net.sourceforge.pmd.cpd.CPDTask', classpath: configurations.pmd.asPath)
ant.cpd(minimumTokenCount: '100', format: 'xml', outputFile: new File(outDir , 'cpd.xml')) {
fileset(dir: "src/main/java") {
include(name: '**/*.java')
}
}
// Transform the cpd xml into html
ant.xslt( in : 'build/reports/cpd/cpd.xml',
style : 'src/test/resources/cpd.xslt',
out : 'build/reports/cpd/cpd.html')
}

// Adding Cobertura to the test goal/target - instrumentation
test.dependsOn coberturaCheck

// To run all tests and generate all reports:
// $gradle clean test check --info
// Thanks for using IDEA Jetty Runner
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions src/test/resources/checkstyle.xml
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="TodoComment">
<property name="format" value="(TODO)|(FIXME)"/>
</module>
</module>
</module>

0 comments on commit 6792b46

Please sign in to comment.