|
| 1 | +/* |
| 2 | + * Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. |
| 3 | + * |
| 4 | + * Permission is hereby granted, free of charge, to any person obtaining a |
| 5 | + * copy of this software and associated documentation files (the "Software"), |
| 6 | + * to deal in the Software without restriction, including without limitation |
| 7 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 | + * and/or sell copies of the Software, and to permit persons to whom the |
| 9 | + * Software is furnished to do so, subject to the following conditions: |
| 10 | + * |
| 11 | + * The above copyright notice and this permission notice shall be included in |
| 12 | + * all copies or substantial portions of the Software. |
| 13 | + * |
| 14 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 17 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 18 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 19 | + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 20 | + * DEALINGS IN THE SOFTWARE. |
| 21 | + * |
| 22 | + */ |
| 23 | +/*jslint regexp:true*/ |
| 24 | +/*global module, require, process*/ |
| 25 | +module.exports = function (grunt) { |
| 26 | + "use strict"; |
| 27 | + |
| 28 | + var common = require("./tasks/common")(grunt), |
| 29 | + resolve = common.resolve, |
| 30 | + staging = (common.platform() === "mac") ? "installer/mac/staging/<%= build.name %>.app/Contents" : "installer/win/staging"; |
| 31 | + |
| 32 | + grunt.initConfig({ |
| 33 | + "pkg": grunt.file.readJSON("package.json"), |
| 34 | + "curl-dir": { |
| 35 | + /* linux not supported yet */ |
| 36 | + /* |
| 37 | + linux: { |
| 38 | + dest : "<%= cef_zip %>", |
| 39 | + src : "https://docs.google.com/file/d/0B7as0diokeHxeTNqZFIyNWZKSWM/edit?usp=sharing" |
| 40 | + }, |
| 41 | + */ |
| 42 | + /* mac */ |
| 43 | + "cef-mac": { |
| 44 | + "dest" : "downloads/", |
| 45 | + "src" : "http://chromiumembedded.googlecode.com/files/cef_binary_<%= cef.version %>_macosx.zip" |
| 46 | + }, |
| 47 | + "node-mac": { |
| 48 | + "dest" : "downloads/", |
| 49 | + "src" : "http://nodejs.org/dist/v<%= node.version %>/node-v<%= node.version %>-darwin-x86.tar.gz" |
| 50 | + }, |
| 51 | + /* win */ |
| 52 | + "cef-win": { |
| 53 | + "dest" : "downloads/", |
| 54 | + "src" : "http://chromiumembedded.googlecode.com/files/cef_binary_<%= cef.version %>_windows.zip" |
| 55 | + }, |
| 56 | + "node-win": { |
| 57 | + "dest" : "downloads/", |
| 58 | + "src" : ["http://nodejs.org/dist/v<%= node.version %>/node.exe", |
| 59 | + "http://nodejs.org/dist/npm/npm-<%= npm.version %>.zip"] |
| 60 | + } |
| 61 | + }, |
| 62 | + "clean": { |
| 63 | + "downloads" : ["downloads"], |
| 64 | + "installer-mac" : ["installer/mac/*.dmg"], |
| 65 | + "installer-win" : ["installer/win/*.msi"], |
| 66 | + "staging-mac" : ["installer/mac/staging"], |
| 67 | + "staging-win" : ["installer/win/staging"], |
| 68 | + "www" : ["<%= build.staging %>/www", "<%= build.staging %>/samples"] |
| 69 | + }, |
| 70 | + "copy": { |
| 71 | + "win": { |
| 72 | + "files": [ |
| 73 | + { |
| 74 | + "expand" : true, |
| 75 | + "cwd" : "Release/", |
| 76 | + "src" : [ |
| 77 | + "**", |
| 78 | + "!*.pdb", |
| 79 | + "!dev/**", |
| 80 | + "!obj/**", |
| 81 | + "!lib/**", |
| 82 | + "!avformat-54.dll", |
| 83 | + "!avutil-51.dll", |
| 84 | + "!avcodec-54.dll", |
| 85 | + "!d3dcompiler_43.dll", |
| 86 | + "!d3dx9_43.dll", |
| 87 | + "!libEGL.dll", |
| 88 | + "!libGLESv2.dll", |
| 89 | + "!cefclient.exe", |
| 90 | + "!debug.log" |
| 91 | + ], |
| 92 | + "dest" : "installer/win/staging/" |
| 93 | + } |
| 94 | + ] |
| 95 | + }, |
| 96 | + // FIXME: see stage-mac task issues with copying .app bundles |
| 97 | + /* |
| 98 | + "mac": { |
| 99 | + "files": [ |
| 100 | + { |
| 101 | + "expand" : true, |
| 102 | + "cwd" : "xcodebuild/Release/<%= build.name %>.app/", |
| 103 | + "src" : ["**"], |
| 104 | + "dest" : "installer/mac/staging/<%= build.name %>.app/" |
| 105 | + } |
| 106 | + ] |
| 107 | + }, |
| 108 | + */ |
| 109 | + "www": { |
| 110 | + "files": [ |
| 111 | + { |
| 112 | + "dot" : true, |
| 113 | + "expand" : true, |
| 114 | + "cwd" : "<%= git.www.repo %>/src", |
| 115 | + "src" : ["**", "!**/.git*"], |
| 116 | + "dest" : "<%= build.staging %>/www/" |
| 117 | + } |
| 118 | + ] |
| 119 | + }, |
| 120 | + "samples": { |
| 121 | + "files": [ |
| 122 | + { |
| 123 | + "dot" : true, |
| 124 | + "expand" : true, |
| 125 | + "cwd" : "<%= git.www.repo %>/samples", |
| 126 | + "src" : ["**"], |
| 127 | + "dest" : "<%= build.staging %>/samples/" |
| 128 | + } |
| 129 | + ] |
| 130 | + } |
| 131 | + }, |
| 132 | + "unzip": { |
| 133 | + "cef": { |
| 134 | + "src" : "<%= cef_zip %>", |
| 135 | + "dest" : "deps/cef" |
| 136 | + } |
| 137 | + }, |
| 138 | + "jshint": { |
| 139 | + "all" : ["Gruntfile.js", "tasks/**/*.js"], |
| 140 | + "options": { |
| 141 | + "jshintrc" : ".jshintrc" |
| 142 | + } |
| 143 | + }, |
| 144 | + "build": { |
| 145 | + "name" : "Brackets", |
| 146 | + "staging" : staging |
| 147 | + }, |
| 148 | + "git": { |
| 149 | + "www": { |
| 150 | + "repo" : "../brackets", // TODO user configurable? |
| 151 | + "branch" : grunt.option("www-branch") || "" |
| 152 | + }, |
| 153 | + "shell": { |
| 154 | + "repo" : ".", |
| 155 | + "branch" : grunt.option("shell-branch") || "" |
| 156 | + } |
| 157 | + }, |
| 158 | + "cef": { |
| 159 | + "version" : "3.1180.823" |
| 160 | + }, |
| 161 | + "node": { |
| 162 | + "version" : "0.8.20" |
| 163 | + }, |
| 164 | + "npm": { |
| 165 | + "version" : "1.2.11" |
| 166 | + } |
| 167 | + }); |
| 168 | + |
| 169 | + grunt.loadTasks("tasks"); |
| 170 | + grunt.loadNpmTasks("grunt-contrib-jshint"); |
| 171 | + grunt.loadNpmTasks("grunt-contrib-copy"); |
| 172 | + grunt.loadNpmTasks("grunt-contrib-clean"); |
| 173 | + grunt.loadNpmTasks("grunt-curl"); |
| 174 | + |
| 175 | + grunt.registerTask("default", ["setup", "build"]); |
| 176 | +}; |
0 commit comments