-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
root: added DOTNET's nupkg implementations
Since DOTNET's nupkg is quite simple to create and to upstream, it's best we support it from the start. Besides, the Chocolatey is one of the nupkg implementations so no worries. This patch adds DOTNET's nupkg implementations in root repository. Co-authored-by: Shuralyov, Jean <[email protected]> Co-authored-by: Galyna, Cory <[email protected]> Co-authored-by: (Holloway) Chew, Kean Ho <[email protected]> Signed-off-by: (Holloway) Chew, Kean Ho <[email protected]>
- Loading branch information
1 parent
288912c
commit 6f297f7
Showing
228 changed files
with
19,514 additions
and
4,673 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
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,131 @@ | ||
#!/bin/sh | ||
# Copyright 2023 (Holloway) Chew, Kean Ho <[email protected]> | ||
# | ||
# 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. | ||
|
||
|
||
|
||
|
||
# initialize | ||
if [ "$PROJECT_PATH_ROOT" = "" ]; then | ||
>&2 printf "[ ERROR ] - Please run from automataCI/ci.sh.ps1 instead!\n" | ||
return 1 | ||
fi | ||
|
||
. "${LIBS_AUTOMATACI}/services/hestiaCONSOLE/Vanilla.sh.ps1" | ||
. "${LIBS_AUTOMATACI}/services/hestiaFS/Vanilla.sh.ps1" | ||
. "${LIBS_AUTOMATACI}/services/hestiaKERNEL/Vanilla.sh.ps1" | ||
. "${LIBS_AUTOMATACI}/services/hestiaNPM/Vanilla.sh.ps1" | ||
. "${LIBS_AUTOMATACI}/services/hestiaRUST/Vanilla.sh.ps1" | ||
. "${LIBS_AUTOMATACI}/services/hestiaTAR/Vanilla.sh.ps1" | ||
. "${LIBS_AUTOMATACI}/services/hestiaWASM/Vanilla.sh.ps1" | ||
. "${LIBS_AUTOMATACI}/services/hestiaZIP/Vanilla.sh.ps1" | ||
|
||
|
||
|
||
|
||
PACKAGE_Assemble_As_ARCHIVE() { | ||
_target="$1" | ||
_directory="$2" | ||
_target_name="$3" | ||
_target_os="$4" | ||
_target_arch="$5" | ||
|
||
|
||
# determine unpack destination | ||
if [ $(hestiaFS_Is_Filename_Has "$_target" "-docs") -eq $hestiaKERNEL_ERROR_OK ]; then | ||
__dest="${_directory}/docs" | ||
elif [ $(hestiaFS_Is_Filename_Has "$_target" "-lib") -eq $hestiaKERNEL_ERROR_OK ] || | ||
[ $(hestiaFS_Is_Filename_Has "$_target" "lib") -eq $hestiaKERNEL_ERROR_OK ]; then | ||
__dest="${_directory}/lib" | ||
|
||
if [ $(hestiaNPM_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ] || | ||
[ $(hestiaRUST_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then | ||
__dest="$_directory" # distribution oriented libraries | ||
fi | ||
elif [ $(hestiaWASM_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then | ||
__dest="${_directory}/assets" | ||
else | ||
__dest="${_directory}/bin" | ||
if [ $(hestiaTAR_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ] || | ||
[ $(hestiaZIP_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then | ||
__dest="$_directory" | ||
fi | ||
fi | ||
|
||
|
||
# assemble based on target's nature | ||
if [ $(hestiaTAR_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then | ||
# unpack tar* | ||
hestiaCONSOLE_Log_Assemble "$__dest" "$_target" | ||
hestiaFS_Create_Directory "$__dest" | ||
hestiaTAR_Unpack "$__dest" "$_target" | ||
if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then | ||
hestiaCONSOLE_Log_Assemble_Failed | ||
return $hestiaKERNEL_ERROR_BAD_EXEC | ||
fi | ||
elif [ $(hestiaZIP_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then | ||
# unpack zip | ||
hestiaCONSOLE_Log_Assemble "$__dest" "$_target" | ||
hestiaFS_Create_Directory "$__dest" | ||
hestiaZIP_Unpack "$__dest" "$_target" | ||
if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then | ||
hestiaCONSOLE_Log_Assemble_Failed | ||
return $hestiaKERNEL_ERROR_BAD_EXEC | ||
fi | ||
else | ||
# assemble standalone file | ||
___filename="$(hestiaFS_Get_File "$_target")" | ||
if [ "$__dest" = "${_directory}/bin" ]; then | ||
___filename="${PROJECT_SKU}" | ||
if [ "$_target_os" = "windows" ]; then | ||
___filename="${___filename}.exe" | ||
fi | ||
fi | ||
|
||
hestiaCONSOLE_Log_Assemble "${__dest}/${___filename}" "$_target" | ||
hestiaFS_Create_Directory "$__dest" | ||
hestiaFS_Copy_File "${__dest}/${___filename}" "$_target" | ||
if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then | ||
hestiaCONSOLE_Log_Assemble_Failed | ||
return $hestiaKERNEL_ERROR_BAD_EXEC | ||
fi | ||
|
||
# if it is WASM artifact, then check for its gluing js script | ||
# whenever available. | ||
if [ $(hestiaWASM_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then | ||
__source="$(hestiaFS_Replace_Extension "$_target" ".wasm" ".js")" | ||
if [ $(hestiaFS_Is_File "$__source") -eq $hestiaKERNEL_ERROR_OK ]; then | ||
__dest="${__dest}/$(hestiaFS_Get_File "$__source")" | ||
hestiaCONSOLE_Log_Assemble "$__dest" "$_target" | ||
hestiaFS_Copy_File \ | ||
"${__dest}/$(hestiaFS_Get_File "$_target")" \ | ||
"$_target" | ||
if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then | ||
hestiaCONSOLE_Log_Assemble_Failed | ||
return $hestiaKERNEL_ERROR_BAD_EXEC | ||
fi | ||
fi | ||
fi | ||
fi | ||
|
||
|
||
# sanitize check before proceeding | ||
hestiaCONSOLE_Log_Check "$_directory" | ||
if [ $(hestiaFS_Is_Directory_Empty "$_directory") -eq 0 ]; then | ||
hestiaCONSOLE_Log_Check_Failed | ||
return $hestiaKERNEL_ERROR_BAD_EXEC | ||
fi | ||
|
||
|
||
# report status | ||
return $hestiaKERNEL_ERROR_OK | ||
} |
Oops, something went wrong.