Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ebfd39a
Upgrade to .Net Core SDK 1.1.5
bergmeister Dec 1, 2017
647b40f
fix restore
bergmeister Dec 1, 2017
0e49065
use newer vs 2017 image instead of wmf5
bergmeister Dec 1, 2017
1afcaa7
do not install pester for new image because it is already installed
bergmeister Dec 1, 2017
a14aef3
replace project.json reference with new csproj in build.ps1
bergmeister Dec 1, 2017
46ba6cc
Fix problem with ressource binding
bergmeister Dec 1, 2017
0fea264
csproj xml syntax fix
bergmeister Dec 2, 2017
6312e12
install .net sdk 1.1 for legacy wmf4 image
bergmeister Dec 2, 2017
0af69ea
add missing parenthesis
bergmeister Dec 2, 2017
4b25140
use iwr instead of bitstransfer for wmf4 build due to mixed assembly …
bergmeister Dec 2, 2017
d9fb6bd
Update appveyor.yml
bergmeister Dec 2, 2017
870ecde
correct iwr syntax do downlod dotnet-install
bergmeister Dec 2, 2017
94799b3
correct syntax to install dotnet
bergmeister Dec 2, 2017
9454073
install pester for wmf 4 build
bergmeister Dec 2, 2017
17c3461
appveyor syntax fix
bergmeister Dec 2, 2017
aa5d606
PowerShellGet is not available in wmf4 -> use cinst instead
bergmeister Dec 2, 2017
9ebf1b1
use fullsemver of pester to install
bergmeister Dec 2, 2017
7c27642
add cache back to appveyor
bergmeister Dec 2, 2017
c857b61
cleanup
bergmeister Dec 2, 2017
d17f63c
restore packages automatically the first time
bergmeister Dec 2, 2017
3a11662
rename VS solutions appropriately
bergmeister Dec 2, 2017
3798d45
simplify restore to do it on the solution
bergmeister Dec 2, 2017
2294b90
update download link for .net core 1.1.5 sdk
bergmeister Dec 2, 2017
fc5f218
add pester version to readme
bergmeister Dec 2, 2017
c7c3ce1
try to see if it is possible to get rid of the old solution
bergmeister Dec 2, 2017
7edf422
try to get rid of the last call to the resource generation script
bergmeister Dec 2, 2017
2ded58d
update readme with full path to out directory
bergmeister Dec 2, 2017
ff83317
remove the remainders of the ressource generation script calls and do…
bergmeister Dec 2, 2017
d1eb2ad
csproj cleanup from the old DNX or preview days
bergmeister Dec 2, 2017
d106420
upgrade from netcore 1.1 to 2.0 (same sdk version as pwsh 6.0.1)
bergmeister Jan 20, 2018
8a0d1af
update sdk to get 2.0.5 runtime (old sdk had only 2.0.0 runtime)
bergmeister Jan 20, 2018
38d600f
update appveyor installation of sdk and readme
bergmeister Jan 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove the remainders of the ressource generation script calls and do…
…cument it
  • Loading branch information
bergmeister committed Dec 2, 2017
commit ff833175d4a92aaa241d89ebfbe56e8812d99b22
17 changes: 0 additions & 17 deletions .build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ param(
# todo remove aliases
# todo make each project have its own build script

$resourceScript = Join-Path $BuildRoot "New-StronglyTypedCsFileForResx.ps1"
$outPath = "$BuildRoot/out"
$modulePath = "$outPath/PSScriptAnalyzer"

Expand Down Expand Up @@ -109,20 +108,6 @@ function Get-TestTaskParam($project) {
}
}

function Get-ResourceTaskParam($project) {
@{
Inputs = "$project/Strings.resx"
Outputs = "$project/Strings.cs"
Data = $project
Jobs = {
Push-Location $BuildRoot
& $resourceScript $Task.Data
Pop-Location
}
Before = "$project/build"
}
}

