3 Commits

Author SHA1 Message Date
Sebastiaan Janssen 27f88dfb80 Fix detection of npm folder 2016-09-18 12:44:10 +02:00
Sebastiaan Janssen 252a9015dc Detect if npm is already there and don't download it again 2016-09-18 12:20:42 +02:00
Sebastiaan Janssen 166007c668 Use node 4.5 for building 2016-09-18 12:12:52 +02:00
10 changed files with 97 additions and 65 deletions
+1
View File
@@ -63,3 +63,4 @@ OurUmbraco.Site/[Aa]ssets/js/app.min.js
OurUmbraco.Site/App_Data/migrations/*.txt OurUmbraco.Site/App_Data/migrations/*.txt
OurUmbraco.Site/apidocs/ OurUmbraco.Site/apidocs/
OurUmbraco.Site/App_Data/Documentation/ OurUmbraco.Site/App_Data/Documentation/
build/tools/node*
+1 -1
View File
@@ -10,7 +10,7 @@ var gulp = require('gulp'),
imageMin = require('gulp-imagemin'), imageMin = require('gulp-imagemin'),
clean = require('gulp-clean'), clean = require('gulp-clean'),
svgmin = require('gulp-svgmin'), svgmin = require('gulp-svgmin'),
cmq = require('gulp-combine-media-queries'); cmq = require('gulp-group-css-media-queries');
rename = require('gulp-rename'); rename = require('gulp-rename');
var settings = { var settings = {
+18 -18
View File
@@ -4,25 +4,25 @@
"description": "Umbraco Our gulpjs config", "description": "Umbraco Our gulpjs config",
"main": "gulpfile.js", "main": "gulpfile.js",
"private": true, "private": true,
"dependencies": { "dependencies": {},
},
"devDependencies": { "devDependencies": {
"gulp": "3.8.x", "gulp": "^3.9.1",
"gulp-util": "2.2.x", "gulp-autoprefixer": "^3.1.0",
"gulp-watch": "0.6.x", "gulp-clean": "*",
"gulp-minify-css": "1.1.x", "gulp-concat": "^2.6.0",
"node-sass": "3.2.x", "gulp-group-css-media-queries": "^1.1.0",
"gulp-sass": "2.0.x", "gulp-imagemin": "^3.0.2",
"gulp-combine-media-queries": "0.1.x", "gulp-jshint": "^2.0.1",
"gulp-imagemin": "0.6.x", "gulp-minify-css": "^1.2.4",
"gulp-autoprefixer": "2.3.1", "gulp-rename": "*",
"gulp-uglify": "0.3.x", "gulp-sass": "^2.3.2",
"gulp-jshint": "1.6.x", "gulp-svgmin": "^1.2.2",
"gulp-concat": "2.2.x", "gulp-uglify": "^2.0.0",
"jshint-stylish": "0.2.x", "gulp-util": "^3.0.7",
"gulp-clean": "0.3.x", "gulp-watch": "^4.3.9",
"gulp-svgmin": "0.4.x", "jshint": "^2.9.2",
"gulp-rename": "1.2.x" "jshint-stylish": "^2.2.0",
"node-sass": "^3.8.0"
}, },
"scripts": { "scripts": {
"test": "gulp build --verbose" "test": "gulp build --verbose"
+1 -1
View File
@@ -1 +1 @@
<svg height="50" viewBox="0 0 50 50" width="50" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h50v50H0z"/><path fill="none" stroke="#000" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M35.89 30.054L25 40.944l-10.89-10.89M25 9v31.445"/></svg> <svg height="50" viewBox="0 0 50 50" width="50" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h50v50H0z"/><path fill="none" stroke="#000" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M35.891 30.054L25 40.943l-10.89-10.89M25 9v31.445"/></svg>

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 276 B

+1 -1
View File
@@ -1 +1 @@
<svg height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5"/></svg> <svg height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><path d="M396.6 160l19.4 20.7L256 352 96 180.7l19.3-20.7L256 310.5z"/></svg>

Before

Width:  |  Height:  |  Size: 162 B

After

Width:  |  Height:  |  Size: 163 B

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-281 286 36 30"><path fill="#98D768" d="M-267 316l8-5v-8l14-17h-36l14 17"/></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="-281 286 36 30"><path fill="#98D768" d="M-267 316l8-5v-8l14-17h-36l14 17z"/></svg>

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 131 B

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-281 286 36 30"><path fill="#191919" d="M-267 316l8-5v-8l14-17h-36l14 17"/></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="-281 286 36 30"><path fill="#191919" d="M-267 316l8-5v-8l14-17h-36l14 17z"/></svg>

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 131 B

+30 -15
View File
@@ -3,32 +3,47 @@ SETLOCAL
:: SETLOCAL is on, so changes to the path not persist to the actual user's path :: SETLOCAL is on, so changes to the path not persist to the actual user's path
SET release=%1 SET release=%1
ECHO Installing Npm NuGet Package SET toolsFolder=%CD%\tools\
SET nuGetFolder=%CD%\..\packages\
ECHO Configured packages folder: %nuGetFolder%
ECHO Current folder: %CD% ECHO Current folder: %CD%
SET nodeFileName=node-v4.5.0-win-x86.7z
SET nodeExtractFolder=%toolsFolder%node.js.450
IF NOT EXIST %nodeExtractFolder% (
ECHO Downloading node.js
powershell -Command "(New-Object Net.WebClient).DownloadFile('http://nodejs.org/dist/v4.5.0/%nodeFileName%', '%toolsFolder%\%nodeFileName%')"
ECHO Extracting node.js
%toolsFolder%\7za.exe x %toolsFolder%\%nodeFileName% -o%nodeExtractFolder% -aos > nul
)
FOR /f "delims=" %%A in ('dir %nodeExtractFolder%\node* /b') DO SET "nodePath=%nodeExtractFolder%\%%A"
SET nuGetFolder=%CD%\..\packages\
FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\"
IF [%npmPath%] == [] GOTO :installnpm
IF NOT [%npmPath%] == [] GOTO :build
:installnpm
ECHO Downloading npm
ECHO Configured packages folder: %nuGetFolder%
ECHO Installing Npm NuGet Package
%CD%\..\.nuget\NuGet.exe install Npm.js -OutputDirectory %nuGetFolder% -Verbosity quiet %CD%\..\.nuget\NuGet.exe install Npm.js -OutputDirectory %nuGetFolder% -Verbosity quiet
for /f "delims=" %%A in ('dir %nuGetFolder%node.js.* /b') do set "nodePath=%nuGetFolder%%%A\"
for /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') do set "npmPath=%nuGetFolder%%%A\tools\"
REM Ensures that we look for the just downloaded NPM, not whatever the user has installed on their machine REM Ensures that we look for the just downloaded NPM, not whatever the user has installed on their machine
path=%npmPath%;%nodePath% FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\"
GOTO :build
ECHO %path%
:build
PATH=%npmPath%;%nodePath%
SET buildFolder=%CD% SET buildFolder=%CD%
ECHO Change directory to %CD%\..\OurUmbraco.Client\ ECHO Change directory to %CD%\..\OurUmbraco.Client\
CD %CD%\..\OurUmbraco.Client\ CD %CD%\..\OurUmbraco.Client\
ECHO Do npm install and the gulp build ECHO Do npm install and the gulp build
call npm cache clean SET npm="%nodePath%\node.exe" "%npmPath%node_modules\npm\bin\npm-cli.js" %*
call npm install %npm% cache clean
call npm install -g install gulp -g --quiet %npm% install
call gulp build %npm% install -g install gulp -g
gulp build
ECHO Move back to the build folder ECHO Move back to the build folder
CD %buildFolder% CD %buildFolder%
GOTO :EOF
+30 -14
View File
@@ -3,31 +3,47 @@ SETLOCAL
:: SETLOCAL is on, so changes to the path not persist to the actual user's path :: SETLOCAL is on, so changes to the path not persist to the actual user's path
SET release=%1 SET release=%1
ECHO Installing Npm NuGet Package SET toolsFolder=%CD%\tools\
SET nuGetFolder=%CD%\..\packages\
ECHO Configured packages folder: %nuGetFolder%
ECHO Current folder: %CD% ECHO Current folder: %CD%
SET nodeFileName=node-v4.5.0-win-x86.7z
SET nodeExtractFolder=%toolsFolder%node.js.450
IF NOT EXIST %nodeExtractFolder% (
ECHO Downloading node.js
powershell -Command "(New-Object Net.WebClient).DownloadFile('http://nodejs.org/dist/v4.5.0/%nodeFileName%', '%toolsFolder%\%nodeFileName%')"
ECHO Extracting node.js
%toolsFolder%\7za.exe x %toolsFolder%\%nodeFileName% -o%nodeExtractFolder% -aos > nul
)
FOR /f "delims=" %%A in ('dir %nodeExtractFolder%\node* /b') DO SET "nodePath=%nodeExtractFolder%\%%A"
SET nuGetFolder=%CD%\..\packages\
FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\"
IF [%npmPath%] == [] GOTO :installnpm
IF NOT [%npmPath%] == [] GOTO :build
:installnpm
ECHO Downloading npm
ECHO Configured packages folder: %nuGetFolder%
ECHO Installing Npm NuGet Package
%CD%\..\.nuget\NuGet.exe install Npm.js -OutputDirectory %nuGetFolder% -Verbosity quiet %CD%\..\.nuget\NuGet.exe install Npm.js -OutputDirectory %nuGetFolder% -Verbosity quiet
for /f "delims=" %%A in ('dir %nuGetFolder%node.js.* /b') do set "nodePath=%nuGetFolder%%%A\"
for /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') do set "npmPath=%nuGetFolder%%%A\tools\"
REM Ensures that we look for the just downloaded NPM, not whatever the user has installed on their machine REM Ensures that we look for the just downloaded NPM, not whatever the user has installed on their machine
path=%npmPath%;%nodePath% FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\"
GOTO :build
ECHO %path%
:build
PATH=%npmPath%;%nodePath%
SET buildFolder=%CD% SET buildFolder=%CD%
ECHO Change directory to %CD%\..\OurUmbraco.Client\ ECHO Change directory to %CD%\..\OurUmbraco.Client\
CD %CD%\..\OurUmbraco.Client\ CD %CD%\..\OurUmbraco.Client\
ECHO Do npm install and the gulp build ECHO Do npm install and the gulp build
call npm install SET npm="%nodePath%\node.exe" "%npmPath%node_modules\npm\bin\npm-cli.js" %*
call npm install -g install gulp -g --quiet %npm% cache clean
call gulp %npm% install
%npm% install -g install gulp -g
gulp
ECHO Move back to the build folder ECHO Move back to the build folder
CD %buildFolder% CD %buildFolder%
GOTO :EOF
Binary file not shown.