Commit fd4ff8ec by Venkatesh Seetharam

ATLAS-90 Support offline builds. Contributed by Vishal Kadam

parent e4c5648b
{
"directory": "dist/lib",
"directory": "../../webapp/target/dist/lib/",
"storage": {
"packages": ".bower-cache",
"registry": ".bower-registry"
......
......@@ -23,7 +23,8 @@ var git = require('git-rev');
module.exports = function(grunt) {
var classPathSep = (process.platform === "win32") ? ';' : ':',
gitHash = '',
pkg = grunt.file.readJSON('package.json');
pkg = grunt.file.readJSON('package.json'),
distPath = '../../webapp/target/dist';
grunt.initConfig({
watch: {
......@@ -82,11 +83,12 @@ module.exports = function(grunt) {
bower: {
install: {
options: {
verbose: true
verbose: true,
targetDir: '.bower-components'
}
}
},
dist: 'dist/js/app.min.js',
dist: distPath + '/js/app.min.js',
modules: grunt.file.expand(
'public/js/app.js',
'public/js/routes.js',
......@@ -97,8 +99,8 @@ module.exports = function(grunt) {
shell: {
min: {
command: 'java ' +
'-cp dist/lib/closure-compiler/compiler.jar' + classPathSep +
'dist/lib/ng-closure-runner/ngcompiler.jar ' +
'-cp ' + distPath + '/lib/closure-compiler/compiler.jar' + classPathSep +
'' + distPath + '/lib/ng-closure-runner/ngcompiler.jar ' +
'org.angularjs.closurerunner.NgClosureRunner ' +
'--compilation_level SIMPLE_OPTIMIZATIONS ' +
//'--formatting PRETTY_PRINT ' +
......@@ -131,10 +133,15 @@ module.exports = function(grunt) {
expand: true,
cwd: 'public/',
src: ['**', '!js/**/*.js', '!modules/**/*.js'],
dest: 'dist'
dest: distPath
}
},
clean: {
build :[distPath],
options: {
force: true
}
},
clean: ['public/lib', 'dist'],
proxit: {
dev: {
options: {
......@@ -143,7 +150,7 @@ module.exports = function(grunt) {
'hosts': [{
'hostnames': ['*'],
'routes': {
'/': 'dist',
'/': distPath,
'/api': 'http://162.249.6.50:21000/api'
}
}]
......@@ -155,8 +162,8 @@ module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.registerTask('default', ['devUpdate', 'bower', 'jshint', 'jsbeautifier:default']);
grunt.registerTask('server', ['jshint', 'build', 'concurrent']);
grunt.registerTask('build', ['clean', 'bower', 'copy:dist', 'minify']);
grunt.registerTask('server', ['jshint', 'clean', 'bower', 'copy:dist', 'minify', 'concurrent']);
grunt.registerTask('build', ['copy:dist', 'minify']);
grunt.registerTask('minify', 'Minify the all js', function() {
var done = this.async();
......
......@@ -16,9 +16,6 @@
"Atlas",
"HortonWorks"
],
"scripts": {
"postinstall": "node node_modules/bower/bin/bower install"
},
"dependencies": {
"body-parser": "^1.2.0",
"bower": "~1.3.1",
......
......@@ -295,7 +295,7 @@
<developer>
<id>ssuresh</id>
<name>Suresh Srinivas</name>
<email> ssuresh@apache.org</email>
<email>ssuresh@apache.org</email>
<timezone>-8</timezone>
<roles>
<role>committer</role>
......@@ -306,7 +306,7 @@
<developer>
<id>vranganathan</id>
<name>Venkat Ranganathan</name>
<email> vranganathan@apache.org</email>
<email>vranganathan@apache.org</email>
<timezone>-8</timezone>
<roles>
<role>committer</role>
......@@ -320,7 +320,7 @@
<!-- platform encoding override -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<node.version>v0.10.30</node.version>
<slf4j.version>1.7.7</slf4j.version>
<jetty.version>9.2.12.v20150709</jetty.version>
<jersey.version>1.10</jersey.version>
......@@ -1251,6 +1251,15 @@
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.23</version>
<configuration>
<workingDirectory>../dashboard/v2/</workingDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
......@@ -1297,7 +1306,7 @@
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<!-- Source code metrics: mvn javancss:report or mvn site -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
......@@ -1542,12 +1551,20 @@
<exclude>**/maven-eclipse.xml</exclude>
<exclude>**/.externalToolBuilders/**</exclude>
<exclude>**/build.log</exclude>
<exclude>dashboard/**/.bower-*/**</exclude> <!-- temp libs -->
<exclude>dashboard/v2/.bowerrc</exclude> <!-- json file -->
<exclude>dashboard/v2/lib/**</exclude> <!-- temp libs -->
<exclude>dashboard/v2/node*/**</exclude> <!-- temp libs -->
<exclude>dashboard/v2/dist/**</exclude> <!-- package -->
<exclude>dashboard/v2/**/*.min.js*</exclude> <!-- minified JS -->
<!-- temp libs -->
<exclude>dashboard/**/.bower-*/**</exclude>
<!-- json file -->
<exclude>dashboard/v2/.bowerrc</exclude>
<!-- temp libs -->
<exclude>dashboard/v2/lib/**</exclude>
<!-- temp libs -->
<exclude>dashboard/v2/node*/**</exclude>
<!-- package -->
<exclude>dashboard/v2/dist/**</exclude>
<!-- lib files -->
<exclude>dashboard/v2/public/lib/**</exclude>
<!-- minified JS -->
<exclude>dashboard/v2/**/*.min.js*</exclude>
</excludes>
</configuration>
<executions>
......
......@@ -8,6 +8,7 @@ ATLAS-54 Rename configs in hive hook (shwethags)
ATLAS-3 Mixed Index creation fails with Date types (suma.shivaprasad via shwethags)
ALL CHANGES:
ATLAS-90 Support offline builds (Vishal Kadam via Venkatesh Seetharam)
ATLAS-154 Update website for 0.5-incubating release (Venkatesh Seetharam)
ATLAS-153 Build failure - org.glassfish:javax.el (shwethags)
ATLAS-117 Build fails on the latest commit (dossett@gmail.com via shwethags)
......
......@@ -65,6 +65,124 @@
</plugins>
</build>
</profile>
<profile>
<id>install-node</id>
<activation>
<file>
<missing>../dashboard/v2/node</missing>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
<npmVersion>1.4.3</npmVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>install-node_modules</id>
<activation>
<file>
<missing>../dashboard/v2/node_modules</missing>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>bower-install</id>
<activation>
<file>
<missing>target/dist/lib</missing>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install bower</id>
<goals>
<goal>grunt</goal>
</goals>
<configuration>
<arguments>bower</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>grunt-task</id>
<activation>
<property>
<name>!disableGrunt</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>npm remaining</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install --ignore-scripts</arguments>
</configuration>
</execution>
<execution>
<id>grunt dist</id>
<goals>
<goal>grunt</goal>
</goals>
<configuration>
<arguments>build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
......@@ -219,51 +337,9 @@
<artifactId>commons-io</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.23</version>
<!-- optional -->
<configuration>
<workingDirectory>../dashboard/v2/</workingDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v0.10.30</nodeVersion>
<npmVersion>1.4.3</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>grunt dist</id>
<goals>
<goal>grunt</goal>
</goals>
<configuration>
<arguments>build</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
......@@ -291,7 +367,7 @@
<attachClasses>true</attachClasses>
<webResources>
<resource>
<directory>../dashboard/v2/dist</directory>
<directory>target/dist</directory>
<targetPath>/</targetPath>
</resource>
<resource>
......
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