kafka-1244,kafka-1246,kafka-1249; various gradle issues for release; patched by Jun Rao; reviewed by Neha Narkhede

This commit is contained in:
Jun Rao 2014-02-12 08:28:57 -08:00
parent 8d623e157d
commit 5023c2ff2e
4 changed files with 42 additions and 6 deletions

View File

@ -17,9 +17,8 @@
See our [web site](http://kafka.apache.org) for details on the project. See our [web site](http://kafka.apache.org) for details on the project.
## Building a jar and running it ## ## Building a jar and running it ##
1. ./gradlew copyDependantLibs 1. ./gradlew jar
2. ./gradlew jar 2. Follow instuctions in http://kafka.apache.org/documentation.html#quickstart
3. Follow instuctions in http://kafka.apache.org/documentation.html#quickstart
## Running unit tests ## ## Running unit tests ##
./gradlew test ./gradlew test

View File

@ -28,6 +28,7 @@ allprojects {
} }
apply from: file('gradle/license.gradle') apply from: file('gradle/license.gradle')
apply from: file('scala.gradle')
subprojects { subprojects {
apply plugin: 'java' apply plugin: 'java'
@ -113,7 +114,7 @@ project(':core') {
println "Building project 'core' with Scala version $scalaVersion" println "Building project 'core' with Scala version $scalaVersion"
apply plugin: 'scala' apply plugin: 'scala'
archivesBaseName = "kafka_${scalaVersion}" archivesBaseName = "kafka_${baseScalaVersion}"
def (major, minor, trivial) = scalaVersion.tokenize('.') def (major, minor, trivial) = scalaVersion.tokenize('.')
@ -176,7 +177,6 @@ project(':core') {
tasks.create(name: "releaseTarGz", dependsOn: configurations.archives.artifacts, type: Tar) { tasks.create(name: "releaseTarGz", dependsOn: configurations.archives.artifacts, type: Tar) {
into "." into "."
compression = Compression.GZIP compression = Compression.GZIP
classifier = 'dist'
from(project.file("../bin")) { into "bin/" } from(project.file("../bin")) { into "bin/" }
from(project.file("../config")) { into "config/" } from(project.file("../config")) { into "config/" }
from '../LICENSE' from '../LICENSE'
@ -184,6 +184,12 @@ project(':core') {
from(configurations.runtime) { into("libs/") } from(configurations.runtime) { into("libs/") }
from(configurations.archives.artifacts.files) { into("libs/") } from(configurations.archives.artifacts.files) { into("libs/") }
} }
jar {
dependsOn 'copyDependantLibs'
from '../LICENSE'
from '../NOTICE'
}
task testJar(type: Jar) { task testJar(type: Jar) {
appendix = 'test' appendix = 'test'
@ -202,7 +208,7 @@ project(':perf') {
println "Building project 'perf' with Scala version $scalaVersion" println "Building project 'perf' with Scala version $scalaVersion"
apply plugin: 'scala' apply plugin: 'scala'
archivesBaseName = "kafka-perf_${scalaVersion}" archivesBaseName = "kafka-perf_${baseScalaVersion}"
dependencies { dependencies {
compile project(':core') compile project(':core')
@ -211,6 +217,11 @@ project(':perf') {
zinc 'com.typesafe.zinc:zinc:0.2.5' zinc 'com.typesafe.zinc:zinc:0.2.5'
} }
jar {
from '../LICENSE'
from '../NOTICE'
}
} }
project(':contrib:hadoop-consumer') { project(':contrib:hadoop-consumer') {
@ -236,6 +247,11 @@ project(':contrib:hadoop-consumer') {
compile.exclude module: 'mail' compile.exclude module: 'mail'
compile.exclude module: 'netty' compile.exclude module: 'netty'
} }
jar {
from '../LICENSE'
from '../NOTICE'
}
} }
project(':contrib:hadoop-producer') { project(':contrib:hadoop-producer') {
@ -261,6 +277,11 @@ project(':contrib:hadoop-producer') {
compile.exclude module: 'mail' compile.exclude module: 'mail'
compile.exclude module: 'netty' compile.exclude module: 'netty'
} }
jar {
from '../LICENSE'
from '../NOTICE'
}
} }
project(':examples') { project(':examples') {
@ -269,6 +290,11 @@ project(':examples') {
dependencies { dependencies {
compile project(':core') compile project(':core')
} }
jar {
from '../LICENSE'
from '../NOTICE'
}
} }
project(':clients') { project(':clients') {
@ -278,6 +304,11 @@ project(':clients') {
testCompile 'com.novocode:junit-interface:0.9' testCompile 'com.novocode:junit-interface:0.9'
} }
jar {
from '../LICENSE'
from '../NOTICE'
}
task testJar(type: Jar) { task testJar(type: Jar) {
appendix = 'test' appendix = 'test'
from sourceSets.test.output from sourceSets.test.output

5
scala.gradle Normal file
View File

@ -0,0 +1,5 @@
if (!hasProperty('scalaVersion')) {
ext.scalaVersion = '2.8.0'
}
ext.defaultScalaVersion = '2.8.0'
ext.baseScalaVersion = (scalaVersion.startsWith('2.10')) ? '2.10' : scalaVersion

View File

@ -13,4 +13,5 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
apply from: file('scala.gradle')
include 'core', 'perf', 'contrib:hadoop-consumer', 'contrib:hadoop-producer', 'examples', 'clients' include 'core', 'perf', 'contrib:hadoop-consumer', 'contrib:hadoop-producer', 'examples', 'clients'