Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
und - Update build system to use ZIP
Browse files Browse the repository at this point in the history
  • Loading branch information
AptiviCEO committed Oct 29, 2023
1 parent b3a5fe9 commit 51e3b99
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions tools/docgen-pack.cmd
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@echo off

REM This script builds KS documentation and packs the artifacts. Use when you have VS installed.
for /f "tokens=* USEBACKQ" %%f in (`type version`) do set version=%%f
for /f "tokens=* USEBACKQ" %%f in (`type version`) do set ksversion=%%f

:pack
echo Packing documentation...
"%ProgramFiles%\WinRAR\rar.exe" a -ep1 -r -m5 %temp%/%version%-doc.rar "..\docs\"
"%ProgramFiles%\7-Zip\7z.exe" a -tzip %temp%/%ksversion%-doc.zip "..\docs\*"
if %errorlevel% == 0 goto :finalize
echo There was an error trying to pack documentation (%errorlevel%).
goto :finished
Expand All @@ -14,7 +14,7 @@ goto :finished
rmdir /S /Q "..\DocGen\api\"
rmdir /S /Q "..\DocGen\obj\"
rmdir /S /Q "..\docs\"
move %temp%\%version%-doc.rar
move %temp%\%ksversion%-doc.zip
echo Build and pack successful.
goto :finished

Expand Down
14 changes: 7 additions & 7 deletions tools/docgen-pack.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#!/bin/bash

# This script builds and packs the artifacts. Use when you have MSBuild installed.
version=$(cat version)
# This script builds KS and packs the artifacts. Use when you have MSBuild installed.
ksversion=$(cat version)

# Check for dependencies
rarpath=`which rar`
zippath=`which zip`
if [ ! $? == 0 ]; then
echo rar is not found.
echo zip is not found.
exit 1
fi

# Pack documentation
echo Packing documentation...
"$rarpath" a -ep1 -r -m5 /tmp/$version-doc.rar "../docs/"
cd "../docs/" && "$zippath" -r /tmp/$ksversion-doc.zip . && cd -
if [ ! $? == 0 ]; then
echo Packing using rar failed.
echo Packing failed.
exit 1
fi

# Inform success
rm -rf "../DocGen/api"
rm -rf "../DocGen/obj"
rm -rf "../docs"
mv /tmp/$version-doc.rar .
mv /tmp/$ksversion-doc.zip .
echo Pack successful.
exit 0
8 changes: 4 additions & 4 deletions tools/pack.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ if "%releaseconfig%" == "" set releaseconfig=Release

:packbin
echo Packing binary...
"%ProgramFiles%\WinRAR\rar.exe" a -ep1 -r -m5 %temp%/%version%-bin.rar "..\Inxi.NET.Bin\netstandard2.0\"
"%ProgramFiles%\WinRAR\rar.exe" a -ep1 -r -m5 %temp%/%version%-demo.rar "..\Inxi.NET.ConsoleTest.Bin\net6.0\"
"%ProgramFiles%\7-Zip\7z.exe" a -tzip %temp%/%version%-bin.zip "..\Inxi.NET.Bin\netstandard2.0\*"
"%ProgramFiles%\7-Zip\7z.exe" a -tzip %temp%/%version%-demo.zip "..\Inxi.NET.ConsoleTest.Bin\net6.0\*"
if %errorlevel% == 0 goto :complete
echo There was an error trying to pack binary (%errorlevel%).
goto :finished

:complete
move %temp%\%version%-bin.rar
move %temp%\%version%-demo.rar
move %temp%\%version%-bin.zip
move %temp%\%version%-demo.zip

echo Pack successful.
:finished
14 changes: 7 additions & 7 deletions tools/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ if [ -z $releaseconf ]; then
fi

# Check for dependencies
rarpath=`which rar`
zippath=`which zip`
if [ ! $? == 0 ]; then
echo rar is not found.
echo zip is not found.
exit 1
fi

# Pack binary
echo Packing binary...
"$rarpath" a -ep1 -r -m5 /tmp/$version-bin.rar "../Inxi.NET.Bin/netstandard2.0/"
"$rarpath" a -ep1 -r -m5 /tmp/$version-demo.rar "../Inxi.NET.ConsoleTest.Bin/net6.0/"
cd "../Inxi.NET.Bin/netstandard2.0/" && "$zippath" -r /tmp/$version-bin.zip . && cd -
cd "../Inxi.NET.ConsoleTest.Bin/net6.0/" && "$zippath" -r /tmp/$version-demo.zip . && cd -
if [ ! $? == 0 ]; then
echo Packing using rar failed.
echo Packing using zip failed.
exit 1
fi

# Inform success
mv ~/tmp/$version-bin.rar .
mv ~/tmp/$version-demo.rar .
mv ~/tmp/$version-bin.zip .
mv ~/tmp/$version-demo.zip .
echo Build and pack successful.
exit 0

0 comments on commit 51e3b99

Please sign in to comment.