kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ewe...@apache.org
Subject [kafka] branch trunk updated: MINOR: Make kafka-streams-test-utils dependencies work with releases tarballs
Date Tue, 03 Apr 2018 15:38:01 GMT
This is an automated email from the ASF dual-hosted git repository.

ewencp pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 67077eb  MINOR: Make kafka-streams-test-utils dependencies work with releases tarballs
67077eb is described below

commit 67077ebbcf24448e48d6223dc7090d5d94ea7780
Author: Ewen Cheslack-Postava <me@ewencp.org>
AuthorDate: Tue Apr 3 08:36:57 2018 -0700

    MINOR: Make kafka-streams-test-utils dependencies work with releases tarballs
    
    https://github.com/apache/kafka/pull/4760 unintentionally included extra raw class files
in the release tarballs by making the .class file output (instead of the jar) for a streams
a dependency of the streams-test-utils. This fixes that issue by instead breaking the circular
dependency by using a `compileOnly`/`provided` dependency on those sources and also including
the dependency as a test dependency.
    
    I verified by using `gradlew clean installAll releaseTarGzAll`, then checking that the
release tarball doesn't have the extraneous files and the installed pom file has the expected
dependencies. The dependency on kafka-streams is now in the `test` scope, but that should
be fine since a streams application would only use this dependency if it already had a dependency
on streams in `compile` (or in weird edge cases the user could handle specifying the right
dependencies). This actually  [...]
    
    Author: Ewen Cheslack-Postava <me@ewencp.org>
    
    Reviewers: Matthias J. Sax <mjsax@apache.org>, Guozhang Wang <wangguoz@gmail.com>,
John Roesler <vvcephei@users.noreply.github.com>
    
    Closes #4816 from ewencp/fix-streams-dependencies
---
 build.gradle | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index e090f52..22c4c29 100644
--- a/build.gradle
+++ b/build.gradle
@@ -968,9 +968,18 @@ project(':streams:test-utils') {
   archivesBaseName = "kafka-streams-test-utils"
 
   dependencies {
-    compile project(':streams').sourceSets.main.output
+    // streams and streams-test-utils have a circular dependency that needs to be broken.
Making streams a regular
+    // compile dependency here is a circular dependency. Making the streams project's main
sourceSet output a dependency
+    // incorrectly includes raw class files as dependencies and ends up including them in
output like the release tgz.
+    // Making the main sourceSet's output a compileOnly (provided) dependency resolves the
circular dependency in gradle
+    // and also leaves the raw class files out of the output. This does require that users
of this jar specify the
+    // streams dependency separately, but they wouldn't be using this module in tests unless
they already had a
+    // compile dependency on streams. For this module, however, we need to also include streams
as a separate test
+    // dependency since it is compileOnly/provided for the compile phase.
+    compileOnly project(':streams').sourceSets.main.output
     compile project(':clients')
 
+    testCompile project(':streams')
     testCompile project(':clients').sourceSets.test.output
     testCompile libs.junit
     testCompile libs.rocksDBJni

-- 
To stop receiving notification emails like this one, please contact
ewencp@apache.org.

Mime
View raw message