Permalink
Browse files

Updated to work with Microsoft Roslyn CTP June 2012 1.1

  • Loading branch information...
1 parent 33732f1 commit 2382e9648e1cd088fcf9858b150f1958f6761147 @dfinke committed Jun 9, 2012
@@ -1,11 +1,11 @@
-param(
- $roslyn = "Reference Assemblies\Microsoft\Roslyn\v1.0\Roslyn.Services.dll"
-)
-
-$dll = Join-Path $env:ProgramFiles $roslyn
-
-if(-not (Test-Path $dll)) {
- $dll = Join-Path ${env:ProgramFiles(x86)} $roslyn
-}
-
+param(
+ $roslyn = "Reference Assemblies\Microsoft\Roslyn\v1.1\Roslyn.Services.dll"
+)
+
+$dll = Join-Path $env:ProgramFiles $roslyn
+
+if(-not (Test-Path $dll)) {
+ $dll = Join-Path ${env:ProgramFiles(x86)} $roslyn
+}
+
Add-Type -Path $dll
@@ -1,9 +1,9 @@
-
-$roslyn = "Reference Assemblies\Microsoft\Roslyn\v1.0\Roslyn.Services.dll"
-$dll = Join-Path $env:ProgramFiles $roslyn
-
-if(-not (Test-Path $dll)) {
- $dll = Join-Path ${env:ProgramFiles(x86)} $roslyn
-}
-
-$dll
+
+$roslyn = "Reference Assemblies\Microsoft\Roslyn\v1.1\Roslyn.Services.dll"
+$dll = Join-Path $env:ProgramFiles $roslyn
+
+if(-not (Test-Path $dll)) {
+ $dll = Join-Path ${env:ProgramFiles(x86)} $roslyn
+}
+
+$dll
@@ -1,14 +1,12 @@
-cls
-
.\Add-RoslynLibraries
$slnFileName = Resolve-Path "..\chapter05\BeaverMusic\BeaverMusic.sln"
$result = ForEach ($Project in ([Roslyn.Services.Solution]::Load($slnFileName)).Projects) {
ForEach($Document in $Project.DocumentIds) {
New-Object PSObject -Property @{
- Filename = Split-Path $Document.FileName -leaf
- ProjectName = $Project.DisplayName
+ Filename = Split-Path $Document.UniqueName -leaf
+ ProjectName = $Project.Name
}
}
}
@@ -9,5 +9,5 @@ $FirstDocument = $FirstProject.Documents |
Select -First 1
$cancelToken = New-Object System.Threading.CancellationToken
-$Root = $FirstDocument.GetSyntaxTree($cancelToken).Root
+$Root = $FirstDocument.GetSyntaxTree($cancelToken).GetRoot($cancelToken)
$Root.Usings | Select name
View
@@ -1,16 +1,13 @@
-cls
-
.\Add-RoslynLibraries
$slnFileName = Resolve-Path "..\chapter05\BeaverMusic\BeaverMusic.sln"
-$result = ForEach ($Project in ([Roslyn.Services.Solution]::Load($slnFileName)).Projects) {
- ForEach($Document in $Project.DocumentIds) {
- New-Object PSObject -Property @{
- Filename = Split-Path $Document.FileName -leaf
- ProjectName = $Project.DisplayName
+ForEach ($Project in ([Roslyn.Services.Solution]::Load($slnFileName)).Projects) {
+
+ ForEach($Document in $Project.DocumentIds) {
+ [PSCustomObject] @{
+ Filename = Split-Path $Document.UniqueName -leaf
+ ProjectName = $Project.Name
}
}
-}
-
-$result | Format-Table -AutoSize
+}
View
@@ -1,6 +1,5 @@
-cls
-
.\Add-RoslynLibraries
+
$slnFileName = Resolve-Path "..\chapter05\BeaverMusic\BeaverMusic.sln"
-[Roslyn.Services.Solution]::Load($slnFileName)
+[Roslyn.Services.Solution]::Load($slnFileName)
@@ -1,5 +1,3 @@
-cls
-
.\Add-RoslynLibraries.ps1
$slnFileName = Resolve-Path "..\chapter05\BeaverMusic\BeaverMusic.sln"
View
@@ -2,7 +2,7 @@ $RoslynLibraries = "Roslyn.Compilers.dll", "Roslyn.Services.dll"
$RoslynLibraries |
ForEach {
- $dll = Join-Path "Reference Assemblies\Microsoft\Roslyn\v1.0" $_
+ $dll = Join-Path "Reference Assemblies\Microsoft\Roslyn\v1.1" $_
.\Add-RoslynLibraries $dll
}
@@ -17,7 +17,7 @@ function Get-SLNProject {
Process {
if( ! (Test-Path $solution) ) {
- throw "$solution not found"
+ throw "$solution not found"
}
[Roslyn.Services.Solution]::Load($solution).Projects
@@ -1,4 +1,4 @@
-$roslyn = "Reference Assemblies\Microsoft\Roslyn\v1.0\Roslyn.Services.dll"
+$roslyn = "Reference Assemblies\Microsoft\Roslyn\v1.1\Roslyn.Services.dll"
$dll = Join-Path $env:ProgramFiles $roslyn
@@ -1,4 +1,3 @@
-$dll = "C:\Program Files\Reference Assemblies\Microsoft\Roslyn\v1.0\Roslyn.Services.dll"
-Add-Type -Path $dll
-
+.\Add-RoslynLibraries.ps1
+
[Roslyn.Services.Solution] | Get-Member -Static
@@ -1,12 +1,12 @@
-.\Add-RoslynLibraries
-
-$slnFileName = Resolve-Path "..\..\C#\BeaverMusic\BeaverMusic.sln"
-
-$FirstProject = ([Roslyn.Services.Solution]::Load($slnFileName)).Projects |
- Select -First 1
-
-$FirstDocument = $FirstProject.Documents |
- Select -First 1
-
-$FirstDocument |
+.\Add-RoslynLibraries
+
+$slnFileName = Resolve-Path "..\chapter05\BeaverMusic\BeaverMusic.sln"
+
+$FirstProject = ([Roslyn.Services.Solution]::Load($slnFileName)).Projects |
+ Select -First 1
+
+$FirstDocument = $FirstProject.Documents |
+ Select -First 1
+
+$FirstDocument |
Get-Member -MemberType Method | Sort Name

0 comments on commit 2382e96

Please sign in to comment.