Skip to content

Commit

Permalink
Update build script.
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster620 committed Oct 20, 2024
1 parent 230238e commit c76f9c3
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 14 deletions.
15 changes: 11 additions & 4 deletions BuildLinuxPackages.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set FRAMEWORK=net9.0
set SELF_CONTAINED=true
set TRIM_ASSEMBLIES=true
set TESTING_MODE_BUILD=false
set PACKAGING_TOOL_PATH=PackagingTool\bin\Release\%FRAMEWORK%\CarinaStudio.ULogViewer.Packaging.dll
set ERRORLEVEL=0

echo ********** Start building %APP_NAME% **********
Expand All @@ -20,8 +21,14 @@ IF not exist Packages (
)
)

REM Build packaging tool
dotnet build --project PackagingTool -c Release -f %FRAMEWORK%
if %ERRORLEVEL% neq 0 (
exit
)

REM Get current version
dotnet run --project PackagingTool get-current-version %APP_NAME%\%APP_NAME%.csproj > Packages\Packaging.txt
dotnet %PACKAGING_TOOL_PATH% get-current-version %APP_NAME%\%APP_NAME%.csproj > Packages\Packaging.txt
if %ERRORLEVEL% neq 0 (
del /Q Packages\Packaging.txt
exit
Expand All @@ -30,7 +37,7 @@ set /p CURRENT_VERSION=<Packages\Packaging.txt
echo Version: %CURRENT_VERSION%

REM Get previous version
dotnet run --project PackagingTool get-previous-version %APP_NAME%\%APP_NAME%.csproj > Packages\Packaging.txt
dotnet %PACKAGING_TOOL_PATH% get-previous-version %APP_NAME%\%APP_NAME%.csproj > Packages\Packaging.txt
if %ERRORLEVEL% neq 0 (
del /Q Packages\Packaging.txt
exit
Expand Down Expand Up @@ -90,11 +97,11 @@ REM Build packages

REM Generate diff packages
if [%PREVIOUS_VERSION%] neq [] (
dotnet run --project PackagingTool create-diff-packages linux %PREVIOUS_VERSION% %CURRENT_VERSION%
dotnet %PACKAGING_TOOL_PATH% create-diff-packages linux %PREVIOUS_VERSION% %CURRENT_VERSION%
)

REM Generate package manifest
REM dotnet run --project PackagingTool create-package-manifest linux %APP_NAME% %CURRENT_VERSION%
REM dotnet %PACKAGING_TOOL_PATH% create-package-manifest linux %APP_NAME% %CURRENT_VERSION%

REM Complete
del /Q Packages\Packaging.txt
15 changes: 11 additions & 4 deletions BuildLinuxPackages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@ RID_LIST=("linux-x64" "linux-arm64")
CONFIG="Release"
TRIM_ASSEMBLIES="true"
TESTING_MODE_BUILD="false"
PACKAGING_TOOL_PATH="PackagingTool/bin/Release/$FRAMEWORK/CarinaStudio.ULogViewer.Packaging.dll"
echo "********** Start building $APP_NAME **********"

# Build packaging tool
dotnet build --project PackagingTool -c Release -f $FRAMEWORK
if [ "$?" != "0" ]; then
exit
fi

# Get application version
VERSION=$(dotnet run --project PackagingTool get-current-version $APP_NAME/$APP_NAME.csproj)
VERSION=$(dotnet $PACKAGING_TOOL_PATH get-current-version $APP_NAME/$APP_NAME.csproj)
if [ "$?" != "0" ]; then
echo "Unable to get version of $APP_NAME"
exit
fi
echo "Version: $VERSION"
PREV_VERSION=$(dotnet run --project PackagingTool get-previous-version $APP_NAME/$APP_NAME.csproj $VERSION)
PREV_VERSION=$(dotnet $PACKAGING_TOOL_PATH get-previous-version $APP_NAME/$APP_NAME.csproj $VERSION)
if [ ! -z "$PREV_VERSION" ]; then
echo "Previous version: $PREV_VERSION"
fi
Expand Down Expand Up @@ -62,8 +69,8 @@ done

# Generate diff packages
if [ ! -z "$PREV_VERSION" ]; then
dotnet run --project PackagingTool create-diff-packages linux $PREV_VERSION $VERSION
dotnet $PACKAGING_TOOL_PATH create-diff-packages linux $PREV_VERSION $VERSION
fi

# Generate package manifest
# dotnet run --project PackagingTool create-package-manifest linux $APP_NAME $VERSION
# dotnet $PACKAGING_TOOL_PATH create-package-manifest linux $APP_NAME $VERSION
11 changes: 9 additions & 2 deletions BuildMacOSPackages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ PUB_PLATFORM_LIST=("osx-arm64" "osx-x64")
CONFIG="Release"
TRIM_ASSEMBLIES="true"
TESTING_MODE_BUILD="false"
PACKAGING_TOOL_PATH="PackagingTool/bin/Release/$FRAMEWORK/CarinaStudio.ULogViewer.Packaging.dll"
ICON_VERSION="3"
CERT_NAME="" # Name of certification to sign the application

echo "********** Start building $APP_NAME **********"

# Build packaging tool
dotnet build --project PackagingTool -c Release -f $FRAMEWORK
if [ "$?" != "0" ]; then
exit
fi

# Get application version
VERSION=$(dotnet run --project PackagingTool get-current-version $APP_NAME/$APP_NAME.csproj)
VERSION=$(dotnet $PACKAGING_TOOL_PATH get-current-version $APP_NAME/$APP_NAME.csproj)
if [ "$?" != "0" ]; then
echo "Unable to get version of $APP_NAME"
exit
Expand Down Expand Up @@ -99,4 +106,4 @@ for i in "${!RID_LIST[@]}"; do
done

# Generate package manifest
# dotnet run --project PackagingTool create-package-manifest osx $APP_NAME $VERSION
# dotnet $PACKAGING_TOOL_PATH create-package-manifest osx $APP_NAME $VERSION
15 changes: 11 additions & 4 deletions BuildWindowsPackages.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set FRAMEWORK=net9.0
set SELF_CONTAINED=true
set TRIM_ASSEMBLIES=true
set TESTING_MODE_BUILD=false
set PACKAGING_TOOL_PATH=PackagingTool\bin\Release\%FRAMEWORK%\CarinaStudio.ULogViewer.Packaging.dll
set ERRORLEVEL=0

echo ********** Start building %APP_NAME% **********
Expand All @@ -20,8 +21,14 @@ IF not exist Packages (
)
)

REM Build packaging tool
dotnet build --project PackagingTool -c Release -f %FRAMEWORK%
if %ERRORLEVEL% neq 0 (
exit
)

REM Get current version
dotnet run --project PackagingTool get-current-version %APP_NAME%\%APP_NAME%.csproj > Packages\Packaging.txt
dotnet %PACKAGING_TOOL_PATH% get-current-version %APP_NAME%\%APP_NAME%.csproj > Packages\Packaging.txt
if %ERRORLEVEL% neq 0 (
del /Q Packages\Packaging.txt
exit
Expand All @@ -30,7 +37,7 @@ set /p CURRENT_VERSION=<Packages\Packaging.txt
echo Version: %CURRENT_VERSION%

REM Get previous version
dotnet run --project PackagingTool get-previous-version %APP_NAME%\%APP_NAME%.csproj > Packages\Packaging.txt
dotnet %PACKAGING_TOOL_PATH% get-previous-version %APP_NAME%\%APP_NAME%.csproj > Packages\Packaging.txt
if %ERRORLEVEL% neq 0 (
del /Q Packages\Packaging.txt
exit
Expand Down Expand Up @@ -81,11 +88,11 @@ REM Build packages

REM Generate diff packages
if [%PREVIOUS_VERSION%] neq [] (
dotnet run --project PackagingTool create-diff-packages win %PREVIOUS_VERSION% %CURRENT_VERSION%
dotnet %PACKAGING_TOOL_PATH% create-diff-packages win %PREVIOUS_VERSION% %CURRENT_VERSION%
)

REM Generate package manifest
REM dotnet run --project PackagingTool create-package-manifest win %APP_NAME% %CURRENT_VERSION%
REM dotnet %PACKAGING_TOOL_PATH% create-package-manifest win %APP_NAME% %CURRENT_VERSION%

REM Complete
del /Q Packages\Packaging.txt

0 comments on commit c76f9c3

Please sign in to comment.