Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,3 @@ CI/Test Templates:
ci/singlecluster/templates/ranger/install.properties
ci/singlecluster/templates/tez/conf/tez-site.xml
ci/singlecluster/templates/usersync/install.properties

=======================================================================

This product bundles Gradle Wrapper, which is licensed under
the Apache License, Version 2.0.

Copyright © Gradle, Inc.

server/gradle/wrapper/gradle-wrapper.jar

=======================================================================
10 changes: 10 additions & 0 deletions package/cloudberry-pxf-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,16 @@ section "Staging release: $TAG"
rm -rf "$TMP_DIR"
echo -e "Archive saved to: $TAR_NAME"

echo "Verifying tarball does not contain Gradle wrapper files..."
GRADLE_WRAPPER_FILES=$($DETECTED_TAR_TOOL -tzf "$TAR_NAME" | grep -E '(gradle-wrapper\.jar)$' || true)
if [[ -n "$GRADLE_WRAPPER_FILES" ]]; then
echo "WARNING: Found Gradle wrapper files in tarball:"
echo "$GRADLE_WRAPPER_FILES"
echo "These files must be excluded from Apache source release artifacts."
else
echo "[OK] Tarball verified clean of Gradle wrapper files"
fi

# Verify that no macOS extended attribute files are included
if [[ "$DETECTED_PLATFORM" == "macOS" ]]; then
echo "Verifying tarball does not contain macOS-specific files..."
Expand Down
4 changes: 3 additions & 1 deletion server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dist/