function Add-ProjectTask([string]$project, [string]$taskName, [hashtable]$taskParams, [string]$pathPrefix = $buildRoot) {
$jobs = [scriptblock]::Create(@"
pushd $pathPrefix/$project
Expand All @@ -136,14 +121,12 @@ popd

$projects = @("engine", "rules")
$projects | ForEach-Object {
#Add-ProjectTask $_ buildResource (Get-ResourceTaskParam $_)
Add-ProjectTask $_ build (Get-BuildTaskParams $_)
Add-ProjectTask $_ restore (Get-RestoreTaskParams $_)
Add-ProjectTask $_ clean (Get-CleanTaskParams $_)
Add-ProjectTask $_ test (Get-TestTaskParam $_) "$BuildRoot/tests"
}

#task buildResource -Before build "engine/buildResource", "rules/buildResource"
task build "engine/build", "rules/build"
task restore "engine/restore", "rules/restore"
task clean "engine/clean", "rules/clean"
Expand Down
8 changes: 6 additions & 2 deletions New-StronglyTypedCsFileForResx.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
param(
<#
# This script can be used to update the *.Designer file if a *.resx ressource file has been updated.
# However, it is recommended to use Visual Studio instead for editing ressources instead since it takes of that automatically and prodcues cleaner diffs.
#>
param(
[ValidateSet("Engine","Rules")]
[string] $project
)
Expand Down Expand Up @@ -132,7 +136,7 @@ if (-not (Test-Path "$projectRoot/global.json"))
throw "Not in solution root: $projectRoot"
}
$inputFilePath = Join-Path $projectRoot "$project/Strings.resx"
$outputFilePath = Join-Path $projectRoot "$project/Strings.cs"
$outputFilePath = Join-Path $projectRoot "$project/Strings.Designer.cs"
$className = "Microsoft.Windows.PowerShell.ScriptAnalyzer"
if ($project -eq "Rules")
{
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ Exit
#### Requirements
* [.NET Core 1.1.5 SDK](https://github.com/dotnet/core/blob/master/release-notes/download-archives/1.1.5.md)
* [PlatyPS 0.5.0 or greater](https://github.com/PowerShell/platyPS)
* Optionally but recommended for development: [Visual Studio 2017](https://www.visualstudio.com/downloads/)

#### Steps
* Obtain the source
- Download the latest source code from the release page (https://github.com/PowerShell/PSScriptAnalyzer/releases) OR
- Download the latest source code from the [release page](https://github.com/PowerShell/PSScriptAnalyzer/releases) OR
- Clone the repository (needs git)
```powershell
git clone https://github.com/PowerShell/PSScriptAnalyzer
Expand All @@ -96,7 +97,8 @@ Exit
cd path/to/PSScriptAnalyzer
```
* Building
You can use either build using the `Visual Studio` solution `PSScriptAnalyzer.sln` or build for your platform as follows:

You can either build using the `Visual Studio` solution `PSScriptAnalyzer.sln` or build using `PowerShell` specifically for your platform as follows:
* Windows PowerShell version 5.0 and greater
```powershell
.\buildCoreClr.ps1 -Framework net451 -Configuration Release -Build
Expand All @@ -120,6 +122,10 @@ Import-Module .\out\PSScriptAnalyzer\PSScriptAnalyzer.psd1

To confirm installation: run `Get-ScriptAnalyzerRule` in the PowerShell console to obtain the built-in rules

* Adding/Removing resource strings

For adding/removing resource strings in the `*.resx` files, it is recommended to use `Visual Studio` since it automatically updates the strongly typed `*.Designer.cs` files. The `Visual Studio 2017 Community Edition` is free to use but should you not have/want to use `Visual Studio` then you can either manually adapt the `*.Designer.cs` files or use the `New-StronglyTypedCsFileForResx.ps1` script although the latter is discouraged since it leads to a bad diff of the `*.Designer.cs` files.

#### Tests
Pester-based ScriptAnalyzer Tests are located in `path/to/PSScriptAnalyzer/Tests` folder.

Expand Down