You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by jm...@apache.org on 2016/12/06 06:27:34 UTC

[06/12] incubator-guacamole-client git commit: GUACAMOLE-136: Minify JavaScript and CSS. Add templates to Angular's cache.

GUACAMOLE-136: Minify JavaScript and CSS. Add templates to Angular's cache.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/e9e86126
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/e9e86126
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/e9e86126

Branch: refs/heads/master
Commit: e9e8612611fe017862fc25957f904d8ae34baede
Parents: f44ee1c
Author: Michael Jumper <mj...@apache.org>
Authored: Fri Dec 2 16:02:47 2016 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Mon Dec 5 22:19:45 2016 -0800

----------------------------------------------------------------------
 extensions/guacamole-auth-duo/.gitignore        |  1 +
 extensions/guacamole-auth-duo/pom.xml           | 80 ++++++++++++++++++++
 .../src/main/resources/guac-manifest.json       | 11 +--
 .../src/main/resources/license.txt              | 18 +++++
 4 files changed, 101 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/e9e86126/extensions/guacamole-auth-duo/.gitignore
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-duo/.gitignore b/extensions/guacamole-auth-duo/.gitignore
index 42f4a1a..1de9633 100644
--- a/extensions/guacamole-auth-duo/.gitignore
+++ b/extensions/guacamole-auth-duo/.gitignore
@@ -1,2 +1,3 @@
+src/main/resources/generated/
 target/
 *~

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/e9e86126/extensions/guacamole-auth-duo/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-duo/pom.xml b/extensions/guacamole-auth-duo/pom.xml
index 4c1fdf6..a55e54f 100644
--- a/extensions/guacamole-auth-duo/pom.xml
+++ b/extensions/guacamole-auth-duo/pom.xml
@@ -34,6 +34,86 @@
                 </configuration>
             </plugin>
 
+            <!-- Pre-cache Angular templates with maven-angular-plugin -->
+            <plugin>
+                <groupId>com.keithbranton.mojo</groupId>
+                <artifactId>angular-maven-plugin</artifactId>
+                <version>0.3.2</version>
+                <executions>
+                    <execution>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>html2js</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <sourceDir>${basedir}/src/main/resources</sourceDir>
+                    <include>**/*.html</include>
+                    <target>${basedir}/src/main/resources/generated/templates-main/templates.js</target>
+                    <prefix>app/ext/duo</prefix>
+                </configuration>
+            </plugin>
+
+            <!-- JS/CSS Minification Plugin -->
+            <plugin>
+                <groupId>com.samaxes.maven</groupId>
+                <artifactId>minify-maven-plugin</artifactId>
+                <version>1.7.5</version>
+                <executions>
+                    <execution>
+                        <id>default-cli</id>
+                        <configuration>
+                            <charset>UTF-8</charset>
+
+                            <webappSourceDir>${basedir}/src/main/resources</webappSourceDir>
+                            <webappTargetDir>${project.build.directory}/classes</webappTargetDir>
+
+                            <cssSourceDir>/</cssSourceDir>
+                            <cssTargetDir>/</cssTargetDir>
+                            <cssFinalFile>duo.css</cssFinalFile>
+
+                            <cssSourceFiles>
+                                <cssSourceFile>license.txt</cssSourceFile>
+                            </cssSourceFiles>
+
+                            <cssSourceIncludes>
+                                <cssSourceInclude>**/*.css</cssSourceInclude>
+                            </cssSourceIncludes>
+
+                            <jsSourceDir>/</jsSourceDir>
+                            <jsTargetDir>/</jsTargetDir>
+                            <jsFinalFile>duo.js</jsFinalFile>
+
+                            <jsSourceFiles>
+                                <jsSourceFile>license.txt</jsSourceFile>
+                                <jsSourceFile>lib/DuoWeb/LICENSE.js</jsSourceFile>
+                            </jsSourceFiles>
+
+                            <jsSourceIncludes>
+                                <jsSourceInclude>**/*.js</jsSourceInclude>
+                            </jsSourceIncludes>
+
+                            <!-- Do not minify and include tests -->
+                            <jsSourceExcludes>
+                                <jsSourceExclude>**/*.test.js</jsSourceExclude>
+                            </jsSourceExcludes>
+                            <jsEngine>CLOSURE</jsEngine>
+
+                            <!-- Disable warnings for JSDoc annotations -->
+                            <closureWarningLevels>
+                                <misplacedTypeAnnotation>OFF</misplacedTypeAnnotation>
+                                <nonStandardJsDocs>OFF</nonStandardJsDocs>
+                            </closureWarningLevels>
+
+                        </configuration>
+                        <goals>
+                            <goal>minify</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
             <!-- Copy dependencies prior to packaging -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/e9e86126/extensions/guacamole-auth-duo/src/main/resources/guac-manifest.json
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-duo/src/main/resources/guac-manifest.json b/extensions/guacamole-auth-duo/src/main/resources/guac-manifest.json
index ff8fab2..27658a8 100644
--- a/extensions/guacamole-auth-duo/src/main/resources/guac-manifest.json
+++ b/extensions/guacamole-auth-duo/src/main/resources/guac-manifest.json
@@ -14,18 +14,11 @@
     ],
 
     "js" : [
-
-        "duoModule.js",
-        "controllers/duoSignedResponseController.js",
-        "config/duoConfig.js",
-
-        "lib/DuoWeb/LICENSE.js",
-        "lib/DuoWeb/Duo-Web-v2.js"
-
+        "duo.min.js"
     ],
 
     "css" : [
-        "styles/duo.css"
+        "duo.min.css"
     ],
 
     "resources" : {

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/e9e86126/extensions/guacamole-auth-duo/src/main/resources/license.txt
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-duo/src/main/resources/license.txt b/extensions/guacamole-auth-duo/src/main/resources/license.txt
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ b/extensions/guacamole-auth-duo/src/main/resources/license.txt
@@ -0,0 +1,18 @@
+/*
+ * 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.
+ */