Commit a33470d0 authored by Maxym Borodenko's avatar Maxym Borodenko

Grunt with hashes

parent 989d48f9
......@@ -6,6 +6,7 @@ module.exports = function(grunt) {
// require('grunt-newer')(grunt);
// require('time-grunt')(grunt);
// require('jit-grunt')(grunt);
var buildNumber = grunt.option('buildNumber');
grunt.initConfig({
app : {
......@@ -156,6 +157,7 @@ module.exports = function(grunt) {
src : [
'<%= app.source1 %>/js/prologue.js',
'<%= app.source1 %>/js/crophub.js',
'<%= app.source1 %>/js/browse.js',
'<%= app.source1 %>/js/epilogue.js'
],
dest : '<%= app.dist1 %>/js/genesys.js'
......@@ -254,8 +256,25 @@ module.exports = function(grunt) {
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',
......@@ -269,7 +288,7 @@ module.exports = function(grunt) {
// 'autoprefixer', 'uglify:dist' ]);
// grunt.registerTask('css', [ 'compass:dist', 'copy:dist', 'concat',
// 'autoprefixer', 'cssmin' ]);
grunt.registerTask('build', [ 'build1' ]);
grunt.registerTask('build', [ 'build1', 'rename' ]);
grunt.registerTask('default', [ 'build' ]);
// Start web server
......
......@@ -674,7 +674,7 @@
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>build --no-color</arguments>
<arguments>build --no-color --buildNumber=${buildNumber}</arguments>
<srcdir>${basedir}/src/main/sourceapp</srcdir>
<outputdir>${basedir}/src/main/webapp/html</outputdir>
<triggerfiles>
......
......@@ -2,16 +2,16 @@
<c:choose>
<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 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/other.min.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/bootstrap.min.${buildRevision}.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.${buildRevision}.css" />" type="text/css" rel="stylesheet" />
</c:when>
<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/other.min.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/bootstrap.${buildRevision}.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.${buildRevision}.css" />" type="text/css" rel="stylesheet" />
</c:otherwise>
</c:choose>
......@@ -60,15 +60,15 @@
<%-- Placed at the end of the document so the pages load faster --%>
<c:choose>
<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 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/genesys.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.${buildRevision}.js" />"></script>
</c:when>
<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/genesys.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.${buildRevision}.js" />"></script>
</c:otherwise>
</c:choose>
......
......@@ -13,7 +13,6 @@
<html>
<head>
<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>
</head>
......
......@@ -5,7 +5,6 @@
<html>
<head>
<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>
</head>
<body class="map-page overview-page explore-page">
......
......@@ -5,7 +5,6 @@
<html>
<head>
<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>
</head>
<body class="overview-page explore-page">
......
......@@ -91,7 +91,7 @@
<div id="container" style="min-height: 500px; min-width: 310px; margin: 0 auto"></div>
<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">
$(function () {
'use strict';
......
......@@ -149,7 +149,7 @@
});
</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">
$(function () {
'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