-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
222 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
######################################################################### |