Skip to content

Commit

Permalink
Gruntification
Browse files Browse the repository at this point in the history
  • Loading branch information
jendib committed Feb 23, 2014
1 parent 12c3c47 commit ae56601
Show file tree
Hide file tree
Showing 94 changed files with 488 additions and 271 deletions.
38 changes: 34 additions & 4 deletions docs-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,44 @@

<plugins>

<!-- Generation of the war -->
<!-- Launch NPM & Grunt -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<target name="building">
<!-- npm install -->
<exec executable="cmd" dir="${project.basedir}/src/main/webapp" osfamily="windows" failonerror="true">
<arg line="/c npm install" />
</exec>
<exec executable="npm" dir="${project.basedir}/src/main/webapp" osfamily="unix" failonerror="true">
<arg line="install" />
</exec>
<!-- grunt -->
<exec executable="cmd" dir="${project.basedir}/src/main/webapp" osfamily="windows">
<arg line="/c grunt --apiurl=api" />
</exec>
<exec executable="grunt" dir="${project.basedir}/src/main/webapp" osfamily="unix">
<arg line="--apiurl=api" />
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- WAR generation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceExcludes>
sismicsdocs/**,
</warSourceExcludes>
<warSourceDirectory>${basedir}/src/main/webapp/dist</warSourceDirectory>
<webXml>src\main\webapp\WEB-INF\web.xml</webXml>
</configuration>
</plugin>
Expand Down
6 changes: 4 additions & 2 deletions docs-web/src/main/webapp/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/sismicsdocs
/.idea
sismicsdocs
node_modules
dist
.idea
122 changes: 122 additions & 0 deletions docs-web/src/main/webapp/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
dist: {
src: ['dist']
}
},
ngmin: {
dist: {
expand: true,
cwd: 'src',
src: ['app/**/*.js'],
dest: 'dist'
}
},
concat: {
docs: {
options: {
separator: ';'
},
src: ['src/lib/jquery.js','src/lib/jquery.ui.js','src/lib/underscore.js','src/lib/colorpicker.js', 'src/lib/angular.js', 'src/lib/angular.*.js',
'dist/app/docs/app.js', 'dist/app/docs/controller/*.js', 'dist/app/docs/directive/*.js', 'dist/app/docs/filter/*.js', 'dist/app/docs/service/*.js'],
dest: 'dist/docs.js'
},
share: {
options: {
separator: ';'
},
src: ['src/lib/jquery.js','src/lib/jquery.ui.js','src/lib/underscore.js','src/lib/colorpicker.js', 'src/lib/angular.js', 'src/lib/angular.*.js',
'dist/app/share/app.js', 'dist/app/share/controller/*.js', 'dist/app/share/directive/*.js', 'dist/app/share/filter/*.js', 'dist/app/share/service/*.js'],
dest: 'dist/share.js'
},
css: {
src: ['src/style/*.css', 'dist/less.css'],
dest: 'dist/style.css'
}
},
less: {
dist: {
src: ['src/style/*.less'],
dest: 'dist/less.css'
}
},
cssmin: {
dist: {
src: 'dist/style.css',
dest: 'dist/style/style.min.css'
}
},
uglify: {
docs: {
src: 'dist/docs.js',
dest: 'dist/docs.min.js'
},
share: {
src: 'dist/share.js',
dest: 'dist/share.min.js'
}
},
copy: {
dist: {
expand: true,
cwd: 'src/',
src: ['**', '!**/*.js', '!*.html', '!**/*.less', '!**/*.css'],
dest: 'dist/'
}
},
htmlrefs: {
index: {
src: 'src/index.html',
dest: 'dist/index.html'
},
share: {
src: 'src/share.html',
dest: 'dist/share.html'
}
},
remove: {
dist: {
fileList: ['dist/style.css', 'dist/docs.js', 'dist/share.js', 'dist/less.css'],
dirList: ['dist/app']
}
},
cleanempty: {
options: {
files: false,
folders: true
},
src: ['dist/**']
},
replace: {
dist: {
src: ['dist/docs.min.js', 'dist/share.min.js', 'dist/**/*.html'],
overwrite: true,
replacements: [{
from: '../api',
to: grunt.option('apiurl') || '../api'
}]
}
}
});

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-cleanempty');
grunt.loadNpmTasks('grunt-htmlrefs');
grunt.loadNpmTasks('grunt-css');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-remove');
grunt.loadNpmTasks('grunt-ngmin');
grunt.loadNpmTasks('grunt-text-replace');

// Default tasks.
grunt.registerTask('default', ['clean', 'ngmin', 'concat:docs', 'concat:share', 'less', 'concat:css', 'cssmin',
'uglify:docs', 'uglify:share', 'copy', 'remove', 'cleanempty', 'htmlrefs:index', 'htmlrefs:share', 'replace']);

};
98 changes: 0 additions & 98 deletions docs-web/src/main/webapp/app/docs/controller/FileView.js

This file was deleted.

This file was deleted.

98 changes: 0 additions & 98 deletions docs-web/src/main/webapp/app/share/controller/FileView.js

This file was deleted.

7 changes: 0 additions & 7 deletions docs-web/src/main/webapp/app/share/controller/Main.js

This file was deleted.

Loading

0 comments on commit ae56601

Please sign in to comment.