{"action":"created","comment":{"url":"https://api.github.com/repos/oppia/oppia/pulls/comments/44878006","id":44878006,"diff_hunk":"@@ -0,0 +1,101 @@\n+var gulp = require('gulp');\n+var path = require('path');\n+var oppiaGae = require('oppia-gulp');\n+var concatCSS = require('gulp-concat');\n+var minifyCSS = require('gulp-minify-css');\n+var ifElse = require('gulp-if-else');\n+var argv = require('yargs')\n+    .usage('Usage: $0 --appengine [Path to app engine]' +\n+      '--clear_datastore [clear all data storage]' +\n+      '--enable_sendmail [send emails]' +\n+      '--dev_mode [variable that shows if is in dev_mode]')\n+    .demand(['appengine']).argv;\n+var manifest = require('./manifest.json');\n+\n+var serveCmd = argv.appengine;\n+var params = {\n+  admin_host: '0.0.0.0',\n+  admin_port: 8000,\n+  host: '0.0.0.0',\n+  port: 8181\n+};\n+\n+var is_dev = argv.dev_mode == 'True';\n+var dependencies = manifest.dependencies;\n+var css_files = [];\n+var font_folders = [];\n+var css_background = [];\n+for (var obj in dependencies) {\n+  var dependency = dependencies[obj];\n+  if (dependency.hasOwnProperty('cssFiles')) {\n+    var cssFiles = dependency['cssFiles'];\n+    for (var files in cssFiles) {\n+      css_files.push(path.join('third_party', 'static',\n+      dependency['dest_target'] + dependency['version'],\n+      cssFiles[files]));\n+    }\n+  }\n+  if (dependency.hasOwnProperty('fonts_path')) {\n+    var font_prefix = '*.{eot,woff2,ttf,woff,eof,svg}';\n+    font_folders.push(path.join('third_party', 'static',\n+      dependency['dest_target'] + dependency['version'],\n+      dependency['fonts_path'], font_prefix));\n+  }\n+  if (dependency.hasOwnProperty('css_background_image')) {\n+    var background_image = dependency['css_background_image'];\n+    for (var image in background_image) {\n+      css_background.push(path.join('third_party', 'static',\n+        dependency['dest_target'] + dependency['version'],\n+        background_image[image]));\n+    }\n+  }\n+}\n+\n+if (argv.clear_datastore) {\n+  params.clear_datastore = true;\n+}\n+\n+if (argv.enable_sendmail) {\n+  params.enable_sendmail = argv.enable_sendmail;\n+}\n+\n+var css_path = path.join('core', 'templates', is_dev ? 'dev' : 'prod', 'head', 'css');\n+gulp.task('css', function() {\n+  gulp.src(css_files)\n+    .pipe(ifElse(!is_dev, minifyCSS))\n+    .pipe(concatCSS('third_party.css'))\n+    .pipe(gulp.dest(css_path));\n+});\n+\n+gulp.task('copyFonts', function() {\n+  gulp.src(font_folders)\n+  .pipe(gulp.dest(path.join('static', 'fonts')));\n+});\n+\n+gulp.task('copyCssBackgroundImages', function() {\n+  gulp.src(css_background)\n+  .pipe(gulp.dest(css_path));\n+});\n+\n+gulp.task('gulp-serve', function() {\n+  gulp.src('app.yaml')\n+    .pipe(oppiaGae(serveCmd, [], params));\n+});\n+\n+// This takes all functions  that are required for the build\n+// e.g css, Js and Images\n+gulp.task('build', ['css', 'copyFonts', 'copyCssBackgroundImages']);\n+\n+gulp.slurped = false;\n+gulp.task('watch', function() {\n+  if (!gulp.slurped) {\n+    gulp.watch('gulpfile.js', ['build']);\n+    gulp.watch(css_files, ['css']);\n+    gulp.watch('manifest.json', ['build']);\n+    gulp.slurped = true;\n+  }\n+});\n+\n+// This takes all default task which must be run when start.sh is started.\n+gulp.task('.', ['build', 'gulp-serve', 'watch']);\n+","path":"gulpfile.js","position":101,"original_position":101,"commit_id":"f753ab4cd54e9c2204bcdcf14ede00376dbedf15","original_commit_id":"f753ab4cd54e9c2204bcdcf14ede00376dbedf15","user":{"login":"MAKOSCAFEE","id":6409210,"avatar_url":"https://avatars.githubusercontent.com/u/6409210?v=3","gravatar_id":"","url":"https://api.github.com/users/MAKOSCAFEE","html_url":"https://github.com/MAKOSCAFEE","followers_url":"https://api.github.com/users/MAKOSCAFEE/followers","following_url":"https://api.github.com/users/MAKOSCAFEE/following{/other_user}","gists_url":"https://api.github.com/users/MAKOSCAFEE/gists{/gist_id}","starred_url":"https://api.github.com/users/MAKOSCAFEE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MAKOSCAFEE/subscriptions","organizations_url":"https://api.github.com/users/MAKOSCAFEE/orgs","repos_url":"https://api.github.com/users/MAKOSCAFEE/repos","events_url":"https://api.github.com/users/MAKOSCAFEE/events{/privacy}","received_events_url":"https://api.github.com/users/MAKOSCAFEE/received_events","type":"User","site_admin":false},"body":"As we discussed this gulp will also be run by scripts/build.py but this will also minify css for production purpose.","created_at":"2015-11-15T21:46:40Z","updated_at":"2015-11-15T21:46:40Z","html_url":"https://github.com/oppia/oppia/pull/1127#discussion_r44878006","pull_request_url":"https://api.github.com/repos/oppia/oppia/pulls/1127","_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments/44878006"},"html":{"href":"https://github.com/oppia/oppia/pull/1127#discussion_r44878006"},"pull_request":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1127"}}},"pull_request":{"url":"https://api.github.com/repos/oppia/oppia/pulls/1127","id":50552538,"html_url":"https://github.com/oppia/oppia/pull/1127","diff_url":"https://github.com/oppia/oppia/pull/1127.diff","patch_url":"https://github.com/oppia/oppia/pull/1127.patch","issue_url":"https://api.github.com/repos/oppia/oppia/issues/1127","number":1127,"state":"open","locked":false,"title":"Initial implementation of css optimizarion","user":{"login":"MAKOSCAFEE","id":6409210,"avatar_url":"https://avatars.githubusercontent.com/u/6409210?v=3","gravatar_id":"","url":"https://api.github.com/users/MAKOSCAFEE","html_url":"https://github.com/MAKOSCAFEE","followers_url":"https://api.github.com/users/MAKOSCAFEE/followers","following_url":"https://api.github.com/users/MAKOSCAFEE/following{/other_user}","gists_url":"https://api.github.com/users/MAKOSCAFEE/gists{/gist_id}","starred_url":"https://api.github.com/users/MAKOSCAFEE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MAKOSCAFEE/subscriptions","organizations_url":"https://api.github.com/users/MAKOSCAFEE/orgs","repos_url":"https://api.github.com/users/MAKOSCAFEE/repos","events_url":"https://api.github.com/users/MAKOSCAFEE/events{/privacy}","received_events_url":"https://api.github.com/users/MAKOSCAFEE/received_events","type":"User","site_admin":false},"body":"+ This commit minify all third party css\r\n+ copy all fonts into one folder\r\n+ created manifest.json which will be used in the future by install third_party\r\n+ started using gulp\r\n\r\n@seanlip I have one problem with creating URL for fonts as now the request for ```localhost:8181/font/*``` return 404. And thinking should also environment(whether``` dev``` or ```prod```) should be passed as arg so as to control if ```css``` should be minified in ```dev```.\r\n","created_at":"2015-11-12T19:02:13Z","updated_at":"2015-11-15T21:46:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd3464eaba59499cf0439aadb05b52016836a822","assignee":{"login":"seanlip","id":10575562,"avatar_url":"https://avatars.githubusercontent.com/u/10575562?v=3","gravatar_id":"","url":"https://api.github.com/users/seanlip","html_url":"https://github.com/seanlip","followers_url":"https://api.github.com/users/seanlip/followers","following_url":"https://api.github.com/users/seanlip/following{/other_user}","gists_url":"https://api.github.com/users/seanlip/gists{/gist_id}","starred_url":"https://api.github.com/users/seanlip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanlip/subscriptions","organizations_url":"https://api.github.com/users/seanlip/orgs","repos_url":"https://api.github.com/users/seanlip/repos","events_url":"https://api.github.com/users/seanlip/events{/privacy}","received_events_url":"https://api.github.com/users/seanlip/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/oppia/oppia/pulls/1127/commits","review_comments_url":"https://api.github.com/repos/oppia/oppia/pulls/1127/comments","review_comment_url":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oppia/oppia/issues/1127/comments","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/f753ab4cd54e9c2204bcdcf14ede00376dbedf15","head":{"label":"MAKOSCAFEE:oppia-css-optimization","ref":"oppia-css-optimization","sha":"f753ab4cd54e9c2204bcdcf14ede00376dbedf15","user":{"login":"MAKOSCAFEE","id":6409210,"avatar_url":"https://avatars.githubusercontent.com/u/6409210?v=3","gravatar_id":"","url":"https://api.github.com/users/MAKOSCAFEE","html_url":"https://github.com/MAKOSCAFEE","followers_url":"https://api.github.com/users/MAKOSCAFEE/followers","following_url":"https://api.github.com/users/MAKOSCAFEE/following{/other_user}","gists_url":"https://api.github.com/users/MAKOSCAFEE/gists{/gist_id}","starred_url":"https://api.github.com/users/MAKOSCAFEE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MAKOSCAFEE/subscriptions","organizations_url":"https://api.github.com/users/MAKOSCAFEE/orgs","repos_url":"https://api.github.com/users/MAKOSCAFEE/repos","events_url":"https://api.github.com/users/MAKOSCAFEE/events{/privacy}","received_events_url":"https://api.github.com/users/MAKOSCAFEE/received_events","type":"User","site_admin":false},"repo":{"id":40843161,"name":"oppia","full_name":"MAKOSCAFEE/oppia","owner":{"login":"MAKOSCAFEE","id":6409210,"avatar_url":"https://avatars.githubusercontent.com/u/6409210?v=3","gravatar_id":"","url":"https://api.github.com/users/MAKOSCAFEE","html_url":"https://github.com/MAKOSCAFEE","followers_url":"https://api.github.com/users/MAKOSCAFEE/followers","following_url":"https://api.github.com/users/MAKOSCAFEE/following{/other_user}","gists_url":"https://api.github.com/users/MAKOSCAFEE/gists{/gist_id}","starred_url":"https://api.github.com/users/MAKOSCAFEE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MAKOSCAFEE/subscriptions","organizations_url":"https://api.github.com/users/MAKOSCAFEE/orgs","repos_url":"https://api.github.com/users/MAKOSCAFEE/repos","events_url":"https://api.github.com/users/MAKOSCAFEE/events{/privacy}","received_events_url":"https://api.github.com/users/MAKOSCAFEE/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MAKOSCAFEE/oppia","description":"Tool for creating interactive tutors.","fork":true,"url":"https://api.github.com/repos/MAKOSCAFEE/oppia","forks_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/forks","keys_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/teams","hooks_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/hooks","issue_events_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/events","assignees_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/tags","blobs_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/languages","stargazers_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/stargazers","contributors_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/contributors","subscribers_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/subscribers","subscription_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/subscription","commits_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/merges","archive_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/downloads","issues_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/labels{/name}","releases_url":"https://api.github.com/repos/MAKOSCAFEE/oppia/releases{/id}","created_at":"2015-08-16T21:49:10Z","updated_at":"2015-08-16T21:49:11Z","pushed_at":"2015-11-13T22:57:14Z","git_url":"git://github.com/MAKOSCAFEE/oppia.git","ssh_url":"git@github.com:MAKOSCAFEE/oppia.git","clone_url":"https://github.com/MAKOSCAFEE/oppia.git","svn_url":"https://github.com/MAKOSCAFEE/oppia","homepage":"https://www.oppia.org","size":42767,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"oppia:develop","ref":"develop","sha":"f965768bdeb26f85da43621d1a58c156c71ff014","user":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"repo":{"id":40687563,"name":"oppia","full_name":"oppia/oppia","owner":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oppia/oppia","description":"Tool for collaboratively building interactive tutors.","fork":false,"url":"https://api.github.com/repos/oppia/oppia","forks_url":"https://api.github.com/repos/oppia/oppia/forks","keys_url":"https://api.github.com/repos/oppia/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oppia/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oppia/oppia/teams","hooks_url":"https://api.github.com/repos/oppia/oppia/hooks","issue_events_url":"https://api.github.com/repos/oppia/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/oppia/oppia/events","assignees_url":"https://api.github.com/repos/oppia/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/oppia/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/oppia/oppia/tags","blobs_url":"https://api.github.com/repos/oppia/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oppia/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oppia/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/oppia/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/oppia/oppia/languages","stargazers_url":"https://api.github.com/repos/oppia/oppia/stargazers","contributors_url":"https://api.github.com/repos/oppia/oppia/contributors","subscribers_url":"https://api.github.com/repos/oppia/oppia/subscribers","subscription_url":"https://api.github.com/repos/oppia/oppia/subscription","commits_url":"https://api.github.com/repos/oppia/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/oppia/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/oppia/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/oppia/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/oppia/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/oppia/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oppia/oppia/merges","archive_url":"https://api.github.com/repos/oppia/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oppia/oppia/downloads","issues_url":"https://api.github.com/repos/oppia/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/oppia/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/oppia/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/oppia/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oppia/oppia/labels{/name}","releases_url":"https://api.github.com/repos/oppia/oppia/releases{/id}","created_at":"2015-08-14T00:16:14Z","updated_at":"2015-11-12T21:40:09Z","pushed_at":"2015-11-15T08:24:39Z","git_url":"git://github.com/oppia/oppia.git","ssh_url":"git@github.com:oppia/oppia.git","clone_url":"https://github.com/oppia/oppia.git","svn_url":"https://github.com/oppia/oppia","homepage":"https://www.oppia.org","size":44698,"stargazers_count":53,"watchers_count":53,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":67,"mirror_url":null,"open_issues_count":216,"forks":67,"open_issues":216,"watchers":53,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1127"},"html":{"href":"https://github.com/oppia/oppia/pull/1127"},"issue":{"href":"https://api.github.com/repos/oppia/oppia/issues/1127"},"comments":{"href":"https://api.github.com/repos/oppia/oppia/issues/1127/comments"},"review_comments":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1127/comments"},"review_comment":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1127/commits"},"statuses":{"href":"https://api.github.com/repos/oppia/oppia/statuses/f753ab4cd54e9c2204bcdcf14ede00376dbedf15"}}}}