You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by co...@apache.org on 2015/09/20 21:30:33 UTC
[1/2] bigtop git commit: BIGTOP-2055. Refactor packages.gradle to get
rid of excessive data containers; make code cleaner
Repository: bigtop
Updated Branches:
refs/heads/master 724ddf1fc -> 3a257119d
BIGTOP-2055. Refactor packages.gradle to get rid of excessive data containers; make code cleaner
Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/fdd034a5
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/fdd034a5
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/fdd034a5
Branch: refs/heads/master
Commit: fdd034a5db4ae172a19caca1a8236e43fd503259
Parents: 724ddf1
Author: Konstantin Boudnik <co...@apache.org>
Authored: Fri Sep 18 12:47:31 2015 -0700
Committer: Konstantin Boudnik <co...@apache.org>
Committed: Sat Sep 19 12:19:07 2015 -0700
----------------------------------------------------------------------
packages.gradle | 56 +++++++++++++++++++++-------------------------------
1 file changed, 23 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/bigtop/blob/fdd034a5/packages.gradle
----------------------------------------------------------------------
diff --git a/packages.gradle b/packages.gradle
index ad6b7ab..5f687b7 100644
--- a/packages.gradle
+++ b/packages.gradle
@@ -57,7 +57,8 @@ def final DIST_DIR = config.bigtop.distdir
def final DL_DIR = config.bigtop.dldir
def final BIGTOP_BUILD_STAMP = System.getenv('BIGTOP_BUILD_STAMP') ?: config.bigtop.buildstamp
-def components = []
+// List of tasks derived from the BOM file is used to preserve the natural order
+def bomTasks = []
// Package building and logic around it
@@ -80,12 +81,12 @@ def toOldStyleName = { newname ->
newname.toUpperCase().replaceAll("\\-", "_")
}
def setDefaults = { comp ->
- // The closure parameer is a component in the config.bigtop.components
- if (!comp.value.pkg) {
- comp.value.pkg = comp.value.name
+ // The closure parameter is a component in the config.bigtop.components
+ if (!comp.pkg) {
+ comp.pkg = comp.name
}
- if (!comp.value.version.pkg) {
- comp.value.version.pkg = comp.value.version.base
+ if (!comp.version.pkg) {
+ comp.version.pkg = comp.version.base
}
}
def nativePackaging = {
@@ -104,14 +105,14 @@ def nativePackaging = {
}.call()
task "packages-help" (description: "All package build related tasks information", group: PACKAGES_GROUP) << {
- components.each { target ->
- println (target + "\n\t[" + tasks.findAll { alltask -> alltask.name.startsWith(target.toLowerCase())}*.name.join(", ") + "]")
+ config.bigtop.components.each { label, comp ->
+ println (comp.name + "\n\t[" + tasks.findAll { alltask -> alltask.name.startsWith(comp.name)}*.name.join(", ") + "]")
}
}
task "bom-json" (description: "List the components of the stack in json format") << {
def componentObjects = config.bigtop.components.sort().collect {
- setDefaults(it)
+ setDefaults(it.value)
[
name: [
project: it.value.name,
@@ -148,9 +149,8 @@ task "bom-json" (description: "List the components of the stack in json format")
task "all-components" (description: "List the components of the stack") << {
println "${project.name} ${config.bigtop.version} stack includes the following components"
- components.sort().each { comp ->
- def bVersion = config.bigtop.components[comp].version.base as String
- println sprintf ('\t%1$s %2$s', comp.padRight(20), bVersion.padLeft(15))
+ config.bigtop.components.sort().each { label, comp ->
+ println sprintf ('\t%1$s %2$s', comp.name.padRight(20), comp.version.base.padLeft(15))
}
}
@@ -306,8 +306,8 @@ def genTasks = { target ->
}
// If dependencies aren't explicitly set, the default build order is defined
// by the sequence of the components in the BOM file
- if (!config.bigtop.dependencies && components.size() > 0)
- tdeb.mustRunAfter "${components.get(components.size() - 1)}-deb".toLowerCase()
+ if (!config.bigtop.dependencies && bomTasks.size() > 0)
+ tdeb.mustRunAfter "${bomTasks.get(bomTasks.size() - 1)}-deb".toLowerCase()
task "$target-sdeb" (dependsOn: ["${target}_vardefines", "${target}-tar"],
description: "Building SDEB for $target artifacts",
group: PACKAGES_GROUP
@@ -422,8 +422,8 @@ def genTasks = { target ->
}
// If dependencies aren't explicitly set, the default build order is defined
// by the sequence of the components in the BOM file
- if (!config.bigtop.dependencies && components.size() > 0)
- trpm.mustRunAfter "${components.get(components.size() - 1)}-rpm".toLowerCase()
+ if (!config.bigtop.dependencies && bomTasks.size() > 0)
+ trpm.mustRunAfter "${bomTasks.get(bomTasks.size() - 1)}-rpm".toLowerCase()
task "$target-srpm" (dependsOn: ["${target}_vardefines" , "${target}-tar"],
description: "Building SRPM for $target artifacts",
group: PACKAGES_GROUP) << {
@@ -525,14 +525,7 @@ def genTasks = { target ->
println "Base: ${config.bigtop.components[target].version.base}"
}
task "${target}_vardefines" << {
- //TODO need to find out a way to set defaults in the same way for bom-json and here
-// setDefaults(config.bigtop.components.target.value)
- if (!config.bigtop.components[target].pkg) {
- config.bigtop.components[target].pkg = config.bigtop.components[target].name
- }
- if (!config.bigtop.components[target].version.pkg) {
- config.bigtop.components[target].version.pkg = config.bigtop.components[target].version.base
- }
+ setDefaults(config.bigtop.components[target])
config.bigtop.components[target].package.release = '1'
@@ -594,15 +587,8 @@ def genTasks = { target ->
task "$target-help" (description: "List of available tasks for $target", group: PACKAGES_GROUP) << {
println (target + "\n\t[" + tasks.findAll { alltask -> alltask.name.startsWith(target)}*.name.join(", ") + "]")
}
-}
-def readBOM = {
- doValidateBOM(config)
- config.bigtop.components.each { component_label, comp ->
- assert component_label == comp.name
- genTasks(comp.name)
- components.add(comp.name)
- }
+ bomTasks.add(target)
}
// Let's enforce some of the configuration requirements
@@ -615,7 +601,11 @@ private void doValidateBOM(config) {
// We need to make sure that all dynamic tasks are available for invocation
project.afterEvaluate {
- readBOM()
+ doValidateBOM(config)
+ config.bigtop.components.each { component_label, comp ->
+ assert component_label == comp.name
+ genTasks(comp.name)
+ }
// Versions need to be preserved for more than just component:
// - there are JDK version requirement
// - possibly more in the future
[2/2] bigtop git commit: BIGTOP-2056: Remove top-level check-env.sh
Posted by co...@apache.org.
BIGTOP-2056: Remove top-level check-env.sh
Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/3a257119
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/3a257119
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/3a257119
Branch: refs/heads/master
Commit: 3a257119ddc8fbb1ff2317542832e491e05e1bdd
Parents: fdd034a
Author: Olaf Flebbe <of...@oflebbe.de>
Authored: Sun Sep 20 17:29:31 2015 +0200
Committer: Konstantin Boudnik <co...@apache.org>
Committed: Sun Sep 20 12:30:08 2015 -0700
----------------------------------------------------------------------
check-env.sh | 30 ------------------------------
1 file changed, 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/bigtop/blob/3a257119/check-env.sh
----------------------------------------------------------------------
diff --git a/check-env.sh b/check-env.sh
deleted file mode 100755
index 1f655fb..0000000
--- a/check-env.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env bash
-
-# 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.
-
-
-if [ -z "$JAVA_HOME" ]; then
- echo JAVA_HOME is not set
- exit 1
-fi
-
-if [ -z "$FORREST_HOME" ]; then
- echo FORREST_HOME is not set
- exit 1
-fi
-
-echo Found all necessary env variables.
-exit 0