[
https://issues.apache.org/jira/browse/BEAM-3249?focusedWorklogId=90152&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-90152
]
ASF GitHub Bot logged work on BEAM-3249:
----------------------------------------
Author: ASF GitHub Bot
Created on: 11/Apr/18 20:03
Start Date: 11/Apr/18 20:03
Worklog Time Spent: 10m
Work Description: lukecwik closed pull request #5103: [BEAM-3249] Only
generate all artifacts when publishing.
URL: https://github.com/apache/beam/pull/5103
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/build_rules.gradle b/build_rules.gradle
index fba441e2677..8f54fe0f478 100644
--- a/build_rules.gradle
+++ b/build_rules.gradle
@@ -325,7 +325,6 @@ ext.DEFAULT_SHADOW_CLOSURE = {
class JavaNatureConfiguration {
double javaVersion = 1.8 // Controls the JDK source language and
target compatibility
boolean enableFindbugs = true // Controls whether the findbugs plugin is
enabled and configured
- boolean enableShadow = true // Controls whether the shadow plugin is
enabled and configured
// The shadowJar / shadowTestJar tasks execute the following closure to
configure themselves.
// Users can compose their closure with the default closure via:
// DEFAULT_SHADOW_CLOSURE << {
@@ -349,6 +348,7 @@ class JavaNatureConfiguration {
// * maven
// * net.ltgt.apt (plugin to configure annotation processing tool)
// * propdeps (provide optional and provided dependency configurations)
+// * propdeps-maven
// * checkstyle
// * findbugs
// * shadow
@@ -447,6 +447,7 @@ ext.applyJavaNature = {
// TODO: Either remove these plugins and find another way to generate the
Maven poms
// with the correct dependency scopes configured.
apply plugin: 'propdeps'
+ apply plugin: 'propdeps-maven'
// Configures a checkstyle plugin enforcing a set of rules and also allows
for a set of
// suppressions.
@@ -494,64 +495,62 @@ ext.applyJavaNature = {
//
// TODO: Enforce all relocations are always performed to:
// getJavaRelocatedPath(package_suffix) where package_suffix is something
like "com.google.commmon"
- if (configuration.enableShadow) {
- apply plugin: 'com.github.johnrengelman.shadow'
+ apply plugin: 'com.github.johnrengelman.shadow'
- // Create a new configuration 'shadowTest' like 'shadow' for the test scope
- configurations {
- shadow {
- description = "Dependencies for shaded source set 'main'"
- }
- compile.extendsFrom shadow
- shadowTest {
- description = "Dependencies for shaded source set 'test'"
- extendsFrom shadow
- }
- testCompile.extendsFrom shadowTest
+ // Create a new configuration 'shadowTest' like 'shadow' for the test scope
+ configurations {
+ shadow {
+ description = "Dependencies for shaded source set 'main'"
+ }
+ compile.extendsFrom shadow
+ shadowTest {
+ description = "Dependencies for shaded source set 'test'"
+ extendsFrom shadow
}
+ testCompile.extendsFrom shadowTest
+ }
- // Always configure the shadowJar classifier and merge service files.
- shadowJar ({
- classifier = "shaded"
- mergeServiceFiles()
+ // Always configure the shadowJar classifier and merge service files.
+ shadowJar ({
+ classifier = "shaded"
+ mergeServiceFiles()
+ } << configuration.shadowClosure)
- } << configuration.shadowClosure)
+ // Always configure the shadowTestJar classifier and merge service files.
+ tasks.create(name: 'shadowTestJar', type:
com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar, {
+ classifier = "shaded-tests"
+ from sourceSets.test.output
+ configurations = [project.configurations.testRuntime]
+ } << configuration.shadowClosure)
- // Always configure the shadowTestJar classifier and merge service files.
- tasks.create(name: 'shadowTestJar', type:
com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar, {
- classifier = "shaded-tests"
- from sourceSets.test.output
- configurations = [project.configurations.testRuntime]
- } << configuration.shadowClosure)
+ // Ensure that shaded jar and test-jar are part of the their own
configuration artifact sets
+ artifacts.shadow shadowJar
+ artifacts.shadowTest shadowTestJar
- // Ensure that shaded jar and test-jar are part of the their own
cconfiguration artifact sets
- // and the archives configuration set.
- artifacts.shadow shadowJar
- artifacts.shadowTest shadowTestJar
+ if (isRelease() || project.hasProperty('publishing')) {
+ apply plugin: "maven-publish"
+
+ // Only build artifacts for archives if we are publishing
artifacts.archives shadowJar
artifacts.archives shadowTestJar
- }
- task sourcesJar(type: Jar) {
- from sourceSets.main.allSource
- classifier = 'sources'
- }
- artifacts.archives sourcesJar
-
- task testSourcesJar(type: Jar) {
- from sourceSets.test.allSource
- classifier = 'test-sources'
- }
- artifacts.archives testSourcesJar
+ task sourcesJar(type: Jar) {
+ from sourceSets.main.allSource
+ classifier = 'sources'
+ }
+ artifacts.archives sourcesJar
- task javadocJar(type: Jar, dependsOn: javadoc) {
- classifier = 'javadoc'
- from javadoc.destinationDir
- }
- artifacts.archives javadocJar
+ task testSourcesJar(type: Jar) {
+ from sourceSets.test.allSource
+ classifier = 'test-sources'
+ }
+ artifacts.archives testSourcesJar
- if (isRelease() || project.hasProperty('publishing')) {
- apply plugin: "maven-publish"
+ task javadocJar(type: Jar, dependsOn: javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+ }
+ artifacts.archives javadocJar
// Only sign artifacts if we are performing a release
if (isRelease()) {
@@ -631,8 +630,7 @@ ext.applyJavaNature = {
// Strip the "shaded" classifier.
classifier null
}
- // TODO: Use the shadow test jar here instead of the test jar.
- artifact packageTests {
+ artifact shadowTestJar {
classifier "tests"
}
artifact sourcesJar {
diff --git a/sdks/java/harness/build.gradle b/sdks/java/harness/build.gradle
index 7f215e683d8..b6bd0f2e76c 100644
--- a/sdks/java/harness/build.gradle
+++ b/sdks/java/harness/build.gradle
@@ -17,8 +17,16 @@
*/
apply from: project(":").file("build_rules.gradle")
-applyJavaNature(enableShadow: false /* Disable shadow because of custom
configuration below. */)
-apply plugin: "com.github.johnrengelman.shadow"
+applyJavaNature(shadowClosure:
+ // Create an uber jar without repackaging for the SDK harness
+ // TODO: We have been releasing this in the past, consider not
+ // releasing it since its typically bad practice to release 'all'
+ // jars.
+ {
+ dependencies {
+ include('.*')
+ }
+ })
description = "Apache Beam :: SDKs :: Java :: Harness"
ext.summary = "This contains the SDK Fn Harness for Beam Java"
@@ -56,10 +64,3 @@ dependencies {
testCompile library.java.mockito_core
testCompile library.java.slf4j_jdk14
}
-
-// Create an uber jar without repackaging for the SDK harness
-// Note, this jar should never be published because it bundles
-// dependencies without repackaging.
-shadowJar {
- mergeServiceFiles()
-}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 90152)
Time Spent: 12h 10m (was: 12h)
> Use Gradle to build/release project
> -----------------------------------
>
> Key: BEAM-3249
> URL: https://issues.apache.org/jira/browse/BEAM-3249
> Project: Beam
> Issue Type: Improvement
> Components: build-system, testing
> Reporter: Luke Cwik
> Assignee: Luke Cwik
> Priority: Major
> Time Spent: 12h 10m
> Remaining Estimate: 0h
>
> I have collected data by running several builds against master using Gradle
> and Maven without using Gradle's support for incremental builds.
> Gradle (mins)
> min: 25.04
> max: 160.14
> median: 45.78
> average: 52.19
> stdev: 30.80
> Maven (mins)
> min: 56.86
> max: 216.55
> median: 87.93
> average: 109.10
> stdev: 48.01
> I excluded a few timeouts (240 mins) that happened during the Maven build
> from its numbers but we can see conclusively that Gradle is about twice as
> fast for the build when compared to Maven when run using Jenkins.
> Original dev@ thread:
> https://lists.apache.org/thread.html/225dddcfc78f39bbb296a0d2bbef1caf37e17677c7e5573f0b6fe253@%3Cdev.beam.apache.org%3E
> The data is available here
> https://docs.google.com/spreadsheets/d/1MHVjF-xoI49_NJqEQakUgnNIQ7Qbjzu8Y1q_h3dbF1M/edit?usp=sharing
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)