Skip to content

Commit

Permalink
Move integration testing to own project
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxroot committed Dec 19, 2013
1 parent c1b5d41 commit c8a555c
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 83 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Expand Up @@ -4,15 +4,15 @@ jdk:
- openjdk6

env:
- TERM=dumb
- TERM=dumb ORG_GRADLE_PROJECT_buildNumber="${TRAVIS_BUILD_NUMBER}" ORG_GRADLE_PROJECT_revisionNumber="${TRAVIS_COMMIT}" ORG_GRADLE_PROJECT_branchName="${TRAVIS_BRANCH}"

before_install:
- chmod +x gradlew

install: ./gradlew -PbuildNumber=${TRAVIS_BUILD_NUMBER} -PrevisionNumber=${TRAVIS_COMMIT} -PbranchName=${TRAVIS_BRANCH} assemble
install: ./gradlew assemble

script: ./gradlew -PbuildNumber=${TRAVIS_BUILD_NUMBER} -PrevisionNumber=${TRAVIS_COMMIT} -PbranchName=${TRAVIS_BRANCH} clean test check dist integration
script: ./gradlew test check dist integration

after_success:
- ./gradlew -PbuildNumber=${TRAVIS_BUILD_NUMBER} -PrevisionNumber=${TRAVIS_COMMIT} -PbranchName=${TRAVIS_BRANCH} cobertura
- ./gradlew -PbuildNumber=${TRAVIS_BUILD_NUMBER} -PrevisionNumber=${TRAVIS_COMMIT} -PbranchName=${TRAVIS_BRANCH} coveralls
- ./gradlew cobertura
- ./gradlew coveralls
171 changes: 93 additions & 78 deletions build.gradle
@@ -1,107 +1,127 @@
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'pmd'
apply plugin: 'findbugs'
apply plugin: 'checkstyle'
apply plugin: 'cobertura'
apply plugin: 'coveralls'

description = 'Java Chess Protocol Interface'

group = 'com.fluxchess'
version = '1.1.5'
ext.releaseBranch = '1.1.x'
buildscript {
repositories {
mavenCentral()
}

if (!hasProperty('buildNumber') || !(hasProperty('branchName') && branchName == releaseBranch)) {
// We're probably building on a dev machine or we're building a branch
ext.buildNumber = 'dev'
}
if (!hasProperty('revisionNumber')) {
// We're probably building on a dev machine
ext.revisionNumber = 'dev'
dependencies {
classpath 'net.saliman:gradle-cobertura-plugin:2.0.0'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:0.1.6'
}
}

if (!version.contains('-') && !(hasProperty('releaseVersion') && releaseVersion == version)) {
// Append '-rc' if we're not releasing yet
version += '-rc'
}
allprojects {
apply plugin: 'java'
apply plugin: 'pmd'
apply plugin: 'findbugs'
apply plugin: 'checkstyle'
apply plugin: 'cobertura'

if (version.contains('-')) {
// Append the buildNumber if we're not releasing
version += '.' + buildNumber
}
group = 'com.fluxchess'
version = '1.1.5'
ext.releaseBranch = '1.1.x'

if (version.contains('-') && !(hasProperty('branchName') && branchName == releaseBranch)) {
// Append the revisionNumber if we're not releasing and not on a release branch
version += '+' + revisionNumber
}
if (!project.hasProperty('buildNumber') || !(project.hasProperty('branchName') && branchName == releaseBranch)) {
// We're probably building on a dev machine or we're building a branch
ext.buildNumber = 'dev'
}
if (!project.hasProperty('revisionNumber')) {
// We're probably building on a dev machine
ext.revisionNumber = 'dev'
}

println "Building version ${version}"
if (!version.contains('-') && !(project.hasProperty('releaseVersion') && releaseVersion == version)) {
// Append '-rc' if we're not releasing yet
version += '-rc'
}

if (!hasProperty('s3AccessKeyId')) {
ext.s3AccessKeyId = 'n/a'
}
if (version.contains('-')) {
// Append the buildNumber if we're not releasing
version += '.' + buildNumber
}

if (!hasProperty('s3SecretAccessKey')) {
ext.s3SecretAccessKey = 'n/a'
}
if (version.contains('-') && !(project.hasProperty('branchName') && branchName == releaseBranch)) {
// Append the revisionNumber if we're not releasing and not on a release branch
version += '+' + revisionNumber
}

afterEvaluate { println "Building ${name} version ${version}" }

if (!project.hasProperty('s3AccessKeyId_password')) {
ext.s3AccessKeyId_password = 'n/a'
}

if (!project.hasProperty('s3SecretAccessKey_password')) {
ext.s3SecretAccessKey_password = 'n/a'
}

buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'net.saliman:gradle-cobertura-plugin:2.0.0'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:0.1.6'
tasks.withType(Pmd) {
pmd {
ignoreFailures = true
}
}
}

repositories {
mavenCentral()
}

tasks.withType(Pmd) {
pmd {
ignoreFailures = true
tasks.withType(FindBugs) {
findbugs {
ignoreFailures = true
}
}
}

tasks.withType(FindBugs) {
findbugs {
ignoreFailures = true
tasks.withType(Checkstyle) {
checkstyle {
configFile = new File("${rootDir}/config/checkstyle/checkstyle.xml")
ignoreFailures = true
showViolations = false
}
}
}

tasks.withType(Checkstyle) {
checkstyle {
ignoreFailures = true
showViolations = false
cobertura.coverageFormats = ['html', 'xml']

dependencies {
testCompile 'junit:junit:4.+'
}
}

cobertura.coverageFormats = ['html', 'xml']
sourceCompatibility = 1.6
targetCompatibility = 1.6

sourceSets {
integration
processResources {
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [
version: project.version,
buildNumber: project.buildNumber,
revisionNumber: project.revisionNumber
])
}
}

dependencies {
testCompile 'junit:junit:4.+'
project(':jcpi-integration') {
description = 'Integration Testing'

integrationCompile project(':')
integrationCompile 'junit:junit:4.+'
}
sourceSets {
integration
}

configurations {
integrationCompile.extendsFrom compile
integrationRuntime.extendsFrom runtime
}

sourceCompatibility = 1.6
targetCompatibility = 1.6
dependencies {
compile project(':')
compile 'junit:junit:4.+'
}

processResources {
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [
version: project.version,
buildNumber: project.buildNumber,
revisionNumber: project.revisionNumber
])
task integration(type: Test) {
testClassesDir = sourceSets.integration.output.classesDir
classpath = sourceSets.integration.runtimeClasspath
}
}

jar {
Expand All @@ -120,11 +140,6 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}

task integration(type: Test) {
testClassesDir = sourceSets.integration.output.classesDir
classpath = sourceSets.integration.runtimeClasspath
}

task dist(type: Zip) {
def baseDir = "${project.name}-${project.version}"

Expand Down Expand Up @@ -165,7 +180,7 @@ uploadArchives {
mavenDeployer {
configuration = configurations.deployerJars
repository(url: "s3://maven.fluxchess.com/${repositoryName}") {
authentication(userName: s3AccessKeyId, passphrase: s3SecretAccessKey)
authentication(userName: s3AccessKeyId_password, passphrase: s3SecretAccessKey_password)
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions settings.gradle
@@ -1 +1,3 @@
rootProject.name = 'jcpi'

include 'jcpi-integration'

0 comments on commit c8a555c

Please sign in to comment.