Better gulp runner

This commit is contained in:
Sebastiaan Janssen
2017-06-04 12:05:57 +02:00
parent 8c6f03f257
commit 2fcd7f3911
5 changed files with 43 additions and 29 deletions
+1
View File
@@ -66,3 +66,4 @@ OurUmbraco.Site/App_Data/Documentation/
OurUmbraco.Site/App_Data/NotificationTest/ OurUmbraco.Site/App_Data/NotificationTest/
build/tools/node* build/tools/node*
wwwcache/ wwwcache/
build/toolsnode.js.*/
+14 -14
View File
@@ -4,24 +4,24 @@
"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.9.1", "gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-clean": "0.3.x",
"gulp-combine-media-queries": "0.2.x",
"gulp-concat": "2.2.x",
"gulp-imagemin": "0.6.x",
"gulp-jshint": "^2.0.4",
"gulp-minify-css": "1.1.x",
"gulp-rename": "1.2.x",
"gulp-sass": "^2.2.0",
"gulp-svgmin": "0.4.x",
"gulp-uglify": "^1.5.3",
"gulp-util": "3.0.x", "gulp-util": "3.0.x",
"gulp-watch": "0.6.x", "gulp-watch": "0.6.x",
"gulp-minify-css": "1.1.x", "jshint": "^2.9.4",
"gulp-sass": "^2.2.0", "jshint-stylish": "0.2.x"
"gulp-combine-media-queries": "0.2.x",
"gulp-imagemin": "0.6.x",
"gulp-autoprefixer": "^3.1.0",
"gulp-uglify": "^1.5.3",
"gulp-jshint": "2.0.0",
"gulp-concat": "2.2.x",
"jshint-stylish": "0.2.x",
"gulp-clean": "0.3.x",
"gulp-svgmin": "0.4.x",
"gulp-rename": "1.2.x"
}, },
"scripts": { "scripts": {
"test": "gulp build --verbose" "test": "gulp build --verbose"
@@ -10,7 +10,7 @@ NOTES:
* Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config * Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config
* A new version will invalidate both client and server cache and create new persisted files * A new version will invalidate both client and server cache and create new persisted files
--> -->
<clientDependency version="463511010" fileDependencyExtensions=".js,.css" loggerType="Umbraco.Web.UI.CdfLogger, umbraco"> <clientDependency version="49321111" fileDependencyExtensions=".js,.css" loggerType="Umbraco.Web.UI.CdfLogger, umbraco">
<!-- <!--
This section is used for Web Forms only, the enableCompositeFiles="true" is optional and by default is set to true. This section is used for Web Forms only, the enableCompositeFiles="true" is optional and by default is set to true.
+27 -14
View File
@@ -1,11 +1,16 @@
@ECHO OFF @ECHO OFF
SETLOCAL SETLOCAL
:: SETLOCAL is on, so changes to the path not persist to the actual user's path
SET release=%1 SET release=%1
SET toolsFolder=%CD%\tools\ ECHO Installing Npm NuGet Package
SET nuGetFolder=%CD%\..\packages\
ECHO Configured packages folder: %nuGetFolder%
ECHO Current folder: %CD% ECHO Current folder: %CD%
%CD%\tools\nuget.exe install Npm.js -OutputDirectory %nuGetFolder% -Verbosity quiet
SET toolsFolder=%CD%\tools
SET nodeFileName=node-v4.5.0-win-x86.7z SET nodeFileName=node-v4.5.0-win-x86.7z
SET nodeExtractFolder=%toolsFolder%node.js.450 SET nodeExtractFolder=%toolsFolder%node.js.450
IF NOT EXIST %nodeExtractFolder% ( IF NOT EXIST %nodeExtractFolder% (
@@ -16,10 +21,21 @@ IF NOT EXIST %nodeExtractFolder% (
) )
FOR /f "delims=" %%A in ('dir %nodeExtractFolder%\node* /b') DO SET "nodePath=%nodeExtractFolder%\%%A" FOR /f "delims=" %%A in ('dir %nodeExtractFolder%\node* /b') DO SET "nodePath=%nodeExtractFolder%\%%A"
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\"
ECHO Adding Npm and Node to path
REM SETLOCAL is on, so changes to the path not persist to the actual user's path
PATH=%npmPath%;%nodePath%;%PATH%
SET buildFolder=%CD%
ECHO Change directory to %CD%\..\OurUmbraco.Client\
CD %CD%\..\OurUmbraco.Client\
SET nuGetFolder=%CD%\..\packages\ SET nuGetFolder=%CD%\..\packages\
FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\" FOR /f "delims=" %%A in ('dir %nuGetFolder%npm.js.* /b') DO SET "npmPath=%nuGetFolder%%%A\tools\"
IF [%npmPath%] == [] GOTO :installnpm IF [%npmPath%] == [] GOTO :installnpm
IF NOT [%npmPath%] == [] GOTO :build
:installnpm :installnpm
ECHO Downloading npm ECHO Downloading npm
@@ -31,19 +47,16 @@ IF NOT [%npmPath%] == [] GOTO :build
GOTO :build GOTO :build
:build :build
ECHO Gulp build the client side files
PATH=%npmPath%;%nodePath% PATH=%npmPath%;%nodePath%
SET buildFolder=%CD%
ECHO Change directory to %CD%\..\OurUmbraco.Client\
CD %CD%\..\OurUmbraco.Client\
ECHO Do npm install and the gulp build
SET npm="%nodePath%\node.exe" "%npmPath%node_modules\npm\bin\npm-cli.js" %* SET npm="%nodePath%\node.exe" "%npmPath%node_modules\npm\bin\npm-cli.js" %*
%npm% cache clean
%npm% install %npm% install
%npm% install --save-dev jshint gulp-jshint
%npm% install -g install gulp -g %npm% install -g install gulp -g
gulp gulp build
ECHO Move back to the build folder ECHO Move back to the build folder
CD %buildFolder% CD %buildFolder%
GOTO :EOF
Binary file not shown.