Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into sprint-to-release…
Browse files Browse the repository at this point in the history
…-fixup

Conflicts:
	tasks/build.js
  • Loading branch information
Marcel Gerber committed Sep 16, 2014
2 parents cd64ac1 + 7479317 commit af2f146
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 63 deletions.
42 changes: 42 additions & 0 deletions CEF-Info.plist
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>11G56</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>libcef</string>
<key>CFBundleGetInfoString</key>
<string>CEF 1547</string>
<key>CFBundleIdentifier</key>
<string>com.cef</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>cef</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1547</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1547</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>4G2008a</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>11E52</string>
<key>DTSDKName</key>
<string>macosx10.7</string>
<key>DTXcode</key>
<string>0452</string>
<key>DTXcodeBuild</key>
<string>4G2008a</string>
</dict>
</plist>
14 changes: 11 additions & 3 deletions Gruntfile.js
Expand Up @@ -118,8 +118,6 @@ module.exports = function (grunt) {
}
]
},
// FIXME: see stage-mac task issues with copying .app bundles
/*
"mac": {
"files": [
{
Expand All @@ -128,9 +126,19 @@ module.exports = function (grunt) {
"src" : ["**"],
"dest" : "installer/mac/staging/<%= build.name %>.app/"
}
],
options: {
mode: true
}
},
"cefplist" : {
"files": [
{
"src" : "CEF-Info.plist",
"dest" : "installer/mac/staging/<%= build.name %>.app/Contents/Frameworks/Chromium Embedded Framework.framework/Resources/Info.plist"
}
]
},
*/
"linux": {
"files": [
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -15,7 +15,7 @@
"grunt": "0.4.1",
"grunt-cli": "0.1.6",
"grunt-contrib-jshint": "0.2.0",
"grunt-contrib-copy": "0.4.0",
"grunt-contrib-copy": "0.5.0",
"grunt-contrib-clean": "0.4.0",
"guid": "0.0.10",
"grunt-curl": "2.0.2",
Expand Down
109 changes: 50 additions & 59 deletions tasks/build.js
@@ -1,31 +1,31 @@
/*
* Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*
*/
/*jslint vars:true, regexp:true, nomen:true*/
/*global module, require, process*/

module.exports = function (grunt) {
"use strict";

var fs = require("fs"),
common = require("./common")(grunt),
q = require("q"),
Expand All @@ -34,20 +34,20 @@ module.exports = function (grunt) {
resolve = common.resolve,
platform = common.platform(),
_ = grunt.util._;

function getBracketsEnv() {
var env = _.extend(process.env);

env.BRACKETS_SRC = resolve(grunt.config("git.www.repo"));
env.BRACKETS_APP_NAME = grunt.config("build.name");

return env;
}

// task: full-build
grunt.registerTask("full-build", ["git", "create-project", "build-www", "build", "stage", "package"]);
grunt.registerTask("installer", ["full-build", "build-installer"]);

// task: build
grunt.registerTask("build", "Build shell executable. Run 'grunt full-build' to update repositories, build the shell and package www files.", function (wwwBranch, shellBranch) {
grunt.task.run("build-" + platform);
Expand All @@ -63,11 +63,11 @@ module.exports = function (grunt) {
return false;
}
});

// task: build-mac
grunt.registerTask("build-mac", "Build mac shell", function () {
var done = this.async();

spawn([
"xcodebuild -project appshell.xcodeproj -config Release clean",
"xcodebuild -project appshell.xcodeproj -config Release build"
Expand All @@ -83,44 +83,44 @@ module.exports = function (grunt) {
done(false);
});
});

// task: build-win
grunt.registerTask("build-win", "Build windows shell", function () {
var done = this.async();

spawn("cmd.exe /c scripts\\build_projects.bat").then(function () {
done();
}, function (err) {
grunt.log.error(err);
done(false);
});
});

// task: build-linux
grunt.registerTask("build-linux", "Build linux shell", function () {
var done = this.async();

spawn("make").then(function () {
done();
}, function (err) {
grunt.log.error(err);
done(false);
});
});

// task: git
grunt.registerMultiTask("git", "Pull specified repo branch from origin", function () {
var repo = this.data.repo;

if (!repo) {
grunt.fail.fatal("Missing repo config");
}

repo = resolve(repo);

if (this.data.branch) {
grunt.log.writeln("Updating repo " + this.target + " at " + repo + " to branch " + this.data.branch);

var done = this.async(),
promise = spawn([
"git fetch origin",
Expand All @@ -129,7 +129,7 @@ module.exports = function (grunt) {
"git submodule sync",
"git submodule update --init --recursive"
], { cwd: repo });

promise.then(function () {
done();
}, function (err) {
Expand All @@ -140,84 +140,75 @@ module.exports = function (grunt) {
grunt.log.writeln("Skipping fetch for " + this.target + " repo");
}
});

// task: stage
grunt.registerTask("stage", "Stage release files", function () {
// stage platform-specific binaries
grunt.task.run(["clean:staging-" + platform, "stage-" + platform]);
});

// task: stage-mac
grunt.registerTask("stage-mac", "Stage mac executable files", function () {
var done = this.async();

// this should have been a grunt-contrib-copy task "copy:mac", but something goes wrong when creating the .app folder
spawn([
"mkdir installer/mac/staging",
"cp -R xcodebuild/Release/" + grunt.config("build.name") + ".app installer/mac/staging/"
]).then(function () {
done();
}, function (err) {
grunt.log.error(err);
done(false);
});
// stage platform-specific binaries, then package www files
grunt.task.run("copy:mac");
grunt.task.run("copy:cefplist");
});

// task: stage-win
grunt.registerTask("stage-win", "Stage win executable files", function () {
// stage platform-specific binaries, then package www files
grunt.task.run("copy:win");
});

// task: stage-linux
grunt.registerTask("stage-linux", "Stage linux executable files", function () {
// stage platform-specific binaries, then package www files
grunt.task.run("copy:linux");
});

// task: package
grunt.registerTask("package", "Package www files", function () {
grunt.task.run(["clean:www", "copy:www", "copy:samples"]);
});

// task: build-installer
grunt.registerTask("build-installer", "Build installer", function () {
// TODO update brackets.config.json
grunt.task.run(["clean:installer-" + platform, "build-installer-" + platform]);
});

// task: build-installer-mac
grunt.registerTask("build-installer-mac", "Build mac installer", function () {
var done = this.async();

spawn(["bash buildInstaller.sh"], { cwd: resolve("installer/mac"), env: getBracketsEnv() }).then(function () {
done();
}, function (err) {
grunt.log.error(err);
done(false);
});
});

// task: build-installer-win
grunt.registerTask("build-installer-win", "Build windows installer", function () {
var done = this.async();

spawn(["cmd.exe /c ant.bat -f brackets-win-install-build.xml"], { cwd: resolve("installer/win"), env: getBracketsEnv() }).then(function () {
done();
}, function (err) {
grunt.log.error(err);
done(false);
});
});

// task: build-installer-linux
grunt.registerTask("build-installer-linux", "Build linux installer", function () {
grunt.task.requires(["package"]);

var template = grunt.file.read("installer/linux/debian/control"),
templateData = {},
content;

// populate debian control template fields
templateData.version = grunt.file.readJSON(grunt.config("config-json")).version;
templateData.size = 0;
Expand All @@ -228,15 +219,15 @@ module.exports = function (grunt) {
templateData.size += fs.statSync(abspath).size;
});
templateData.size = Math.round(templateData.size / 1000);

// write file
content = grunt.template.process(template, { data: templateData });
grunt.file.write("installer/linux/debian/package-root/DEBIAN/control", content);

var done = this.async(),
version = semver.parse(grunt.config("pkg").version),
release = version.major + "." + version.minor;

spawn(["bash build_installer.sh"], { cwd: resolve("installer/linux"), env: getBracketsEnv() }).then(function () {
return common.rename("installer/linux/brackets.deb", "installer/linux/Brackets Release " + release + " " + common.arch() + "-bit.deb");
}).then(function () {
Expand All @@ -248,7 +239,7 @@ module.exports = function (grunt) {
});

// task: build-linux-archive
grunt.registerTask("build-linux-archive", "Build portable Linux .tar.gz", function() {
grunt.registerTask("build-linux-archive", "Build portable Linux .tar.gz", function () {
grunt.task.requires(["package"]);

var done = this.async(),
Expand Down

0 comments on commit af2f146

Please sign in to comment.