HELP.md
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**
!**/src/test/**

Expand All @@ -33,3 +32,6 @@ build/
*.iml
*.ipr
out/

# ASF Policies doesn't allow complied binaries in the source tarballs
gradle/wrapper/gradle-wrapper.jar
22 changes: 13 additions & 9 deletions server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ PXF_API_VERSION ?= $(shell cat $(PXF_ROOT_DIR)/api_version)

PXF_GRADLE_PROPERTIES = -Pversion=$(PXF_VERSION) -PapiVersion=$(PXF_API_VERSION)

.PHONY: prepare-gradle-wrapper
prepare-gradle-wrapper:
@APP_HOME="$(CURDIR)" bash ./gradlew-install.sh

help:
@echo
@echo "Possible targets"
Expand All @@ -39,10 +43,10 @@ help:
@echo " - stage - build PXF server and stage resulting artifacts for packaging"
@echo " - doc - creates aggregate javadoc under docs"

all:
all: prepare-gradle-wrapper
./gradlew $(PXF_GRADLE_PROPERTIES) clean stage

compile:
compile: prepare-gradle-wrapper
./gradlew $(PXF_GRADLE_PROPERTIES) compileJava

GRADLEW_TEST_PARAMS = test
Expand All @@ -56,21 +60,21 @@ ifneq "$(TEST)" ""
GRADLEW_TEST_PARAMS = :$(PROJECT):test --rerun-tasks --tests $(TEST_PATH)
endif

test unittest:
test unittest: prepare-gradle-wrapper
@if [ -n '$(TEST)' ] && [ -z '${TEST_FILE}' ]; then \
echo 'Test $(TEST) was not found'; \
exit 1; \
fi
./gradlew $(PXF_GRADLE_PROPERTIES) ${GRADLEW_TEST_PARAMS}

coverage:
coverage: prepare-gradle-wrapper
./gradlew $(PXF_GRADLE_PROPERTIES) ${GRADLEW_TEST_PARAMS} jacocoTestReport
@echo
@echo "Coverage reports can be found within each server module under <module-name>/build/reports/jacoco"
@echo "For example, the pxf-service coverage report is located at $(shell pwd)/pxf-service/build/reports/jacoco/test/html/index.html"

.PHONY: stage
stage:
stage: prepare-gradle-wrapper
./gradlew $(PXF_GRADLE_PROPERTIES) test stage
install -m 744 -d "build/stage/lib"
install -m 744 -d "build/stage/lib/native"
Expand All @@ -81,7 +85,7 @@ stage:
install -m 700 -d "build/stage/keytabs"

.PHONY: stage-notest
stage-notest:
stage-notest: prepare-gradle-wrapper
./gradlew $(PXF_GRADLE_PROPERTIES) stage -x test
install -m 744 -d "build/stage/lib"
install -m 744 -d "build/stage/lib/native"
Expand All @@ -91,7 +95,7 @@ stage-notest:
install -m 700 -d "build/stage/run"
install -m 700 -d "build/stage/keytabs"

clean:
clean: prepare-gradle-wrapper
./gradlew clean
rm -rf build

Expand All @@ -100,7 +104,7 @@ clean-all: clean

distclean maintainer-clean: clean

doc:
doc: prepare-gradle-wrapper
./gradlew $(PXF_GRADLE_PROPERTIES) aggregateJavadoc

.PHONY: install
Expand All @@ -120,5 +124,5 @@ install-server: stage-notest
cp -R build/stage/* "$(PXF_HOME)"

.PHONY: version
version:
version: prepare-gradle-wrapper
@./gradlew -q version
1 change: 1 addition & 0 deletions server/gradle/wrapper/gradle-6.8.2-wrapper.jar.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e996d452d2645e70c01c11143ca2d3742734a28da2bf61f25c82bdc288c9e637
Binary file removed server/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
1 change: 1 addition & 0 deletions server/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=8de6efc274ab52332a9c820366dd5cf5fc9d35ec7078fd70c8ec6913431ee610
70 changes: 70 additions & 0 deletions server/gradlew-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env bash
#
# Copyright (C) 2024 Dremio
#
# Licensed 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.
#

# Download the gradle-wrapper.jar if necessary and verify its integrity.
# This script is invoked by server/Makefile

if [[ -z "${APP_HOME:-}" ]]; then
# set APP_HOME as parent directory of the current script
APP_HOME="$(cd -- "$(dirname -- "$0")" && pwd)"
fi


# Extract the Gradle version from gradle-wrapper.properties.
GRADLE_DIST_VERSION="$(grep distributionUrl= "$APP_HOME/gradle/wrapper/gradle-wrapper.properties" | sed 's/^.*gradle-\([0-9.]*\)-[a-z]*.zip$/\1/')"
GRADLE_WRAPPER_SHA256="$APP_HOME/gradle/wrapper/gradle-wrapper-${GRADLE_DIST_VERSION}.jar.sha256"
GRADLE_WRAPPER_JAR="$APP_HOME/gradle/wrapper/gradle-wrapper.jar"
if [ -x "$(command -v sha256sum)" ] ; then
SHASUM="sha256sum"
else
if [ -x "$(command -v shasum)" ] ; then
SHASUM="shasum -a 256"
else
echo "Neither sha256sum nor shasum are available, install either." > /dev/stderr
exit 1
fi
fi
if [ ! -e "${GRADLE_WRAPPER_SHA256}" ]; then
# Delete the wrapper jar, if the checksum file does not exist.
rm -f "${GRADLE_WRAPPER_JAR}"
fi
if [ -e "${GRADLE_WRAPPER_JAR}" ]; then
# Verify the wrapper jar, if it exists, delete wrapper jar and checksum file, if the checksums
# do not match.
JAR_CHECKSUM="$(${SHASUM} "${GRADLE_WRAPPER_JAR}" | cut -d\ -f1)"
EXPECTED="$(cat "${GRADLE_WRAPPER_SHA256}")"
if [ "${JAR_CHECKSUM}" != "${EXPECTED}" ]; then
rm -f "${GRADLE_WRAPPER_JAR}" "${GRADLE_WRAPPER_SHA256}"
fi
fi
if [ ! -e "${GRADLE_WRAPPER_SHA256}" ]; then
curl --location --output "${GRADLE_WRAPPER_SHA256}" https://services.gradle.org/distributions/gradle-${GRADLE_DIST_VERSION}-wrapper.jar.sha256 || exit 1
fi
if [ ! -e "${GRADLE_WRAPPER_JAR}" ]; then
# The Gradle version extracted from the `distributionUrl` property does not contain ".0" patch
# versions. Need to append a ".0" in that case to download the wrapper jar.
GRADLE_VERSION="$(echo "$GRADLE_DIST_VERSION" | sed 's/^\([0-9]*[.][0-9]*\)$/\1.0/')"
curl --location --output "${GRADLE_WRAPPER_JAR}" https://raw.githubusercontent.com/gradle/gradle/v${GRADLE_VERSION}/gradle/wrapper/gradle-wrapper.jar || exit 1
JAR_CHECKSUM="$(${SHASUM} "${GRADLE_WRAPPER_JAR}" | cut -d\ -f1)"
EXPECTED="$(cat "${GRADLE_WRAPPER_SHA256}")"
if [ "${JAR_CHECKSUM}" != "${EXPECTED}" ]; then
# If the (just downloaded) checksum and the downloaded wrapper jar do not match, something
# really bad is going on.
echo "Expected sha256 of the downloaded gradle-wrapper.jar does not match the downloaded sha256!" > /dev/stderr
exit 1
fi
fi
Loading