Skip to content

Commit

Permalink
Added the packaging script
Browse files Browse the repository at this point in the history
  • Loading branch information
winseros committed Jun 3, 2020
1 parent 9a3d51c commit 2344423
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ fabric.properties

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

# packaging folder
__package/
30 changes: 30 additions & 0 deletions .tools/pack.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#Usage .tools/pack.ps1 -Version 1.0.0

Param([Parameter(Mandatory)][string]$Version)

$ScriptPath=Split-Path -Parent $MyInvocation.MyCommand.Path
$PackagePath=[System.IO.Path]::Combine($ScriptPath, "..", "__package")
$ArchivePath=Join-Path $PackagePath ("/ReSharperReportConverter-v{0}.zip" -f $Version)

$FilesToPack=@(
"_Format-Html.ps1",
"_html_transform.xslt",
"_Transform-Context.ps1",
"_Write-Console.ps1",
"LICENSE",
"make-html.ps1",
"README.MD"
"write-console.ps1"
)

for ($i = 0; $i -lt $FilesToPack.Count; $i++)
{
$FilesToPack[$i] = [System.IO.Path]::Combine($ScriptPath, "..", $FilesToPack[$i])
}

if (Test-Path $PackagePath)
{
Remove-Item -Path $PackagePath -Recurse -Force
}
New-Item -ItemType Directory -Path $PackagePath | Out-Null
Compress-Archive -DestinationPath $ArchivePath -Path $FilesToPack -CompressionLevel Optimal
40 changes: 26 additions & 14 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{
"type": "PowerShell",
"request": "launch",
"name": "make-html.ps1",
"script": "./make-html.ps1",
"name": "make-html.ps1",
"script": "./make-html.ps1",
"args": [
"-ResharperReport",
".\\example-resharper-output\\resharper-output.xml",
Expand All @@ -17,18 +17,30 @@
"-UrlFormat",
"https://github.com/winseros/GitlabTelegramChannel/tree/v1.0.1/src/{0}#L{1}"

],
"cwd": "${workspaceFolder}"
},
{
"type": "PowerShell",
"request": "launch",
"name": "write-console.ps1",
"script": "./write-console.ps1",
"args": [
"-ResharperReport",
".\\example-resharper-output\\resharper-output.xml"

],
"cwd": "${workspaceFolder}"
},
{
"type": "PowerShell",
"request": "launch",
"name": "write-console.ps1",
"script": "./write-console.ps1",
"args": [
"-ResharperReport",
".\\example-resharper-output\\resharper-output.xml"

],
"cwd": "${workspaceFolder}"
},
{
"type": "PowerShell",
"request": "launch",
"name": ".tools/pack.ps1",
"script": ".tools/pack.ps1",
"args": [
"-Version",
"1.0.0"

],
"cwd": "${workspaceFolder}"
}
Expand Down

0 comments on commit 2344423

Please sign in to comment.