diff --git a/.gitignore b/.gitignore index c05e22c..38ecde0 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,6 @@ updater/postzip/TeaClient-linux.tar.gz .deploy_secret **/*.d.ts -!modules/imports/copy_* +!modules/renderer/imports/copy_*.d.ts package-lock.json diff --git a/build_declarations.sh b/build_declarations.sh index 1670dc2..0c1e716 100755 --- a/build_declarations.sh +++ b/build_declarations.sh @@ -5,8 +5,8 @@ cd "${BASEDIR}" file_paths=( "$(pwd ~)/../../Web-Client/shared/declarations" - "$(pwd ~)/TeaSpeak/Web-Client/shared/declarations" - "$(pwd ~)/../../TeaSpeak/Web-Client/shared/declarations" +# "$(pwd ~)/TeaSpeak/Web-Client/shared/declarations" +# "$(pwd ~)/../../TeaSpeak/Web-Client/shared/declarations" "app/dummy-declarations" #TODO Windows path ) @@ -50,12 +50,36 @@ path_found=0 echo "Linking \"${path_target}/${dst_file}\" to \"${path}/${src_file}\"" cp "${path}/${src_file}" "${path_target}/copy_${dst_file}" - echo "Create copy \"${path_target}/${dst_file}\" to \"${path}/${src_file}\"" + echo "Create copy \"${path}/${src_file}\" to \"${path_target}/copy_${dst_file}\"" done break done } +if [[ ${path_found} -eq 0 ]]; then + echo "Could not import a link to shared imports. Trying copied import." + + for file in "${files[@]}" + do + file_mapping=$(echo ${file_mapping} | tr ";" "\n") + dst_file=${file_mapping[1]} + + if [[ -e "${path_target}/${dst_file}" ]] || [[ -L "${path_target}/${dst_file}" ]]; then + echo "Hmm target file already exists even thou it hasn't been found yet... Deleting it!" + rm "${path_target}/${dst_file}" + fi + + if [[ ! -e "${path_target}/copy_${dst_file}" ]]; then + echo "Missing copy of file ${dst_file} because we cant find any valid link!" + exit 1 + fi + + ln -rs "${path_target}/copy_${dst_file}" "${path_target}/${dst_file}" + echo "Linking \"${path_target}/${dst_file}\" to \"${path_target}/copy_${dst_file}\"" + done + path_found=1 +fi + if [[ path_found -eq 0 ]]; then echo "Failed to find UI imports" echo "Add your path to 'file_paths' and build the declarations first" diff --git a/jenkins/create_build.sh b/jenkins/create_build.sh index 21c471d..6aa2729 100755 --- a/jenkins/create_build.sh +++ b/jenkins/create_build.sh @@ -16,6 +16,9 @@ function install_npm() { function compile_scripts() { begin_task "${project_name}_tsc_sass" "Compiling TypeScript & SASS" + ./build_declarations.sh + check_err_exit ${project_name} "Failed to build shared ui import declarations!" + npm run compile-tsc -- -p modules/tsconfig_main.json npm run compile-tsc -- -p modules/tsconfig_renderer.json npm run compile-tsc -- -p installer/tsconfig_linux.json diff --git a/modules/tsconfig_renderer.json b/modules/tsconfig_renderer.json index 02c60b1..598c427 100644 --- a/modules/tsconfig_renderer.json +++ b/modules/tsconfig_renderer.json @@ -9,6 +9,7 @@ "./renderer", "./crash_handler", "./shared", + "./shared/imports/*.d.ts", "../native/*/exports/" ],