Skip to content

Commit

Permalink
use semantic-ui and grunt build task
Browse files Browse the repository at this point in the history
  • Loading branch information
aborn committed Oct 24, 2015
1 parent 78d3746 commit c564470
Show file tree
Hide file tree
Showing 170 changed files with 112,510 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/.buildpath
/.classpath
/.idea
/.sass-cache
out/
*.iml
#.gitignore
*~
commit.sh
*.swp
/node_modules
*.log
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem 'compass'
31 changes: 31 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
GEM
remote: https://rubygems.org/
specs:
chunky_png (1.3.4)
compass (1.0.3)
chunky_png (~> 1.2)
compass-core (~> 1.0.2)
compass-import-once (~> 1.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
sass (>= 3.3.13, < 3.5)
compass-core (1.0.3)
multi_json (~> 1.0)
sass (>= 3.3.0, < 3.5)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
ffi (1.9.10)
multi_json (1.11.2)
rb-fsevent (0.9.6)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
sass (3.4.19)

PLATFORMS
ruby

DEPENDENCIES
compass

BUNDLED WITH
1.10.6
74 changes: 74 additions & 0 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
module.exports = (grunt) ->
require('load-grunt-tasks')(grunt);

version = ->
grunt.file.readJSON("package.json").version
version_tag = ->
"v#{version()}"

grunt.initConfig
pkg: grunt.file.readJSON("package.json")
minified_comments: "/* appkit #{version_tag()} | (c) 2015-<%= grunt.template.today('yyyy') %> by Aborn Jiang\n"

coffee:
options:
join: true
compile:
files:
'src/main/webapp/assets/js/appkit.js': ['src/main/webapp/coffee/common.coffee']

uglify:
options:
mangle:
except: ['jQuery']
banner: "<%= minified_comments %>"
minified_chosen_js:
files:
'src/main/webapp/assets/js/appkit.min.js': ['src/main/webapp/assets/js/appkit.js']

compass:
chosen_css:
options:
bundleExec: true
specify: ['src/main/webapp/sass/base.scss']

cssmin:
minified_chosen_css:
options:
banner: "<%= minified_comments %>"
keepSpecialComments: 0
src: 'src/main/webapp/assets/css/base.css'
dest: 'src/main/webapp/assets/css/base.min.css'

watch:
scripts:
files: ['src/main/webapp/coffee/**/*.coffee', 'src/main/webapp/sass/*.scss']
tasks: ['build']

copy:
main:
files:
[{
expand: true,
cwd: 'node_modules/semantic-ui/dist/'
src: ['**'],
dest: 'src/main/webapp/ui/semantic-ui/dist/',
filter: 'isFile'}
]

grunt.registerTask 'preBuild', 'some prepare task before build', () ->
grunt.file.delete("src/main/webapp/assets/css/base.css")

grunt.registerTask 'postBuild', 'some post task after build', () ->
content = grunt.file.read("README.md");
len = content.length
content = content.substring(0, len - 11)
date = grunt.template.date(new Date(), 'yyyy-mm-dd');
grunt.file.write("README.md", content + "\n" + date)

grunt.registerTask 'ui', 'install semantic ui to web', () ->
grunt.file.copy('node_modules/semantic-ui/dist', 'src/main/webapp/ui/semantic-ui/')

grunt.registerTask 'default', ['preBuild', 'build', 'postBuild']
grunt.registerTask 'build', ['copy','coffee', 'compass', 'uglify', 'cssmin']
grunt.registerTask 'test', ['coffee']
8 changes: 8 additions & 0 deletions config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
http_path = "/"
css_dir = "src/main/webapp/assets/css"
sass_dir = "src/main/webapp/sass"
images_dir = "lib"

relative_assets = true
line_comments = false
asset_cache_buster :none
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "appkit-web",
"version": "1.0.0",
"description": "simple develop java web for app",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/aborn/appkit-web.git"
},
"keywords": [
"appkit",
"java",
"web",
"spring",
"mvc",
"semantic-ui"
],
"dependencies": {
},
"devDependencies": {
"semantic-ui" : "~2.1",
"coffee-script": ">= 1.6",
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-coffee": "~0.6.4",
"grunt-contrib-compass": "~0.5.0",
"grunt-contrib-concat": "~0.1.3",
"grunt-contrib-cssmin": "~0.6.1",
"grunt-contrib-jasmine": "~0.5.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-watch": "~0.3.1",
"load-grunt-tasks": "^3.0.0",
"grunt-contrib-copy": "~0.8"
},
"author": "Aborn Jiang",
"license": "ISC",
"bugs": {
"url": "https://github.com/aborn/appkit-web/issues"
},
"homepage": "http://appkit.popkit.org/",
"dependencies": {
"jquery": ">=1.4.4"
}
}
Empty file.
8 changes: 8 additions & 0 deletions src/main/webapp/assets/js/appkit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(function() {
var hello;

hello = function() {
return echo("hello");
};

}).call(this);
2 changes: 2 additions & 0 deletions src/main/webapp/assets/js/appkit.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* appkit v1.0.0 | (c) 2015-2015 by Aborn Jiang
(function(){var a;a=function(){return echo("hello")}}).call(this);
3 changes: 3 additions & 0 deletions src/main/webapp/coffee/common.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

hello = () ->
echo "hello"
Empty file added src/main/webapp/sass/base.scss
Empty file.
Loading

0 comments on commit c564470

Please sign in to comment.