Skip to content

Instantly share code, notes, and snippets.

@daschl
Created December 20, 2013 17:48
Show Gist options
  • Save daschl/8058605 to your computer and use it in GitHub Desktop.
Save daschl/8058605 to your computer and use it in GitHub Desktop.
/**
* Copyright (C) 2009-2013 Couchbase, Inc.
*
* 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 DEALING
* IN THE SOFTWARE.
*/
// todo: checkstyle html
// todo: deploy local maven
// todo: deploy remote maven
// todo: package zip + deps
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
/**
* General Settings and Dependency Versions
*/
group = "com.couchbase.client"
version = "git describe --abbrev=0".execute().text.trim()
description = "Couchbase Java Client"
ext {
spyVersion = '2.10.3'
nettyVersion = '3.5.5.Final'
jettisonVersion = '1.1'
commonsVersion = '1.5'
httpcoreVersion = '4.1.1'
junitVersion = '4.7'
junitAddonsVersion = '1.4'
easymockVersion = '2.4'
mockitoVersion = '1.9.5'
}
/**
* Dependency Management
*/
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile group: 'net.spy', name: 'spymemcached', version: spyVersion
compile group: 'io.netty', name: 'netty', version: nettyVersion
compile group: 'org.codehaus.jettison', name: 'jettison', version: jettisonVersion
compile group: 'commons-codec', name: 'commons-codec', version: commonsVersion
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: httpcoreVersion
compile group: 'org.apache.httpcomponents', name: 'httpcore-nio', version: httpcoreVersion
testCompile group: 'net.spy', name: 'spymemcached-test', version: spyVersion
testCompile group: 'junit', name: 'junit', version: junitVersion
testCompile group: 'junit-addons', name: 'junit-addons', version: junitAddonsVersion
testCompile group: 'org.easymock', name: 'easymock', version: easymockVersion
testCompile group: 'org.easymock', name: 'easymockclassextension', version: easymockVersion
testCompile group: 'org.mockito', name: 'mockito-all', version: mockitoVersion
}
/**
* Compiler Flags
*/
compileJava {
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
/**
* Javadoc
*/
javadoc {
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = rootProject.description
options.windowTitle = rootProject.description + " - " + rootProject.version
options.bottom = "Copyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc."
def sources = configurations.create 'depSources'
dependencies {
depSources group: 'net.spy', name: 'spymemcached', version: spyVersion, classifier: 'sources'
}
def jars = configurations.depSources.files
jars
.collect({ jar -> project.zipTree(jar).matching({ include '**/*.java'}) })
.each { files -> source += files }
}
/**
* Maven Integration
*/
/**
* Code Checking
*/
checkstyle {
configFile = new File("${project.projectDir}/etc/checkstyle.xml")
Map<String, Object> properties = new HashMap<String, Object>()
properties.put('etc.dir', "${project.projectDir}/etc")
configProperties = properties
}
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment