You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2018/01/15 05:56:20 UTC

[sling-org-apache-sling-launchpad-content] branch master updated: Incorporating the gulp into the Launchpad Content build process as per SLING-7379

This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-content.git


The following commit(s) were added to refs/heads/master by this push:
     new 0e7b2dc  Incorporating the gulp into the Launchpad Content build process as per SLING-7379
0e7b2dc is described below

commit 0e7b2dcd664fa383c3777b892d104753c636876f
Author: Dan Klco <da...@gmail.com>
AuthorDate: Mon Jan 15 00:54:04 2018 -0500

    Incorporating the gulp into the Launchpad Content build process as per SLING-7379
---
 pom.xml                                            |  69 +++++++++++++++++++++
 .../launchpad/src => frontend}/gulpfile.js         |  17 +++--
 .../launchpad/src => frontend}/package.json        |  10 +--
 .../src}/fonts/OpenSans-Bold-webfont.woff          | Bin
 .../src}/fonts/OpenSans-Light-webfont.woff         | Bin
 .../src}/fonts/OpenSans-Regular-webfont.woff       | Bin
 .../src}/fonts/OpenSans-Semibold-webfont.woff      | Bin
 .../dist => frontend/src}/img/asf-logo.svg         |   0
 .../dist => frontend/src}/img/gradient.jpg         | Bin
 .../launchpad => frontend}/src/scss/_fonts.scss    |   0
 .../launchpad => frontend}/src/scss/_grid.scss     |   0
 .../launchpad => frontend}/src/scss/form.scss      |   0
 .../launchpad => frontend}/src/scss/index.scss     |   0
 .../content/etc/clientlibs/launchpad/.gitignore    |   1 -
 .../etc/clientlibs/launchpad/dist/css/form.css     |  17 -----
 .../etc/clientlibs/launchpad/dist/css/index.css    |  17 -----
 src/main/resources/content/index.html              |   4 +-
 17 files changed, 88 insertions(+), 47 deletions(-)

diff --git a/pom.xml b/pom.xml
index 58269be..4091f83 100644
--- a/pom.xml
+++ b/pom.xml
@@ -42,9 +42,77 @@
     <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-content.git</developerConnection>
     <url>https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-launchpad-content.git</url>
   </scm>
+  
+  <properties>
+  	<frontend.target>target/frontend</frontend.target>
+  </properties>
 
   <build>
+  
     <plugins>
+    
+      <plugin>
+        <artifactId>maven-resources-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>copy-resources</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>copy-resources</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${basedir}/${frontend.target}</outputDirectory>
+              <resources>          
+                <resource>
+                  <directory>src/main/frontend</directory>
+                </resource>
+              </resources>              
+            </configuration>            
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <groupId>com.github.eirslett</groupId>
+        <artifactId>frontend-maven-plugin</artifactId>
+        <version>1.4</version>
+        <configuration>
+        	<installDirectory>${frontend.target}</installDirectory>
+        	<workingDirectory>${frontend.target}</workingDirectory>
+        </configuration>
+        <executions>
+			<execution>
+				<id>install node and npm</id>
+				<goals>
+					<goal>install-node-and-npm</goal>
+				</goals>
+				<configuration>
+					<nodeVersion>v6.11.0</nodeVersion>
+					<npmVersion>3.10.10</npmVersion>
+				</configuration>
+			</execution>
+			<execution>
+				<id>npm install</id>
+				<goals>
+					<goal>npm</goal>
+				</goals>
+				<configuration>
+					<arguments>install</arguments>
+					<workingDirectory>${frontend.target}</workingDirectory>
+					<installDirectory>${frontend.target}</installDirectory>
+				</configuration>
+			</execution>
+			<execution>
+				<id>gulp build</id>
+				<goals>
+					<goal>gulp</goal>
+				</goals>
+				<configuration>
+					<workingDirectory>${frontend.target}</workingDirectory>
+				</configuration>
+			</execution>
+		</executions>
+      </plugin>
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
@@ -53,6 +121,7 @@
           <instructions>
             <Export-Package />
             <Sling-Initial-Content>content</Sling-Initial-Content>
