Skip to content

Commit

Permalink
Fixes #1155 (#1156)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll authored Sep 22, 2019
1 parent 2f8e893 commit 9fa2f8e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 20 deletions.
10 changes: 8 additions & 2 deletions src/UniversalDashboard.MaterialUI/build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
param([Switch]$Minimal)

$BuildFolder = $PSScriptRoot

$powerShellGet = Import-Module PowerShellGet -PassThru -ErrorAction Ignore
Expand All @@ -15,8 +17,12 @@ Remove-Item -Path "$BuildFolder\public" -Force -Recurse

New-Item -Path $OutputPath -ItemType Directory

& cyclonedx-bom -o materialui.bom.xml
npm install
if (-not $Minimal)
{
& cyclonedx-bom -o materialui.bom.xml
npm install
}

npm run build

Copy-Item $BuildFolder\public\*.bundle.js $OutputPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class UDCheckbox extends React.Component {

render() {
return <Checkbox
checked={this.props.checked}
checked={this.state.checked}
label={this.props.label}
id={this.props.id}
filledIn={this.props.filledIn}
Expand Down
7 changes: 6 additions & 1 deletion src/UniversalDashboard.Materialize/Tests/checkbox.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Describe "Checkbox" {
Context "OnChange" {
Set-TestDashboard {
New-UDCheckbox -Id "Test" -Label "Check me" -OnChange {
Set-TestData -Data $true
Set-TestData -Data $EventData
}
}

Expand All @@ -42,6 +42,11 @@ Describe "Checkbox" {
Start-Sleep 1

Get-TestData | should be $true

Invoke-SeClick -Element $Element -JavaScriptClick -Driver $Driver
Start-Sleep 1

Get-TestData | should be $false
}
}

Expand Down
10 changes: 8 additions & 2 deletions src/UniversalDashboard.Materialize/build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
param([Switch]$Minimal)

$BuildFolder = $PSScriptRoot

$powerShellGet = Import-Module PowerShellGet -PassThru -ErrorAction Ignore
Expand All @@ -16,8 +18,12 @@ Remove-Item -Path "$BuildFolder\public" -Force -ErrorAction SilentlyContinue -Re
New-Item -Path $OutputPath -ItemType Directory
New-Item -Path $OutputPath\Scripts -ItemType Directory

& cyclonedx-bom -o materialize.bom.xml
npm install
if (-not $Minimal)
{
& cyclonedx-bom -o materialize.bom.xml
npm install
}

npm run build

Copy-Item $BuildFolder\public\*.bundle.js $OutputPath
Expand Down
30 changes: 16 additions & 14 deletions src/build.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
param(
[ValidateSet("Debug", "Release")]
[string]$Configuration = "Debug",
[Switch]$NoHelp
[Switch]$Minimal
)

$platyPS = Import-Module platyPS -PassThru -ErrorAction Ignore
Expand All @@ -17,11 +17,12 @@ if ($powerShellGet.Version -lt ([Version]'1.6.0')) {
Import-Module PowerShellGet -Force
}

& dotnet tool install --global CycloneDX

& dotnet CycloneDX "$PSScriptRoot/UniversalDashboard.Sln" -o ".\"
if (-not $Minimal)
{
& dotnet tool install --global CycloneDX
& dotnet CycloneDX "$PSScriptRoot/UniversalDashboard.Sln" -o ".\"
}

Rename-Item "bom.xml" "dotnet.bom.xml"

& dotnet clean "$PSScriptRoot\UniversalDashboard\UniversalDashboard.csproj"
& dotnet restore "$PSScriptRoot\UniversalDashboard\UniversalDashboard.csproj"
Expand All @@ -37,13 +38,16 @@ if ((Test-Path $public)) {
Remove-Item $public -Force -Recurse
}


Push-Location "$PSScriptRoot\client"

& npm install
if (-not $Minimal)
{
& npm install
& npm install -g @cyclonedx/bom
& cyclonedx-bom -o core.bom.xml
Rename-Item "bom.xml" "dotnet.bom.xml"
}

& npm install -g @cyclonedx/bom
& cyclonedx-bom -o core.bom.xml
& npm run build
Pop-Location

Expand Down Expand Up @@ -73,7 +77,6 @@ if ((Test-Path $bomDirectory)) {

New-Item -ItemType Directory $bomDirectory


$net472 = Join-Path $outputDirectory "net472"
$netstandard20 = Join-Path $outputDirectory "netstandard2.0"
$help = Join-Path $outputDirectory "en-US"
Expand Down Expand Up @@ -119,8 +122,7 @@ Copy-Item "$PSScriptRoot\UniversalDashboard.MaterialUI\output\UniversalDashboard

. (Join-Path $PSScriptRoot 'UniversalDashboard\New-UDModuleManifest.ps1') -outputDirectory $outputDirectory

if (-not $NoHelp) {
if (-not $Minimal) {
New-ExternalHelp -Path "$PSScriptRoot\UniversalDashboard\Help" -OutputPath "$help\UniversalDashboard.Community-help.xml"
}

Get-ChildItem $PSScriptRoot -Include "*.bom.xml" -Recurse | ForEach-Object { Copy-Item $_.FullName ".\boms" }
Get-ChildItem $PSScriptRoot -Include "*.bom.xml" -Recurse | ForEach-Object { Copy-Item $_.FullName ".\boms" }
}

0 comments on commit 9fa2f8e

Please sign in to comment.