Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build automation using Gradle and Travis CI
- Loading branch information
1 parent
ff3150f
commit 6792b46
Showing
18 changed files
with
621 additions
and
245 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
Oops, something went wrong.