+            <Include-Resource>{maven-resources},${basedir}/src/main/resources,${basedir}/target/frontend/dist,</Include-Resource>
           </instructions>
         </configuration>
       </plugin>
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/src/gulpfile.js b/src/main/frontend/gulpfile.js
similarity index 80%
rename from src/main/resources/content/etc/clientlibs/launchpad/src/gulpfile.js
rename to src/main/frontend/gulpfile.js
index 7401ecd..fff545e 100755
--- a/src/main/resources/content/etc/clientlibs/launchpad/src/gulpfile.js
+++ b/src/main/frontend/gulpfile.js
@@ -17,7 +17,8 @@
 const gulp        = require('gulp');
 const sass        = require('gulp-sass');
 const header      = require('gulp-header');
-const minifyCss   = require('gulp-minify-css');
+const cleanCSS   = require('gulp-clean-css');
+var concatCss = require('gulp-concat-css');
 
 const apache2License = [
 '/*',
@@ -40,11 +41,17 @@ const apache2License = [
 ].join('\n');
 
 gulp.task('styles', function() {
-    return gulp.src('./scss/*.scss')
+    return gulp.src('./src/scss/*.scss')
         .pipe(sass().on('error', sass.logError))
-        .pipe(minifyCss())
+        .pipe(cleanCSS())
+        .pipe(concatCss('bundle.css'))
         .pipe(header(apache2License))
-        .pipe(gulp.dest('../dist/css'));
+        .pipe(gulp.dest('./dist/content/etc/clientlibs/launchpad/css'));
 });
 
-gulp.task('default', ['styles'], function() {});
\ No newline at end of file
+gulp.task('assets', function() {
+	gulp.src(['./src/{fonts,img}/**/*']).pipe(gulp.dest('./dist/content/etc/clientlibs/launchpad'));
+});
+
+
+gulp.task('default', ['styles', 'assets'], function() {});
\ No newline at end of file
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/src/package.json b/src/main/frontend/package.json
similarity index 73%
rename from src/main/resources/content/etc/clientlibs/launchpad/src/package.json
rename to src/main/frontend/package.json
index f8d5665..7d0fa4f 100644
--- a/src/main/resources/content/etc/clientlibs/launchpad/src/package.json
+++ b/src/main/frontend/package.json
@@ -8,14 +8,14 @@
   },
   "dependencies": {},
   "devDependencies": {
-    "gulp": "^3.9.0",
-    "gulp-header": "^1.8.8",
-    "gulp-minify-css": "^1.2.1",
-    "gulp-sass": "^3.0.0"
+    "gulp": "^3.9.1",
+    "gulp-concat-css": "^3.0.0",
+    "gulp-header": "^1.8.9",
+    "gulp-clean-css": "^3.9.2",
+    "gulp-sass": "^3.1.0"
   },
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1"
   },
-  "author": "Chris Millar",
   "license": "Apache-2.0"
 }
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/dist/fonts/OpenSans-Bold-webfont.woff b/src/main/frontend/src/fonts/OpenSans-Bold-webfont.woff
similarity index 100%
rename from src/main/resources/content/etc/clientlibs/launchpad/dist/fonts/OpenSans-Bold-webfont.woff
rename to src/main/frontend/src/fonts/OpenSans-Bold-webfont.woff
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/dist/fonts/OpenSans-Light-webfont.woff b/src/main/frontend/src/fonts/OpenSans-Light-webfont.woff
similarity index 100%
rename from src/main/resources/content/etc/clientlibs/launchpad/dist/fonts/OpenSans-Light-webfont.woff
rename to src/main/frontend/src/fonts/OpenSans-Light-webfont.woff
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/dist/fonts/OpenSans-Regular-webfont.woff b/src/main/frontend/src/fonts/OpenSans-Regular-webfont.woff
similarity index 100%
rename from src/main/resources/content/etc/clientlibs/launchpad/dist/fonts/OpenSans-Regular-webfont.woff
rename to src/main/frontend/src/fonts/OpenSans-Regular-webfont.woff
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/dist/fonts/OpenSans-Semibold-webfont.woff b/src/main/frontend/src/fonts/OpenSans-Semibold-webfont.woff
similarity index 100%
rename from src/main/resources/content/etc/clientlibs/launchpad/dist/fonts/OpenSans-Semibold-webfont.woff
rename to src/main/frontend/src/fonts/OpenSans-Semibold-webfont.woff
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/dist/img/asf-logo.svg b/src/main/frontend/src/img/asf-logo.svg
similarity index 100%
rename from src/main/resources/content/etc/clientlibs/launchpad/dist/img/asf-logo.svg
rename to src/main/frontend/src/img/asf-logo.svg
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/dist/img/gradient.jpg b/src/main/frontend/src/img/gradient.jpg
similarity index 100%
rename from src/main/resources/content/etc/clientlibs/launchpad/dist/img/gradient.jpg
rename to src/main/frontend/src/img/gradient.jpg
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/src/scss/_fonts.scss b/src/main/frontend/src/scss/_fonts.scss
similarity index 100%
rename from src/main/resources/content/etc/clientlibs/launchpad/src/scss/_fonts.scss
rename to src/main/frontend/src/scss/_fonts.scss
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/src/scss/_grid.scss b/src/main/frontend/src/scss/_grid.scss
similarity index 100%
rename from src/main/resources/content/etc/clientlibs/launchpad/src/scss/_grid.scss
rename to src/main/frontend/src/scss/_grid.scss
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/src/scss/form.scss b/src/main/frontend/src/scss/form.scss
similarity index 100%
rename from src/main/resources/content/etc/clientlibs/launchpad/src/scss/form.scss
rename to src/main/frontend/src/scss/form.scss
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/src/scss/index.scss b/src/main/frontend/src/scss/index.scss
similarity index 100%
rename from src/main/resources/content/etc/clientlibs/launchpad/src/scss/index.scss
rename to src/main/frontend/src/scss/index.scss
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/.gitignore b/src/main/resources/content/etc/clientlibs/launchpad/.gitignore
deleted file mode 100644
index b512c09..0000000
--- a/src/main/resources/content/etc/clientlibs/launchpad/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
\ No newline at end of file
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/dist/css/form.css b/src/main/resources/content/etc/clientlibs/launchpad/dist/css/form.css
deleted file mode 100755
index f7fdad7..0000000
--- a/src/main/resources/content/etc/clientlibs/launchpad/dist/css/form.css
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-button,input[type=submit],input[type=reset],input[type=button]{display:inline-block;padding:8px 12px;color:#fff;background-color:#00678c;border:0}button:hover,input[type=submit]:hover,input[type=reset]:hover,input[type=button]:hover{background-color:gray}input,select,textarea{border:1px solid gray;box-shadow:inset 0 .5px .5px gray;border-radius:1px;vertical-align:middle;padding:.5em .6em;margin-bottom:1em;width:40%}.error{color:red}
\ No newline at end of file
diff --git a/src/main/resources/content/etc/clientlibs/launchpad/dist/css/index.css b/src/main/resources/content/etc/clientlibs/launchpad/dist/css/index.css
deleted file mode 100755
index 9751ed9..0000000
--- a/src/main/resources/content/etc/clientlibs/launchpad/dist/css/index.css
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-body,h1{font-weight:300}.Home-Grid ul,h2,p{line-height:1.8em}@font-face{font-family:'Open Sans';src:url(../fonts/OpenSans-Light-webfont.woff) format("woff");font-weight:300;font-style:normal}@font-face{font-family:'Open Sans';src:url(../fonts/OpenSans-Regular-webfont.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:'Open Sans';src:url(../fonts/OpenSans-Semibold-webfont.woff) format("woff");font-weight:600;font-style:normal}@font-face{font-family:'Open Sans';s [...]
\ No newline at end of file
diff --git a/src/main/resources/content/index.html b/src/main/resources/content/index.html
index 8e2619c..69d923d 100755
--- a/src/main/resources/content/index.html
+++ b/src/main/resources/content/index.html
@@ -24,7 +24,7 @@
         <meta http-equiv="X-UA-Compatible" content="IE=edge">
         <meta name="viewport" content="width=device-width, initial-scale=1">
         <title>Welcome to the Apache Sling Launchpad</title>
-        <link href="/etc/clientlibs/launchpad/dist/css/index.css" rel="stylesheet">
+        <link href="/etc/clientlibs/launchpad/css/bundle.css" rel="stylesheet">
     </head>
     <body>
         <div class="Grid Fit-Medium Home-Grid">
@@ -34,7 +34,7 @@
                     <img src="sling-logo.svg" alt="Apache Sling Logo"/>
                 </a>
                 <a href="http://apache.org" target="_blank" id="asf-logo" title="Visit the Apache Software Foundation website">
-                    <img src="/etc/clientlibs/launchpad/dist/img/asf-logo.svg" alt="Apache Software Foundation Logo"/>
+                    <img src="/etc/clientlibs/launchpad/img/asf-logo.svg" alt="Apache Software Foundation Logo"/>
                 </a>
             </header>
             <div class="Cell Align-Center Main-Content">

-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].