From ba1f7ea745ff69ab35f54cd9365d34e320eb44c7 Mon Sep 17 00:00:00 2001 From: Jaezmien Naejara Date: Tue, 22 Dec 2020 19:12:05 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Less=20suck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.bat | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/build.bat b/build.bat index c6e9b7b..6260f98 100644 --- a/build.bat +++ b/build.bat @@ -1,35 +1,42 @@ @echo off +setlocal enabledelayedexpansion :: Build echo [Build.bat] Building FiMSharp... dotnet build FiMSharp -c Release -o bin/ + +echo. +echo. echo [Build.bat] Building FiMSharp.Javascript... dotnet build FiMSharp.Javascript -c Release -o bin/ :: Build test program (optional) -set osType=%1 -if not "%osType%"=="" ( +if not "%1"=="" ( - echo [Build.bat] Building test program... - set binDir=bin/%osType% - dotnet clean -c Release -o "%binDir%" + set FiMos=%1 + set FiMbinDir=bin/!FiMos! + + echo. + echo. + echo [Build.bat] Building test program to "!FiMbinDir!"... + dotnet clean -c Release -o "!FiMbinDir!" - set buildCommand=dotnet publish FiMSharp.Test --self-contained=true -p:PublishSingleFile=True -c Release -o "%binDir%" + set buildCommand=dotnet publish FiMSharp.Test --self-contained=true -p:PublishSingleFile=True -c Release -o "!FiMbinDir!" - if "%osType%" == "win32" ( - %buildCommand% --runtime win-x86 + if "!FiMos!" == "win32" ( + !buildCommand! --runtime win-x86 ) - if "%osType%" == "win" ( - %buildCommand% --runtime win-x64 + if "!FiMos!" == "win" ( + !buildCommand! --runtime win-x64 ) - if "%osType%" == "linux" ( - %buildCommand% --runtime linux-x64 + if "!FiMos!" == "linux" ( + !buildCommand! --runtime linux-x64 ) - if "%osType%" == "linuxarm" ( - %buildCommand% --runtime linux-arm + if "!FiMos!" == "linuxarm" ( + !buildCommand! --runtime linux-arm ) - if "%osType%" == "darwin" ( - %buildCommand% --runtime osx-x64 + if "!FiMos!" == "darwin" ( + !buildCommand! --runtime osx-x64 ) ) \ No newline at end of file