Commit a33470d0 authored by Maxym Borodenko's avatar Maxym Borodenko
Browse files

Grunt with hashes

parent 989d48f9
...@@ -6,6 +6,7 @@ module.exports = function(grunt) { ...@@ -6,6 +6,7 @@ module.exports = function(grunt) {
// require('grunt-newer')(grunt); // require('grunt-newer')(grunt);
// require('time-grunt')(grunt); // require('time-grunt')(grunt);
// require('jit-grunt')(grunt); // require('jit-grunt')(grunt);
var buildNumber = grunt.option('buildNumber');
grunt.initConfig({ grunt.initConfig({
app : { app : {
...@@ -156,6 +157,7 @@ module.exports = function(grunt) { ...@@ -156,6 +157,7 @@ module.exports = function(grunt) {
src : [ src : [
'<%= app.source1 %>/js/prologue.js', '<%= app.source1 %>/js/prologue.js',
'<%= app.source1 %>/js/crophub.js', '<%= app.source1 %>/js/crophub.js',
'<%= app.source1 %>/js/browse.js',
'<%= app.source1 %>/js/epilogue.js' '<%= app.source1 %>/js/epilogue.js'
], ],
dest : '<%= app.dist1 %>/js/genesys.js' dest : '<%= app.dist1 %>/js/genesys.js'
...@@ -254,8 +256,25 @@ module.exports = function(grunt) { ...@@ -254,8 +256,25 @@ module.exports = function(grunt) {
livereload : true livereload : true
} }
} }
} },
rename : {
main : {
files : [
{ src : [ '<%= app.dist1 %>/js/all.min.js'], dest : '<%= app.dist1 %>/js/all.min.' + buildNumber + '.js' },
{ src : [ '<%= app.dist1 %>/js/libraries.min.js'], dest : '<%= app.dist1 %>/js/libraries.min.' + buildNumber + '.js' },
{ src : [ '<%= app.dist1 %>/js/libraries.js'], dest : '<%= app.dist1 %>/js/libraries.' + buildNumber + '.js' },
{ src : [ '<%= app.dist1 %>/js/genesys.js'], dest : '<%= app.dist1 %>/js/genesys.' + buildNumber + '.js' },
{ src : [ '<%= app.dist1 %>/js/genesyshighcharts.min.js'], dest : '<%= app.dist1 %>/js/genesyshighcharts.min.' + buildNumber + '.js' },
{ src : [ '<%= app.dist1 %>/styles/bootstrap.css'], dest : '<%= app.dist1 %>/styles/bootstrap.' + buildNumber + '.css' },
{ src : [ '<%= app.dist1 %>/styles/bootstrap.min.css'], dest : '<%= app.dist1 %>/styles/bootstrap.min.' + buildNumber + '.css' },
{ src : [ '<%= app.dist1 %>/styles/genesys.css'], dest : '<%= app.dist1 %>/styles/genesys.' + buildNumber + '.css' },
{ src : [ '<%= app.dist1 %>/styles/other.min.css'], dest : '<%= app.dist1 %>/styles/other.min.' + buildNumber + '.css' },
{ src : [ '<%= app.dist1 %>/styles/all.min.css'], dest : '<%= app.dist1 %>/styles/all.min.' + buildNumber + '.css' }
]
}
}
}); });
// grunt.registerTask('serve', [ 'clean', 'copy:css', 'compass:server', // grunt.registerTask('serve', [ 'clean', 'copy:css', 'compass:server',
...@@ -269,7 +288,7 @@ module.exports = function(grunt) { ...@@ -269,7 +288,7 @@ module.exports = function(grunt) {
// 'autoprefixer', 'uglify:dist' ]); // 'autoprefixer', 'uglify:dist' ]);
// grunt.registerTask('css', [ 'compass:dist', 'copy:dist', 'concat', // grunt.registerTask('css', [ 'compass:dist', 'copy:dist', 'concat',
// 'autoprefixer', 'cssmin' ]); // 'autoprefixer', 'cssmin' ]);
grunt.registerTask('build', [ 'build1' ]); grunt.registerTask('build', [ 'build1', 'rename' ]);
grunt.registerTask('default', [ 'build' ]); grunt.registerTask('default', [ 'build' ]);
// Start web server // Start web server
......
...@@ -674,7 +674,7 @@ ...@@ -674,7 +674,7 @@
</goals> </goals>
<phase>generate-resources</phase> <phase>generate-resources</phase>
<configuration> <configuration>
<arguments>build --no-color</arguments> <arguments>build --no-color --buildNumber=${buildNumber}</arguments>
<srcdir>${basedir}/src/main/sourceapp</srcdir> <srcdir>${basedir}/src/main/sourceapp</srcdir>
<outputdir>${basedir}/src/main/webapp/html</outputdir> <outputdir>${basedir}/src/main/webapp/html</outputdir>
<triggerfiles> <triggerfiles>
......
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
<c:choose> <c:choose>
<c:when test="${requestContext.theme.name eq 'one'}"> <c:when test="${requestContext.theme.name eq 'one'}">
<link href="<c:url value="${cdnServers.next}/html/1/styles/all.min.css" />" type="text/css" rel="stylesheet" /> <link href="<c:url value="${cdnServers.next}/html/1/styles/all.min.${buildRevision}.css" />" type="text/css" rel="stylesheet" />
</c:when> </c:when>
<c:when test="${requestContext.theme.name eq 'all'}"> <c:when test="${requestContext.theme.name eq 'all'}">
<link href="<c:url value="${cdnServers.next}/html/1/styles/bootstrap.min.css" />" type="text/css" rel="stylesheet" /> <link href="<c:url value="${cdnServers.next}/html/1/styles/bootstrap.min.${buildRevision}.css" />" type="text/css" rel="stylesheet" />
<link href="<c:url value="${cdnServers.next}/html/1/styles/other.min.css" />" type="text/css" rel="stylesheet" /> <link href="<c:url value="${cdnServers.next}/html/1/styles/other.min.${buildRevision}.css" />" type="text/css" rel="stylesheet" />
<link href="<c:url value="${cdnServers.next}/html/1/styles/genesys.css" />" type="text/css" rel="stylesheet" /> <link href="<c:url value="${cdnServers.next}/html/1/styles/genesys.${buildRevision}.css" />" type="text/css" rel="stylesheet" />
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<link href="<c:url value="${cdnServers.next}/html/1/styles/bootstrap.css" />" type="text/css" rel="stylesheet" /> <link href="<c:url value="${cdnServers.next}/html/1/styles/bootstrap.${buildRevision}.css" />" type="text/css" rel="stylesheet" />
<link href="<c:url value="${cdnServers.next}/html/1/styles/other.min.css" />" type="text/css" rel="stylesheet" /> <link href="<c:url value="${cdnServers.next}/html/1/styles/other.min.${buildRevision}.css" />" type="text/css" rel="stylesheet" />
<link href="<c:url value="${cdnServers.next}/html/1/styles/genesys.css" />" type="text/css" rel="stylesheet" /> <link href="<c:url value="${cdnServers.next}/html/1/styles/genesys.${buildRevision}.css" />" type="text/css" rel="stylesheet" />
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
...@@ -60,15 +60,15 @@ ...@@ -60,15 +60,15 @@
<%-- Placed at the end of the document so the pages load faster --%> <%-- Placed at the end of the document so the pages load faster --%>
<c:choose> <c:choose>
<c:when test="${requestContext.theme.name eq 'one'}"> <c:when test="${requestContext.theme.name eq 'one'}">
<script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/all.min.js" />"></script> <script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/all.min.${buildRevision}.js" />"></script>
</c:when> </c:when>
<c:when test="${requestContext.theme.name eq 'all'}"> <c:when test="${requestContext.theme.name eq 'all'}">
<script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/libraries.min.js" />"></script> <script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/libraries.min.${buildRevision}.js" />"></script>
<script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/genesys.js" />"></script> <script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/genesys.${buildRevision}.js" />"></script>
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/libraries.js" />"></script> <script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/libraries.${buildRevision}.js" />"></script>
<script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/genesys.js" />"></script> <script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/genesys.${buildRevision}.js" />"></script>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
<html> <html>
<head> <head>
<title><spring:message code="accession.page.data.title"/></title> <title><spring:message code="accession.page.data.title"/></title>
<script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/browse.js" />"></script>
<script type="text/javascript" src="<c:url value="/explore/i18n.js"/>"></script> <script type="text/javascript" src="<c:url value="/explore/i18n.js"/>"></script>
</head> </head>
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
<html> <html>
<head> <head>
<title><spring:message code="maps.accession-map"/></title> <title><spring:message code="maps.accession-map"/></title>
<script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/browse.js" />"></script>
<script type="text/javascript" src="<c:url value="/explore/i18n.js"/>"></script> <script type="text/javascript" src="<c:url value="/explore/i18n.js"/>"></script>
</head> </head>
<body class="map-page overview-page explore-page"> <body class="map-page overview-page explore-page">
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
<html> <html>
<head> <head>
<title><spring:message code="data-overview"/></title> <title><spring:message code="data-overview"/></title>
<script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/browse.js" />"></script>
<script type="text/javascript" src="<c:url value="/explore/i18n.js"/>"></script> <script type="text/javascript" src="<c:url value="/explore/i18n.js"/>"></script>
</head> </head>
<body class="overview-page explore-page"> <body class="overview-page explore-page">
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<div id="container" style="min-height: 500px; min-width: 310px; margin: 0 auto"></div> <div id="container" style="min-height: 500px; min-width: 310px; margin: 0 auto"></div>
<content tag="javascript"> <content tag="javascript">
<script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/genesyshighcharts.min.js" />"></script> <script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/genesyshighcharts.min.${buildRevision}.js" />"></script>
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
'use strict'; 'use strict';
......
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
}); });
</script> </script>
<script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/genesyshighcharts.min.js" />"></script> <script type="text/javascript" src="<c:url value="${cdnServers.next}/html/1/js/genesyshighcharts.min.${buildRevision}.js" />"></script>
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
'use strict'; 'use strict';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment