Skip to content

Commit

Permalink
BootstrapのコードをGit Submoduleからbowerに変更して
Browse files Browse the repository at this point in the history
・Git Submoduleをやめてbowerに変更した
・bowerに変更するにあたってHonokaのコードの位置の変更
・フォルダ位置変更に伴うGruntタスクの変更
  • Loading branch information
windyakin committed Aug 22, 2015
1 parent 2db528e commit f15ef42
Show file tree
Hide file tree
Showing 18 changed files with 89 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "bower_components"
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#=============================================
# bower
#=============================================
bower_components/

#=============================================
# My Original Set
#=============================================
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "src/bootstrap"]
path = src/bootstrap
url = git@github.com:twbs/bootstrap-sass.git
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ git:
submodules: false

before_install:
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
- git submodule update --init src/bootstrap
- bower install
- gem install compass

script:
Expand Down
43 changes: 32 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ module.exports = function(grunt) {
},
// compassのコンパイル
compass: {
dist: {
bootstrap: {
options: {
sassDir: 'src/compass',
config: 'src/config.rb'
config: 'config.rb'
}
},
assets: {
options: {
config: 'src/scss/config.rb'
}
}
},
Expand All @@ -50,28 +54,40 @@ module.exports = function(grunt) {
src: ['dist/css/**/*', 'dist/js/**/*', 'dist/fonts/**/*']
}
},
// bowerのインストール
bower: {
install: {
options: {
targetDir: 'dist/',
layout: function(type, component, source) {
return type;
}
}
}
},
copy: {
build: {
files: [
{
expand: true,
cwd: 'src/bootstrap/assets/fonts/bootstrap/',
cwd: 'bower_components/bootstrap-sass-official/assets/fonts/bootstrap/',
src: ["**/*"],
dest: 'dist/fonts'
},
{
expand: true,
cwd: "src/bootstrap/assets/javascripts/",
cwd: "bower_components/bootstrap-sass-official/assets/javascripts/",
src: ["bootstrap.**js"],
dest: "dist/js"
}
]
}
},
// バージョン情報の出力
ect: {
version: {
options: {
root: 'src/compass/css/honoka/',
root: 'scss/honoka/',
variables: {
name: pkg.name,
version: pkg.version,
Expand All @@ -87,10 +103,15 @@ module.exports = function(grunt) {
},
// ファイル更新監視
watch: {
// compassの自動コンパイル
compass: {
files: ['src/compass/**/*.scss'],
// 自動コンパイル
bootstrap: {
files: ['scss/**/*.scss'],
tasks: ['compass:dist'],
},
// 自動コンパイル
assets: {
files: ['src/scss/**/*.scss'],
tasks: ['compass:assets'],
}
},
// テストサーバ
Expand Down Expand Up @@ -155,10 +176,10 @@ module.exports = function(grunt) {
}

// 通常 (compass/connect/watch)
grunt.registerTask('server', ['ect:version', 'compass:dist', 'connect', 'watch']);
grunt.registerTask('server', ['bower:install', 'ect:version', 'compass', 'connect', 'watch']);

// ミニファイ
grunt.registerTask('build', ['clean:build', 'copy:build', 'ect:version', 'compass:dist', 'cssmin:minify', 'replace:banner']);
grunt.registerTask('build', ['clean:build', 'bower:install', 'ect:version', 'compass:bootstrap', 'cssmin:minify', 'replace:banner']);

// 配布用パッケージ作成
grunt.registerTask('package', ['build', 'compress:main']);
Expand Down
23 changes: 23 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Honoka",
"description": "Honoka is one of the Bootstrap original theme.",
"author": "windyakin",
"homepage": "http://honokak.osaka/",
"repository": {
"type": "git",
"url": "git://github.com/windyakin/Honoka.git"
},
"license": "MIT",
"devDependencies": {
"bootstrap-sass-official": "~3.3.5"
},
"exportsOverride": {
"bootstrap-sass-official": {
"js": "assets/javascripts/bootstrap.**js",
"fonts": "assets/fonts/bootstrap/**/*"
},
"jquery": {
"assets/js": "dist/jquery.min.js"
}
}
}
9 changes: 3 additions & 6 deletions src/config.rb → config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
# Set this to the root of your project when deployed:

http_path = "/"
css_dir = "dist/"
sass_dir = "src/compass/"
images_dir = "dist/img/"
javascripts_dir = "dist/js/"
css_dir = "dist/css/"
sass_dir = "scss/"
line_comments = false
output_style = :expanded

additional_import_paths = [
# Bootstrap Core
"src/bootstrap/assets/stylesheets/",
"src/compass/css/"
"bower_components/bootstrap-sass-official/assets/stylesheets/"
]
5 changes: 5 additions & 0 deletions dist/assets/js/jquery.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"url": "https://github.com/windyakin/honoka.git"
},
"devDependencies": {
"bower": "^1.4.1",
"grunt": "^0.4.5",
"grunt-bower-task": "^0.4.0",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-compass": "^0.9.1",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/bootstrap
Submodule bootstrap deleted from d64d48
15 changes: 15 additions & 0 deletions src/scss/config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Require any additional compass plugins here.

# Set this to the root of your project when deployed:

http_path = "/"
css_dir = "dist/assets/css/"
sass_dir = "src/scss/"
line_comments = false
output_style = :expanded

additional_import_paths = [
# Bootstrap Core
"bower_components/bootstrap-sass-official/assets/stylesheets/",
"scss/"
]
File renamed without changes.

0 comments on commit f15ef42

Please sign in to comment.