[ https://issues.apache.org/jira/browse/BEAM-6178?focusedWorklogId=172789&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-172789 ]
ASF GitHub Bot logged work on BEAM-6178: ---------------------------------------- Author: ASF GitHub Bot Created on: 06/Dec/18 19:16 Start Date: 06/Dec/18 19:16 Worklog Time Spent: 10m Work Description: swegner commented on a change in pull request #7197: [BEAM-6178] Adding beam-sdks-java-bom, adding exportJavadoc flag for applyJavaNature URL: https://github.com/apache/beam/pull/7197#discussion_r239572487 ########## File path: sdks/java/bom/build.gradle ########## @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +apply plugin: org.apache.beam.gradle.BeamModulePlugin + +apply plugin: "java" +apply plugin: "maven-publish" + +def isRelease(Project project) { + return project.hasProperty('isRelease') +} + +ext { + mavenJavaDir = "$project.buildDir/publications/mavenJava" + mavenJavaBomOutputFile = file(mavenJavaDir + "/pom-default.xml") +} + +for (String projName : rootProject.ext.allProjectNames) { + if (!projName.equals(':' + project.name)) { + evaluationDependsOn(projName) + } +} + +// Copy our pom.xml to the location where a generated POM would go +task copyPom() { + doLast { + def moduleNames = new ArrayList<>() + for (String projName : rootProject.ext.allProjectNames) { + def subproject = project(projName) + if (subproject.ext.properties.containsKey('includeInJavaBom') && + subproject.ext.properties.includeInJavaBom) { + moduleNames.add(subproject.name) + } + } + + new File(mavenJavaDir).mkdirs() + copy { + from 'pom.xml.template' + into mavenJavaDir + rename 'pom.xml.template', 'pom-default.xml' + expand(version: project.version, modules: moduleNames) + } + } +} + +assemble.dependsOn copyPom + +// We want to use our own pom.xml instead of the generated one, so we disable +// the pom.xml generation and have the publish tasks depend on `copyPom` instead. +tasks.whenTaskAdded { task -> + if (task.name == 'generatePomFileForMavenJavaPublication') { Review comment: This introduces a second method of pom file generation and a duplicated set of POM boilerplate. I worry that when one gets updated we'll forget to update the other. Do you think we could consolidate on a single way of generating POM's? ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 172789) Time Spent: 50m (was: 40m) > Create BOM for Beam > ------------------- > > Key: BEAM-6178 > URL: https://issues.apache.org/jira/browse/BEAM-6178 > Project: Beam > Issue Type: Improvement > Components: build-system > Affects Versions: 2.10.0 > Reporter: Garrett Jones > Assignee: Garrett Jones > Priority: Critical > Time Spent: 50m > Remaining Estimate: 0h > > Add a module to Beam which generates a BOM for Beam modules. -- This message was sent by Atlassian JIRA (v7.6.3#76005)