Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

290 lines (224 sloc) 7.532 kB
/*
* Copyright (c) 2007-2013 Concurrent, Inc. All Rights Reserved.
*
* Project and contact information: http://www.cascading.org/
*
* This file is part of the Cascading project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
Using:
To run a single test:
> gradle -Dest.single=LocalTapPlatformTest :cascading-local:test -i
To run a single platform test:
> gradle -DplatformTest.single=CoGroupFieldedPipesPlatformTest :cascading-local:platformTest -i
To remotely debug use
-Dtest.debug
*/
apply from: 'etc/version.gradle'
configurations {
s3AntTask
}
dependencies {
s3AntTask 'thirdparty:awstasks:0.3'
}
allprojects {
apply plugin: 'java'
repositories {
mavenLocal()
mavenCentral()
mavenRepo name: 'conjars', url: 'http://conjars.org/repo/'
mavenRepo name: 'apache', url: 'https://repository.apache.org/content/repositories/releases/'
}
}
subprojects {
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply from: '../etc/testing.gradle'
group = 'cascading'
version = releaseVersion
configurations {
providedCompile
testArtifacts {
extendsFrom testRuntime
}
}
sourceSets {
main.compileClasspath += configurations.providedCompile
}
task mappings {
conf2ScopeMappings.addMapping( 0, configurations.providedCompile, Conf2ScopeMappingContainer.PROVIDED )
}
idea {
module {
scopes.PROVIDED.plus += configurations.providedCompile
}
}
javadoc {
classpath += configurations.providedCompile
}
task sourcesJar( type: Jar, dependsOn: classes ) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar( type: Jar, dependsOn: javadoc ) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task testsJar( type: Jar, dependsOn: testClasses ) {
from sourceSets.test.output
classifier = 'tests'
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
archives testsJar
testArtifacts testsJar
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.8.2'
}
test {
include '**/*Test.class'
}
assemble << {
if( project.name.equals( 'cascading-platform' ) )
return
copy {
into "${distDir}/lib/${archivesBaseName}"
from( configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.findAll { dep ->
!dep.name.contains( 'cascading' )
}.collect { dep ->
dep.moduleArtifacts.collect { it.file }
} )
}
copy {
into distDir
from configurations.default.allArtifacts.files
}
}
uploadArchives {
repositories.mavenDeployer {
configuration = configurations.archives
repository( url: repoUrl ) {
authentication( userName: repoUserName, password: repoPassword )
}
pom.project {
description 'An API for data management, analytics, and machine learning on parallel computing clusters.'
inceptionYear '2007'
url 'http://cascading.org/'
scm {
url 'https://github.com/Cascading/cascading.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
}
}
}
task javadocAll( type: Javadoc ) {
ext.copyright = '<i>Copyright &#169; 2007-2012 Concurrent, Inc. All Rights Reserved.</i>'
title = "Cascading ${releaseVersion}"
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
source 'cascading-core/src/test/java/cascading/CascadingTestCase.java'
source 'cascading-core/src/test/java/cascading/tuple/TupleListCollector.java'
source 'cascading-local/src/test/java/cascading/test/LocalPlatform.java'
source 'cascading-hadoop/src/test/java/cascading/test/HadoopPlatform.java'
source 'cascading-platform/src/test/java/cascading/PlatformTestCase.java'
source 'cascading-platform/src/test/java/cascading/platform/TestPlatform.java'
source 'cascading-platform/src/test/java/cascading/platform/PlatformRunner.java'
destinationDir = new File( buildDir, 'javadoc' )
classpath = files( subprojects.collect { project ->
project.sourceSets.test.compileClasspath
} )
configure( options ) {
encoding = "UTF8"
bottom = copyright
links = [
'http://docs.oracle.com/javase/6/docs/api/',
'http://dist.codehaus.org/janino/javadoc/',
'http://hadoop.apache.org/common/docs/r1.0.3/api/',
'http://junit.sourceforge.net/javadoc/'
]
}
}
task prepareRelease( dependsOn: [ 'cascading-core:build', 'cascading-local:build', 'cascading-hadoop:build', 'cascading-xml:build', 'cascading-platform:build' ] )
prepareRelease << {
logger.info( 'built all artifacts' )
}
task buildDist( dependsOn: [ prepareRelease, javadocAll ] ) << {
def distDir = mkdir( "${rootDir}/build/dist" )
copy {
from 'CHANGES.txt'
from 'README.txt'
from 'apl.txt'
from 'LICENSE.txt'
into distDir
}
copy {
from javadocAll.destinationDir
into "${distDir}/javadoc"
}
}
ext.distDir = mkdir( "${rootDir}/build/dist" )
task buildPackage( type: Tar, dependsOn: buildDist ) {
description = "package current build, does not run tests"
destinationDir = buildDir
baseName = "cascading-${releaseVersion}"
compression = "GZIP"
into( baseName ) {
from distDir
}
}
task buildLatestMeta( dependsOn: buildPackage ) {
ext.latestArchivePath = null
ext.latestReleaseTagPath = null
ext.latestPropertiesPath = null
}
buildLatestMeta << {
def releaseTar = buildPackage.archivePath.name
latestArchivePath = new File( buildDir, 'latest.txt' )
latestArchivePath.write( "http://${s3Bucket}/cascading/${majorVersion}/${releaseTar}" )
latestReleaseTagPath = new File( buildDir, 'latest-tag.txt' )
latestReleaseTagPath.write( "${releaseTag}" )
latestPropertiesPath = new File( buildDir, 'latest.properties' )
latestPropertiesPath.write( "cascading.release.version=${releaseVersion}\n" +
"cascading.release.major=${majorVersion}\n" +
"cascading.release.minor=${minorVersion}\n" +
"cascading.release.build=${buildNumber}\n" +
"cascading.release.commit=${currentCommit}\n" +
"cascading.release.tag=${releaseTag}"
)
}
task s3Upload( dependsOn: buildLatestMeta ) << {
def remotePath = "cascading/${majorVersion}/"
ant.taskdef( name: 's3Upload', classname: 'dak.ant.taskdefs.S3Upload',
classpath: configurations.s3AntTask.asPath )
ant.s3Upload( verbose: 'true', accessId: awsAccessId, secretKey: awsSecretKey,
bucket: s3Bucket, prefix: remotePath, publicRead: 'true' ) {
fileset( file: buildPackage.archivePath )
fileset( file: buildLatestMeta.latestArchivePath )
fileset( file: buildLatestMeta.latestReleaseTagPath )
fileset( file: buildLatestMeta.latestPropertiesPath )
}
}
Jump to Line
Something went wrong with that request. Please try again.