Skip to content

Commit

Permalink
Added eclipse support
Browse files Browse the repository at this point in the history
  • Loading branch information
mepux committed Jul 29, 2020
1 parent e84bacc commit 8a620d8
Show file tree
Hide file tree
Showing 5 changed files with 222 additions and 44 deletions.
44 changes: 28 additions & 16 deletions bin/cb
Original file line number Diff line number Diff line change
Expand Up @@ -622,26 +622,29 @@ downloadFiles() {
! which wget >/dev/null 2>&1 && echo "${CB_LINEHEADER}Can not download wildcard by curl, please install wget." | tee -a "$CB_LOGFILE" && return
fi

#CB_USER_AGENT="--user-agent=\"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36\""
if [ "$HTTP_REQUEST_CLI" = "curl" ]; then
! [ -n "$CB_CURL_PARAM" ] && CB_CURL_PARAM="-L -C -"
#! [ -n "$CB_CURL_PARAM" ] && CB_CURL_PARAM="-L"
! [ -n "$CB_CURL_CONTINUE" ] && CB_CURL_CONTINUE="-C -"
! [ -n "$CB_CURL_REDIRECT" ] && CB_CURL_REDIRECT="-L"
! [ -n "$CB_CURL_SECURITY_CREDENTIALS" ] && CB_CURL_SECURITY_CREDENTIALS="--insecure"
! [ -n "$CB_CURL_PROGRESSBAR" ] && CB_CURL_PROGRESSBAR="-#" && CB_CURL_LOG=" "
! [ -n "$CB_CURL_PROGRESSBAR" ] && CB_CURL_PROGRESSBAR="-#"
[ -n "$CB_PACKAGE_COOKIE" ] && CB_CURL_COOKIE="-c $CB_PACKAGE_COOKIE"
[ -n "$CB_PACKAGE_USERAGENT" ] && CB_CURL_USERAGENT="-H User-Agent:\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36\""
[ -n "$CB_PACKAGE_SILENT_LOG" ] && CB_CURL_LOG="-Ss"
#[ -n "$CB_VERBOSE" = "true" ] && CB_CURL_TRACE="--trace-ascii"
#CB_CURL_USER_CREDENTIALS="-u <user:password>
! [ -n "$CB_CURL_USER_CREDENTIALS" ] && CB_CURL_USER_CREDENTIALS=" "
! [ -n "$CB_CURL_LOG" ] && CB_CURL_LOG="-Ss"
#echo "$HTTP_REQUEST_CLI $CB_CURL_PARAM $CB_CURL_SECURITY_CREDENTIALS $CB_CURL_PROGRESSBAR $CB_CURL_USER_CREDENTIALS $CB_CURL_LOG -o $2 $1"
[ -z "$CB_CURL_USER_CREDENTIALS" ] && CB_CURL_USER_CREDENTIALS=" "
#echo "$HTTP_REQUEST_CLI $CB_CURL_CONTINUE $CB_CURL_REDIRECT $CB_CURL_SECURITY_CREDENTIALS $CB_CURL_PROGRESSBAR $CB_CURL_USER_CREDENTIALS $CB_CURL_LOG -o $2 $1"
#2>>$CB_LOGFILE
CB_LAST_CMD="$HTTP_REQUEST_CLI $CB_CURL_PARAM $CB_CURL_SECURITY_CREDENTIALS $CB_CURL_PROGRESSBAR $CB_CURL_USER_CREDENTIALS $CB_CURL_LOG -o $2 $1"
eval $HTTP_REQUEST_CLI $CB_CURL_PARAM $CB_CURL_SECURITY_CREDENTIALS $CB_CURL_PROGRESSBAR $CB_CURL_USER_CREDENTIALS $CB_CURL_LOG -o "$2" "$1"
CB_LAST_CMD="$HTTP_REQUEST_CLI $CB_CURL_PROGRESSBAR $CB_CURL_CONTINUE $CB_CURL_REDIRECT $CB_CURL_COOKIE $CB_CURL_USERAGENT $CB_CURL_SECURITY_CREDENTIALS $CB_CURL_TRACE $CB_CURL_USER_CREDENTIALS $CB_CURL_LOG -o $2 \"$1\""
[ "$CB_VERBOSE" = "true" ] && echo "${CB_LINEHEADER}Download call: $CB_LAST_CMD"
eval $HTTP_REQUEST_CLI "$CB_CURL_PROGRESSBAR" "$CB_CURL_CONTINUE" "$CB_CURL_REDIRECT" "$CB_CURL_COOKIE" "$CB_CURL_USERAGENT" "$CB_CURL_SECURITY_CREDENTIALS" "$CB_CURL_TRACE" "$CB_CURL_USER_CREDENTIALS" "$CB_CURL_LOG" -o "$2" "$1"
#&> /dev/stdout | tee -a "$CB_LOGFILE"
errorCode=$?
errorCode=$?

if [ $errorCode -eq 33 ]; then
CB_CURL_PARAM="-L"
CB_LAST_CMD="$HTTP_REQUEST_CLI $CB_CURL_PARAM $CB_CURL_SECURITY_CREDENTIALS $CB_CURL_PROGRESSBAR $CB_CURL_USER_CREDENTIALS $CB_CURL_LOG -o $2 $1"
eval $HTTP_REQUEST_CLI "$CB_CURL_PARAM $CB_CURL_SECURITY_CREDENTIALS" "$CB_CURL_PROGRESSBAR" "$CB_CURL_USER_CREDENTIALS" "$CB_CURL_LOG" -o "$2" "$1"
CB_LAST_CMD="$HTTP_REQUEST_CLI $CB_CURL_PROGRESSBAR $CB_CURL_REDIRECT $CB_CURL_COOKIE $CB_CURL_USERAGENT $CB_CURL_SECURITY_CREDENTIALS $CB_CURL_TRACE $CB_CURL_USER_CREDENTIALS $CB_CURL_LOG -o $2 \"$1\""
[ "$CB_VERBOSE" = "true" ] && echo "${CB_LINEHEADER}Download call: $CB_LAST_CMD"
eval $HTTP_REQUEST_CLI "$CB_CURL_PROGRESSBAR" "$CB_CURL_REDIRECT" "$CB_CURL_COOKIE" "$CB_CURL_USERAGENT" "$CB_CURL_SECURITY_CREDENTIALS" "$CB_CURL_TRACE" "$CB_CURL_USER_CREDENTIALS" "$CB_CURL_LOG" -o "$2" "$1"
#&> /dev/stdout | tee -a "$CB_LOGFILE"
errorCode=$?
fi
Expand All @@ -653,18 +656,27 @@ downloadFiles() {
! [ -n "$CB_WGET_LOG" ] && CB_WGET_LOG="-a $CB_LOGFILE"

if [ -z $2 ]; then
! [ -n "$CB_WGET_FILTER" ] && CB_WGET_FILTER="--exclude-directories=_deprecated -R \"index.*\""
! [ -n "$CB_WGET_RECURSIVE_PARAM" ] && CB_WGET_RECURSIVE_PARAM="-r -np -nH --timestamping"
[ -z "$CB_WGET_FILTER" ] && CB_WGET_FILTER="--exclude-directories=_deprecated -R \"index.*\""
[ -z "$CB_WGET_RECURSIVE_PARAM" ] && CB_WGET_RECURSIVE_PARAM="-r -np -nH --timestamping"
echo "$HTTP_REQUEST_CLI $1 $CB_WGET_RECURSIVE_PARAM $CB_WGET_PARAM $CB_WGET_SECURITY_CREDENTIALS $CB_WGET_PROGRESSBAR $CB_WGET_USER_CREDENTIALS $CB_WGET_FILTER $CB_WGET_LOG"
CB_LAST_CMD="$HTTP_REQUEST_CLI $1 $CB_WGET_RECURSIVE_PARAM $CB_WGET_PARAM $CB_WGET_SECURITY_CREDENTIALS $CB_WGET_PROGRESSBAR $CB_WGET_USER_CREDENTIALS $CB_WGET_FILTER $CB_WGET_LOG"
[ "$CB_VERBOSE" = "true" ] && echo "${CB_LINEHEADER}Download call: $CB_LAST_CMD"
eval $HTTP_REQUEST_CLI "$1" "$CB_WGET_RECURSIVE_PARAM" "$CB_WGET_PARAM" "$CB_WGET_SECURITY_CREDENTIALS" "$CB_WGET_PROGRESSBAR" "$CB_WGET_USER_CREDENTIALS" "$CB_WGET_FILTER" "$CB_WGET_LOG"
else
CB_LAST_CMD="$HTTP_REQUEST_CLI -O $2 $1 $CB_WGET_PARAM $CB_WGET_SECURITY_CREDENTIALS $CB_WGET_PROGRESSBAR $CB_WGET_USER_CREDENTIALS $CB_WGET_LOG"
[ "$CB_VERBOSE" = "true" ] && echo "${CB_LINEHEADER}Download call: $CB_LAST_CMD"
eval $HTTP_REQUEST_CLI -O "$2" "$1" "$CB_WGET_PARAM" "$CB_WGET_SECURITY_CREDENTIALS" "$CB_WGET_PROGRESSBAR" "$CB_WGET_USER_CREDENTIALS" "$CB_WGET_LOG"
fi

errorCode=$?
fi

unset CB_CURL_LOG
unset CB_CURL_USERAGENT
unset CB_PACKAGE_COOKIE
unset CB_CURL_COOKIE
unset CB_PACKAGE_SILENT_LOG
unset CB_PACKAGE_USERAGENT
}


Expand Down Expand Up @@ -720,7 +732,7 @@ downloadPackage() {

# if we already have it we ignore
if ! [ -r "$CB_DEV_REPOSITORY/$CB_PACKAGE_DOWNLOAD_NAME" ]; then
echo "${CB_LINEHEADER}Download $CB_PACKAGE_NAME version $CB_PACKAGE_VERSION (missing $CB_DEV_REPOSITORY/$CB_PACKAGE_DOWNLOAD_NAME)." | tee -a "$CB_LOGFILE"
echo "${CB_LINEHEADER}Download $CB_PACKAGE_NAME version $CB_PACKAGE_VERSION" | tee -a "$CB_LOGFILE"
if cd "$CB_DEV_REPOSITORY"; then
downloadFiles "$CB_PACKAGE_DOWNLOAD_URL" "$CB_DEV_REPOSITORY/$CB_PACKAGE_DOWNLOAD_NAME"
cd "$CB_WORKING_PATH"
Expand Down
92 changes: 92 additions & 0 deletions bin/packages/eclipse/eclipse.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
@ECHO OFF

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: eclipse.bat
::
:: Copyright by toolarium, all rights reserved.
:: MIT License: https://mit-license.org
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


set eclipseFilter=
if not defined CB_ECLIPSE_VERSION set "CB_ECLIPSE_VERSION=oxygen|jee-package"
set "CB_PACKAGE_VERSION=%1"
set "CB_ECLIPSE_PACKAGE_NAME=%2"
if .%CB_PACKAGE_VERSION% == . FOR /F "tokens=1,2 delims=|" %%i in ("%CB_ECLIPSE_VERSION%") do ( set "CB_PACKAGE_VERSION=%%i" )
if .%CB_ECLIPSE_PACKAGE_NAME% == . set "CB_ECLIPSE_PACKAGE_NAME=%CB_ECLIPSE_VERSION:*|=%"
if .%CB_ECLIPSE_PACKAGE_NAME% == . set "CB_ECLIPSE_PACKAGE_NAME=jee-package"
set "CB_ECLIPSE_INFO_DOWNLOAD_URL=https://api.eclipse.org/download/release/eclipse_packages"

set CB_PACKAGE_BASE_URL=
set CB_PACKAGE_DOWNLOAD_NAME=
set CB_PACKAGE_VERSION_NAME=
set CB_PACKAGE_VERSION_HASH=

:: get version information
echo %CB_LINEHEADER%Check eclipse %CB_PACKAGE_VERSION% version / %CB_ECLIPSE_PACKAGE_NAME% & echo %CB_LINEHEADER%Check eclipse %CB_PACKAGE_VERSION% version / %CB_ECLIPSE_PACKAGE_NAME%>> "%CB_LOGFILE%"
::set "eclipseFilter=&release_version=%CB_PACKAGE_VERSION%"
set "CB_ECLIPSE_JSON_INFO=%CB_LOGS%\cb-eclipseFile.json"
set "CB_PACKAGE_SILENT_LOG=silent"
set "CB_PACKAGE_USERAGENT=true"
set "CB_PACKAGE_COOKIE=%CB_LOGS%\cb-eclipse-cookiejar"
%CB_BIN%\%CB_WGET_CMD% -O%TMPFILE% %CB_WGET_SECURITY_CREDENTIALS% -q "%CB_ECLIPSE_INFO_DOWNLOAD_URL%?release_name=%CB_PACKAGE_VERSION%%eclipseFilter%"
powershell -command "$json = (Get-Content "%TMPFILE%" -Raw) | ConvertFrom-Json; $json.release_name" > "%CB_ECLIPSE_JSON_INFO%"
set /p CB_PACKAGE_VERSION_NAME= < "%CB_ECLIPSE_JSON_INFO%"
powershell -command "$json = (Get-Content "%TMPFILE%" -Raw) | ConvertFrom-Json; $json.release_version" > "%CB_ECLIPSE_JSON_INFO%"
set /p CB_ECLIPSE_RELEASE_VERSION= < "%CB_ECLIPSE_JSON_INFO%"
powershell -command "$json = (Get-Content "%TMPFILE%" -Raw) | ConvertFrom-Json; $json.packages.$Env:CB_ECLIPSE_PACKAGE_NAME.files.windows.$Env:CB_PROCESSOR_ARCHITECTURE_NUMBER.url" > "%CB_ECLIPSE_JSON_INFO%"
set /p CB_PACKAGE_DOWNLOAD_URL= < "%CB_ECLIPSE_JSON_INFO%"

set "CB_PACKAGE_DOWNLOAD_NAME=%CB_PACKAGE_DOWNLOAD_URL%"
:PREPARE_PACKAGE_NAME
for /f "tokens=1 delims=/" %%G in ("%CB_PACKAGE_DOWNLOAD_NAME%") do (set "CB_PACKAGE_DOWNLOAD_NAME=%CB_PACKAGE_DOWNLOAD_NAME:*/=%")
echo %CB_PACKAGE_DOWNLOAD_NAME% | findstr /C:"/" >NUL && (goto :PREPARE_PACKAGE_NAME)

::echo %CB_ECLIPSE_RELEASE_VERSION%
::echo %CB_PACKAGE_VERSION_NAME%
::echo %CB_PACKAGE_DOWNLOAD_NAME%
::echo %CB_PACKAGE_DOWNLOAD_URL%

del "%CB_ECLIPSE_JSON_INFO%" >nul 2>nul
move %TMPFILE% %CB_DEV_REPOSITORY%\%CB_PACKAGE_DOWNLOAD_NAME%.json >nul 2>nul

set "CB_ECLIPSE_JSON_MIRROR_INFO=%CB_LOGS%\cb-eclipseFile-mirror.html"
set "CB_ECLIPSE_JSON_REDIRECT_INFO=%CB_LOGS%\cb-eclipseFile-redirect.html"
set "CB_PACKAGE_COOKIE=%CB_LOGS%\cb-eclipse-cookiejar"
del "%CB_ECLIPSE_JSON_MIRROR_INFO%" >nul 2>nul
del "%CB_ECLIPSE_JSON_REDIRECT_INFO%" >nul 2>nul
del "%CB_PACKAGE_COOKIE%" >nul 2>nul

:: get mirror id
set "USER_AGENT=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36"
%CB_BIN%\%CB_WGET_CMD% -O%CB_ECLIPSE_JSON_MIRROR_INFO% %CB_WGET_SECURITY_CREDENTIALS% --keep-session-cookies --save-cookies=%CB_PACKAGE_COOKIE% --user-agent "%USER_AGENT%" -q "%CB_PACKAGE_DOWNLOAD_URL%"
:: find proper line
findstr /R /C:"File:" /C:mirror_id= %CB_ECLIPSE_JSON_MIRROR_INFO% | findstr/n ^^ | findstr ^^1: >%CB_ECLIPSE_JSON_INFO%
set "MIRROR_ID="
for /f "tokens=1,2,3,4 delims==" %%G in ('type %CB_ECLIPSE_JSON_INFO%') do (set "MIRROR_ID=%%J")
del "%CB_ECLIPSE_JSON_INFO%" >nul 2>nul
set "MIRROR_ID=%MIRROR_ID:" =/%"
for /f "tokens=1* delims=/" %%G in ("%MIRROR_ID%") do (set "MIRROR_ID=%%G")
if .%CB_VERBOSE% == .true echo %CB_LINEHEADER%Found mirror id: %MIRROR_ID%
%CB_BIN%\%CB_WGET_CMD% -O%CB_ECLIPSE_JSON_REDIRECT_INFO% %CB_WGET_SECURITY_CREDENTIALS% --keep-session-cookies --load-cookies=%CB_PACKAGE_COOKIE% --user-agent "%USER_AGENT%" -q "%CB_PACKAGE_DOWNLOAD_URL%&mirror_id=%MIRROR_ID%"
:: find proper line
findstr /R /C:"META HTTP-EQUIV=" /C:CONTENT= /C:URL= %CB_ECLIPSE_JSON_REDIRECT_INFO% | findstr/n ^^ | findstr ^^1: >%CB_ECLIPSE_JSON_INFO%
set "CB_PACKAGE_DOWNLOAD_URL="
for /f "tokens=1,2,3,4,5,6,7,8,9,10 delims==" %%A in ('type %CB_ECLIPSE_JSON_INFO%') do (echo "%%J" > %TMPFILE%)
for /f "tokens=1 delims=>" %%N in ('type %TMPFILE%') do (set "CB_PACKAGE_DOWNLOAD_URL=%%N")
del "%CB_ECLIPSE_JSON_INFO%" >nul 2>nul
del "%TMPFILE%" >nul 2>nul
CALL :dequote CB_PACKAGE_DOWNLOAD_URL
if .%CB_VERBOSE% == .true echo %CB_LINEHEADER%Found mirror url: %CB_PACKAGE_DOWNLOAD_URL%
del "%CB_ECLIPSE_JSON_MIRROR_INFO%" >nul 2>nul
del "%CB_ECLIPSE_JSON_REDIRECT_INFO%" >nul 2>nul
del "%CB_PACKAGE_COOKIE%" >nul 2>nul
goto DOWNLOAD_ECLIPSE_END

:DeQuote
for /f "delims=" %%A in ('echo %%%1%%') do set %1=%%~A
goto :eof

:DOWNLOAD_ECLIPSE_END
76 changes: 76 additions & 0 deletions bin/packages/eclipse/eclipse.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash

#########################################################################
#
# eclipse.sh
#
# Copyright by toolarium, all rights reserved.
# MIT License: https://mit-license.org
#
#########################################################################

eclipseFilter=
[ -z "$CB_ECLIPSE_VERSION" ] && CB_ECLIPSE_VERSION="oxygen|jee-package"
#[ -z "$CB_ECLIPSE_RELEASE_VERSION" ] && CB_ECLIPSE_RELEASE_VERSION="r"
CB_PACKAGE_VERSION=$1
[ -z "$CB_PACKAGE_VERSION" ] && CB_PACKAGE_VERSION="${CB_ECLIPSE_VERSION%|*}"
CB_ECLIPSE_PACKAGE_NAME=$2
[ -z "$CB_ECLIPSE_PACKAGE_NAME" ] && CB_ECLIPSE_PACKAGE_NAME="${CB_ECLIPSE_VERSION#*|}"
[ -z "$CB_ECLIPSE_PACKAGE_NAME" ] && CB_ECLIPSE_PACKAGE_NAME=jee-package

CB_ECLIPSE_INFO_DOWNLOAD_URL="https://api.eclipse.org/download/release/eclipse_packages"

# get version information
echo "${CB_LINEHEADER}Check eclipse $CB_PACKAGE_VERSION version / $CB_ECLIPSE_PACKAGE_NAME" | tee -a "$CB_LOGFILE"
#eclipseFilter="&release_version=${CB_PACKAGE_VERSION}"
CB_ECLIPSE_JSON_INFO=$CB_LOGS/cb-eclipseFile.json
CB_PACKAGE_SILENT_LOG="silent"
CB_PACKAGE_USERAGENT=true
CB_PACKAGE_COOKIE="$CB_LOGS/cb-eclipse-cookiejar"

downloadFiles "${CB_ECLIPSE_INFO_DOWNLOAD_URL}?release_name=${CB_PACKAGE_VERSION}$eclipseFilter" "$CB_ECLIPSE_JSON_INFO"

CB_ECLIPSE_OS="$CB_OS"
[ "$CB_ECLIPSE_OS" = "cygwin" ] && CB_ECLIPSE_OS="windows"

CB_PACKAGE_VERSION_NAME=$(cat "$CB_ECLIPSE_JSON_INFO" | $CB_BIN/cb-json --value --name release_name)
CB_PACKAGE_DOWNLOAD_URL=$(eval "cat \"$CB_ECLIPSE_JSON_INFO\" | $CB_BIN/cb-json --value --name packages.${CB_ECLIPSE_PACKAGE_NAME}.files.${CB_ECLIPSE_OS}.${CB_PROCESSOR_ARCHITECTURE_NUMBER}.url")

CB_PACKAGE_DOWNLOAD_NAME="${CB_PACKAGE_DOWNLOAD_URL##*/}"
mv "$CB_ECLIPSE_JSON_INFO" "$CB_DEV_REPOSITORY/${CB_PACKAGE_DOWNLOAD_NAME}.json" >/dev/null 2>&1

CB_ECLIPSE_JSON_MIRROR_INFO="$CB_LOGS/cb-eclipseFile-mirror.html"
CB_ECLIPSE_JSON_REDIRECT_INFO="$CB_LOGS/cb-eclipseFile-redirect.html"
rm -f "$CB_ECLIPSE_JSON_MIRROR_INFO" >/dev/null 2>&1
rm -f "$CB_ECLIPSE_JSON_REDIRECT_INFO" >/dev/null 2>&1

CB_PACKAGE_SILENT_LOG="silent"
CB_PACKAGE_USERAGENT=true
CB_PACKAGE_COOKIE="$CB_LOGS/cb-eclipse-cookiejar"
rm -f "$CB_PACKAGE_COOKIE" 2>/dev/null
CB_CURL_CONTINUE=" "
downloadFiles "$CB_PACKAGE_DOWNLOAD_URL" "$CB_ECLIPSE_JSON_MIRROR_INFO"
mirrorId=$(cat "$CB_ECLIPSE_JSON_MIRROR_INFO" | grep File: | grep mirror_id= | sed 's/.*mirror_id=//g;s/"/ /g' | awk '{print $1}')

if [ -n "$mirrorId" ]; then
[ "$CB_VERBOSE" = "true" ] && echo "${CB_LINEHEADER}Found mirror id: $mirrorId"
#CB_PACKAGE_SILENT_LOG="silent"
CB_PACKAGE_USERAGENT=true
CB_PACKAGE_COOKIE="$CB_LOGS/cb-eclipse-cookiejar"
CB_PACKAGE_DOWNLOAD_URL="$CB_PACKAGE_DOWNLOAD_URL&mirror_id=${mirrorId}"
CB_CURL_CONTINUE=" "
#downloadFiles "$CB_PACKAGE_DOWNLOAD_URL" "$CB_ECLIPSE_JSON_REDIRECT_INFO"
$HTTP_REQUEST_CLI -# -L --insecure -o "$CB_ECLIPSE_JSON_REDIRECT_INFO" "$CB_PACKAGE_DOWNLOAD_URL"
realUrl=$(cat "$CB_ECLIPSE_JSON_REDIRECT_INFO" | grep "META HTTP-EQUIV=" | grep "CONTENT=" | grep "URL=" | sed 's/.*URL=//;s/\"/ /' | awk '{print $1}')
rm -f "$CB_ECLIPSE_JSON_MIRROR_INFO"
rm -f "$CB_ECLIPSE_JSON_REDIRECT_INFO"
[ -n "$realUrl" ] && CB_PACKAGE_DOWNLOAD_URL="$realUrl"
[ "$CB_VERBOSE" = "true" ] && echo "${CB_LINEHEADER}Found mirror url: $CB_PACKAGE_DOWNLOAD_URL"
fi

unset CB_PACKAGE_SILENT_LOG
unset CB_PACKAGE_USERAGENT
unset CB_PACKAGE_COOKIE
unset CB_CURL_CONTINUE

export CB_PACKAGE_DOWNLOAD_URL CB_PACKAGE_DOWNLOAD_NAME CB_PACKAGE_VERSION_NAME
6 changes: 2 additions & 4 deletions bin/packages/java/java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ CB_JAVA_JSON_INFO=$CB_LOGS/cb-javaFile.json
CB_JAVA_INFO_DOWNLOAD_URL=$CB_JAVA_INFO_DOWNLOAD_URL_V3_LATEST

# v3
CB_CURL_PARAM=" "
CB_CURL_PROGRESSBAR=" "

CB_PACKAGE_SILENT_LOG="silent"
echo "${CB_LINEHEADER}Check java $CB_PACKAGE_VERSION version" | tee -a "$CB_LOGFILE"
downloadFiles "$CB_JAVA_INFO_DOWNLOAD_URL" "$CB_JAVA_JSON_INFO"

#echo ${CB_LINEHEADER}Verify java packages | tee -a $CB_LOGFILE
cat $CB_JAVA_JSON_INFO | ${CB_BIN}/cb-json --filter architecture=$CB_JAVA_ARCH --filter jvm_impl=$CB_JAVA_JVM_IMPL --filter image_type=$CB_JAVA_IMAGE_TYPE --filter os=$CB_JAVA_OS > "${CB_JAVA_JSON_INFO}.filtered"
mv -f "${CB_JAVA_JSON_INFO}.filtered" "$CB_JAVA_JSON_INFO" >/dev/null 2>&1
Expand All @@ -72,5 +71,4 @@ CB_PACKAGE_VERSION=$(grep "semver" "$CB_JAVA_JSON_INFO" 2>/dev/null | ${CB_BIN}/
CB_PACKAGE_VERSION_HASH=$(cat "$CB_JAVA_JSON_INFO" 2>/dev/null | ${CB_BIN}/cb-json --value --name package.checksum)

mv "$CB_JAVA_JSON_INFO" "$CB_DEV_REPOSITORY/${CB_PACKAGE_DOWNLOAD_NAME}.json" >/dev/null 2>&1
CB_CURL_PARAM= && CB_CURL_PROGRESSBAR=
export CB_PACKAGE_BASE_URL CB_PACKAGE_DOWNLOAD_NAME CB_PACKAGE_VERSION_NAME
48 changes: 24 additions & 24 deletions conf/project-types.properties
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#########################################################################
#
# toolarium common build - project configuration file
#
# It's a simple key / value configuration file. The key corresponds to
# the project type. The value is the description of the project type.
#
# The possible project types depending of the support in the sister
# project 'common gradle build':
# https://github.com/toolarium/common-gradle-build
#
# The configuration file should be stored in windows format (CR/LF)!
#
# Copyright by toolarium, all rights reserved.
# MIT License: https://mit-license.org
#
#########################################################################

java-library = Simple java library
config = Configuration Project

#########################################################################
# EOF
#########################################################################
#########################################################################
#
# toolarium common build - project configuration file
#
# It's a simple key / value configuration file. The key corresponds to
# the project type. The value is the description of the project type.
#
# The possible project types depending of the support in the sister
# project 'common gradle build':
# https://github.com/toolarium/common-gradle-build
#
# The configuration file should be stored in windows format (CR/LF)!
#
# Copyright by toolarium, all rights reserved.
# MIT License: https://mit-license.org
#
#########################################################################

java-library = Simple java library|projectName|projectRootPackageName|projectGroupId|projectComponentId|projectDescription
config = Configuration Project|projectName|projectGroupId|projectComponentId|projectDescription

#########################################################################
# EOF
#########################################################################

0 comments on commit 8a620d8

Please sign in to comment.