Skip to content

Commit

Permalink
Add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
ccidral committed May 20, 2017
1 parent 849c8ed commit 2673e41
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
packages/
bin/
obj/
build/
dist/
*~
.vs/
*.user
38 changes: 38 additions & 0 deletions dist.bat
Original file line number Diff line number Diff line change
@@ -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%"
7 changes: 7 additions & 0 deletions pack.ps1
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 2673e41

Please sign in to comment.