From 2673e4195ca237fa74315b46721dd4b3c000c878 Mon Sep 17 00:00:00 2001 From: Celio Cidral Jr Date: Sat, 20 May 2017 15:08:21 -0300 Subject: [PATCH] Add build script --- .gitignore | 2 ++ dist.bat | 38 ++++++++++++++++++++++++++++++++++++++ pack.ps1 | 7 +++++++ 3 files changed, 47 insertions(+) create mode 100644 dist.bat create mode 100644 pack.ps1 diff --git a/.gitignore b/.gitignore index a29ff7c..e00e7ae 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ packages/ bin/ obj/ +build/ +dist/ *~ .vs/ *.user diff --git a/dist.bat b/dist.bat new file mode 100644 index 0000000..7fbc4a2 --- /dev/null +++ b/dist.bat @@ -0,0 +1,38 @@ +@echo off + +REM msbuild Tomighty.sln /t:rebuild /p:Configuration=Release + +for /f %%i in ('git rev-parse --abbrev-ref HEAD') do set version=%%i + +set dirname=tomighty-windows-%version% +set zipfile=dist\%dirname%.zip +set src=Tomighty.Windows\bin\Release +set dest=build\%dirname% + +IF NOT EXIST build ( + mkdir build +) + +IF NOT EXIST dist ( + mkdir dist +) + +IF EXIST %dest% ( + rmdir %dest% /S /Q +) + +if exist %zipfile% ( + del %zipfile% +) + +mkdir %dest%\Resources + +copy LICENSE.txt %dest% +copy NOTICE.txt %dest% +copy %src%\Tomighty.Windows.exe %dest% +copy %src%\Tomighty.Core.dll %dest% +copy %src%\Newtonsoft.Json.dll %dest% +copy %src%\Microsoft.Toolkit.Uwp.Notifications.dll %dest% +xcopy /s %src%\Resources %dest%\Resources + +powershell -executionpolicy bypass -file pack.ps1 "%dest%" "%zipfile%" diff --git a/pack.ps1 b/pack.ps1 new file mode 100644 index 0000000..cb8ea79 --- /dev/null +++ b/pack.ps1 @@ -0,0 +1,7 @@ +param ( + [string]$directory, + [string]$name +) + +Add-Type -Assembly System.IO.Compression.FileSystem +[System.IO.Compression.ZipFile]::CreateFromDirectory($directory, $name, [System.IO.Compression.CompressionLevel]::Optimal, $false) \ No newline at end of file