Skip to content

Commit

Permalink
fixing RestCode#85 bug when generating using ps script
Browse files Browse the repository at this point in the history
  • Loading branch information
faniereynders committed Feb 25, 2016
1 parent a7f2f52 commit 6b8e597
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions WebApiProxy.Tasks/WebApiProxyCSharp.psm1
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
function WebApiProxy-Generate-CSharp() {

$project = Get-Project
$projectPath = [System.IO.Path]::GetDirectoryName($project.FullName)
$projectPath = [System.IO.Path]::GetDirectoryName($project.FullName)
$root = (Join-Path $projectPath "WebApiProxy\")
$rootSpaces = "$root"
$taskPath = ($project.Object.References | where {$_.Identity -eq 'WebApiProxy.Tasks'} | Select-Object -first 1).Path


$generateJob = Start-Job -ScriptBlock {
param($project,$projectPath,$rootSpaces)
param($project,$projectPath,$rootSpaces,$taskPath)

Add-Type -Path (Join-Path $projectPath "bin\Debug\WebApiProxy.Tasks.dll")
Add-Type -Path $taskPath


$config = [WebApiProxy.Tasks.Models.Configuration]::Load($rootSpaces);
Expand All @@ -25,11 +27,11 @@
-Value $source

# $item = $project.ProjectItems.AddFromFile($fileName)
} -ArgumentList @($project,$projectPath,$rootSpaces)
} -ArgumentList @($project,$projectPath,$rootSpaces,$taskPath)

$result = Receive-Job -Job $generateJob -Wait
Write-Host $result
Write-Host "Done."
$result = Receive-Job -Job $generateJob -Wait
Write-Host $result
Write-Host "Done."
}

Export-ModuleMember "WebApiProxy-Generate-CSharp"
Export-ModuleMember "WebApiProxy-Generate-CSharp"

0 comments on commit 6b8e597

Please sign in to comment.