SCSS と CoffeScript ファイルをコンパイルするには Yeoman が必要だったので、distシンボリックリンクを作成することになりました。srcここでの残念なことは、ディレクトリを作成するyeoman serverときに実行できないことです。さらに厄介なのは、ディレクトリをクリーンアップするときです。yeoman builddistyeoman serverdist
トリガー用のジェネレーター用の yeoman ジェネレーターの作成に取り組む予定です。また、Sinatra でテストおよび開発を行っていたときに作成したタスクを模倣する単調なタスクをいくつか追加する予定です(Rakefile例: yeoman simulator、)。yeoman deviceyeoman testflight
編集:今のところ、いくつかのタスクを直接自分に追加しましたgruntfile.js。grunt-contrib-copy以下のサブタスクを追加して追加しました。
copy: {
app: {
files: {
"src/": "app/**", // core app files
},
},
compass: {
files: {
"src/styles/": "temp/styles/**", // drop in the compiled coffeescript
}
},
coffee: {
files: {
"src/scripts/": "temp/scripts/**" // drop in the compiled scss
}
}
},
これらのタスクを適切な監視コマンドに追加し、ディレクトリを監視する新しい監視を追加しましたapp。
watch: {
coffee: {
files: 'app/scripts/**/*.coffee',
tasks: 'coffee copy:coffee reload'
},
compass: {
files: [
'app/styles/**/*.{scss,sass}'
],
tasks: 'compass copy:compass reload'
},
app: {
files: [
'app/**/*.{html,png,json,css,js}'
],
tasks: 'copy:app'
},
}
yeoman serverを呼び出すNowは、最新yeoman watchの状態を保ちsrcます。
また、次のことを行うために持ち込みましgrunt-shellた。
shell: {
forge_build: {
command: 'forge build ios 2>&1 | tee output',
stdout: true
},
forge_run_device: {
command: 'forge run ios --ios.device device',
stdout: true
},
forge_run: {
command: 'forge run ios',
stdout: true
}
}
そして、次のようないくつかのタスクを作成します。
grunt.registerTask("sim", 'copy shell:forge_build shell:forge_run');
grunt.registerTask("device", 'copy shell:forge_build shell:forge_run_device');
私はこれに完全に満足しているわけではありませんが、実行を続けてyeoman server別の場所のコンソールにドロップし、実行yeoman deviceしてデバイスで起動することができます. srcまた、チェックインできる場所にディレクトリを保持します。
最終的には、これを Yeoman プラグインに移動し、より具体的なビルド タスクをいくつか追加して、適切なターゲット (iOS、Android など) の src ディレクトリをクリーンアップし、ディレクトリ サイズを小さく保ちます。
編集: Yeoman 内からgrunt-forge実行できるように作成しました。`forge forge .