Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using npx for running gulp #3938

Merged
merged 7 commits into from
Dec 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
72 changes: 34 additions & 38 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,44 +92,40 @@
# so we have to take care of it else they'll bubble and kill the build
if ($error.Count -gt 0) { return }

Push-Location "$($this.SolutionRoot)\src\Umbraco.Web.UI.Client"
Write-Output "" > $log

Write-Output "### node version is:" > $log
&node -v >> $log 2>&1
if (-not $?) { throw "Failed to report node version." }

Write-Output "### npm version is:" >> $log 2>&1
&npm -v >> $log 2>&1
if (-not $?) { throw "Failed to report npm version." }

Write-Output "### clean npm cache" >> $log 2>&1
&npm cache clean --force >> $log 2>&1
$error.Clear() # that one can fail 'cos security bug - ignore

Write-Output "### npm install" >> $log 2>&1
&npm install >> $log 2>&1
Write-Output ">> $? $($error.Count)" >> $log 2>&1

Write-Output "### install gulp" >> $log 2>&1
&npm install -g gulp >> $log 2>&1
$error.Clear() # that one fails 'cos deprecated stuff - ignore

Write-Output "### install gulp-cli" >> $log 2>&1
&npm install -g gulp-cli --quiet >> $log 2>&1
$error.Clear() # that one fails 'cos some files not being removed - ignore

Write-Output "### gulp build for version $($this.Version.Release)" >> $log 2>&1
&gulp build --buildversion=$this.Version.Release >> $log 2>&1
if (-not $?) { throw "Failed to build" } # that one is expected to work

Pop-Location

# fixme - should we filter the log to find errors?
#get-content .\build.tmp\belle.log | %{ if ($_ -match "build") { write $_}}

# restore
$this.RestoreNode()
try {
Push-Location "$($this.SolutionRoot)\src\Umbraco.Web.UI.Client"
Write-Output "" > $log

Write-Output "### node version is:" > $log
node -v >> $log 2>&1
if (-not $?) { throw "Failed to report node version." }

Write-Output "### npm version is:" >> $log 2>&1
npm -v >> $log 2>&1
if (-not $?) { throw "Failed to report npm version." }

Write-Output "### clean npm cache" >> $log 2>&1
npm cache clean --force >> $log 2>&1
$error.Clear() # that one can fail 'cos security bug - ignore

Write-Output "### npm install" >> $log 2>&1
npm install >> $log 2>&1
Write-Output ">> $? $($error.Count)" >> $log 2>&1
# Don't really care about the messages from npm install making us think there are errors
$error.Clear()

Write-Output "### gulp build for version $($this.Version.Release)" >> $log 2>&1
npx gulp build --buildversion=$this.Version.Release >> $log 2>&1
if (-not $?) { throw "Failed to build" } # that one is expected to work
} finally {
Pop-Location

# fixme - should we filter the log to find errors?
#get-content .\build.tmp\belle.log | %{ if ($_ -match "build") { write $_}}

# restore
$this.RestoreNode()
}

# setting node_modules folder to hidden
# used to prevent VS13 from crashing on it while loading the websites project
Expand Down
Loading