Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Windows Support #1035

Merged
merged 69 commits into from
Oct 29, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
39fb929
Bump pathwatcher and git-utils to Windows friendly ones
anaisbetts Oct 23, 2013
a8a28c8
Merge remote-tracking branch 'origin/master' into win-bootstrap-nativ…
Oct 24, 2013
e4fc15d
Remove cmake check since it is no longer required
kevinsawicki Oct 25, 2013
cdf439b
Upgrade apm for windows fix
kevinsawicki Oct 25, 2013
db44df0
Upgrade apm for windows fix
kevinsawicki Oct 25, 2013
11186f6
Upgrade to language-c@0.2.0
kevinsawicki Oct 25, 2013
0254812
Upgrade to language-css@0.2.0
kevinsawicki Oct 25, 2013
2a3a38a
Upgrade to language-git@0.2.0
kevinsawicki Oct 25, 2013
b9e3a8b
Upgrade to language-html@0.2.0
kevinsawicki Oct 25, 2013
aa2734f
Upgrade to language-hyperlink@0.3.0
kevinsawicki Oct 25, 2013
df6ebdd
Upgrade to language-java@0.2.0
kevinsawicki Oct 25, 2013
cf02563
Upgrade to language-javascript@0.3.0
kevinsawicki Oct 25, 2013
a201762
Upgrade to language-json@0.2.0
kevinsawicki Oct 25, 2013
71b9188
Upgrade to language-object-c@0.2.0
kevinsawicki Oct 25, 2013
f22732b
Upgrade to language-perl@0.2.0
kevinsawicki Oct 25, 2013
ece0ea2
Upgrade to language-php@0.2.0
kevinsawicki Oct 25, 2013
7aa57c4
Upgrade to language-puppet@0.2.0
kevinsawicki Oct 25, 2013
23b635d
Upgrade to language-python@0.2.0
kevinsawicki Oct 25, 2013
bafea9b
:lipstick: Sort language packages
kevinsawicki Oct 25, 2013
197291e
Upgrade to language-ruby-on-rails@0.3.0
kevinsawicki Oct 25, 2013
a0fb433
Upgrade to language-ruby@0.4.0
kevinsawicki Oct 25, 2013
78bb8b4
Upgrade to language-sass@0.3.0
kevinsawicki Oct 25, 2013
2e20c76
Upgrade to language-shellscript@0.2.0
kevinsawicki Oct 25, 2013
8bc9c9a
Upgrade to language-source@0.2.0
kevinsawicki Oct 25, 2013
9f4f3d2
Upgrade to language-sql@0.2.0
kevinsawicki Oct 25, 2013
17ebb07
Upgrade to language-text@0.2.0
kevinsawicki Oct 25, 2013
63cb53b
Upgrade to language-xml@0.2.0
kevinsawicki Oct 25, 2013
30c1124
Bump apm for visual studio fixes
Oct 25, 2013
ea9930d
Disable broken packages, for now
Oct 25, 2013
1842146
Upgrade to github-sign-in@0.9.0
kevinsawicki Oct 25, 2013
1d1a14b
Upgrade to gists@0.6.0
kevinsawicki Oct 25, 2013
6fa580f
Upgrade to symbols-view@0.15.0
kevinsawicki Oct 25, 2013
eba1e47
Upgrade to spell-check@0.9.0
kevinsawicki Oct 25, 2013
b02d906
Rebuild modules on Windows in `grunt update-atom-shell`
Oct 25, 2013
3fa7c8f
Handle the difference between atom-shell binaries
Oct 25, 2013
1cdb87f
Update to atom-shell v0.6.5.
zcbenz Oct 26, 2013
9605da9
Update apm for the check of vs express.
zcbenz Oct 26, 2013
010905d
Fix the "'true' is not found" error.
zcbenz Oct 28, 2013
50d2d5b
Upgrade to git-utils@0.28.0
kevinsawicki Oct 28, 2013
ad67abc
Upgrade to atom-shell@0.6.6
kevinsawicki Oct 28, 2013
6509157
Upgrade to pathwatcher@0.8.0
kevinsawicki Oct 28, 2013
6040221
Upgrade to scandal@0.6.0
kevinsawicki Oct 28, 2013
1931cb6
Upgrade to release-notes@0.9.0
kevinsawicki Oct 28, 2013
ffaaa21
Upgrade to collaboration@0.33.0
kevinsawicki Oct 28, 2013
83206ac
Upgrade to bootstrap@3.0.0
kevinsawicki Oct 28, 2013
8650675
Atom.app doesn't exist in windows releases
Oct 28, 2013
20c7f29
Install to program files on windows
kevinsawicki Oct 28, 2013
f9837aa
Split out win32 variable values
kevinsawicki Oct 28, 2013
cc3a2ab
Remove duplicate shell app dir cp
kevinsawicki Oct 28, 2013
cc42db3
Log to a file on windows, for now
Oct 28, 2013
1368b60
Merge branch 'win-bootstrap-native-modules' of https://github.com/ato…
Oct 28, 2013
cdd4c96
Handle walkdir error events
kevinsawicki Oct 28, 2013
af92c96
Wrap walkdir in try/catch
kevinsawicki Oct 28, 2013
41f6d6b
Remove trailing slash
kevinsawicki Oct 28, 2013
6364589
Check for existence before copying
kevinsawicki Oct 28, 2013
eae5a25
Upgrade to first-mate@0.5.0
kevinsawicki Oct 28, 2013
e21f1c1
Comment out nslog for now
Oct 28, 2013
e9bcb46
Only run copy-info-plist on darwin
kevinsawicki Oct 28, 2013
f81c64f
Don't use Contents directory on windows
kevinsawicki Oct 28, 2013
002fc57
Detect resolving absolute paths on windows
kevinsawicki Oct 28, 2013
d6159a3
Make project.resolve work on Windows
kevinsawicki Oct 28, 2013
cd9d6ca
Update variable name
kevinsawicki Oct 28, 2013
c4b24fe
Use Date.now()
kevinsawicki Oct 28, 2013
2f62123
Merge branch 'master' into win-bootstrap-native-modules
kevinsawicki Oct 29, 2013
9a4db9d
Only run set-development-version on mac
kevinsawicki Oct 29, 2013
668ef0b
Don't copy resources/mac on windows
kevinsawicki Oct 29, 2013
28a2b48
Bootstrap is no longer vendored
kevinsawicki Oct 29, 2013
22589bf
Require nslog on non-windows machines
kevinsawicki Oct 29, 2013
44213af
Upgrade apm for windows fixes
kevinsawicki Oct 29, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 22 additions & 8 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,24 @@ _ = require 'underscore-plus'
packageJson = require './package.json'

module.exports = (grunt) ->
appName = 'Atom.app'
[major, minor, patch] = packageJson.version.split('.')
tmpDir = if process.platform is 'win32' then os.tmpdir() else '/tmp'
buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build')
shellAppDir = path.join(buildDir, appName)
contentsDir = path.join(shellAppDir, 'Contents')
appDir = path.join(contentsDir, 'Resources', 'app')
installDir = path.join('/Applications', appName)
if process.platform is 'win32'
appName = 'Atom'
tmpDir = os.tmpdir()
installRoot = process.env.ProgramFiles
buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build')
shellAppDir = path.join(buildDir, appName)
appDir = path.join(shellAppDir, 'resources', 'app')
else
appName = 'Atom.app'
tmpDir = '/tmp'
installRoot = '/Applications'
buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build')
shellAppDir = path.join(buildDir, appName)
contentsDir = path.join(shellAppDir, 'Contents')
appDir = path.join(contentsDir, 'Resources', 'app')

installDir = path.join(installRoot, appName)

coffeeConfig =
options:
Expand Down Expand Up @@ -178,4 +188,8 @@ module.exports = (grunt) ->
grunt.registerTask('ci', ['update-atom-shell', 'build', 'set-development-version', 'lint', 'test'])
grunt.registerTask('deploy', ['partial-clean', 'update-atom-shell', 'build', 'codesign'])
grunt.registerTask('docs', ['markdown:guides', 'build-docs'])
grunt.registerTask('default', ['update-atom-shell', 'build', 'set-development-version', 'install'])

defaultTasks = ['update-atom-shell', 'build']
defaultTasks.push('set-development-version') if process.platform is 'darwin'
defaultTasks.push('install')
grunt.registerTask('default', defaultTasks)
68 changes: 34 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@
"bugs": {
"url": "https://github.com/atom/atom/issues"
},
"atomShellVersion": "0.6.4",
"atomShellVersion": "0.6.6",
"dependencies": {
"async": "0.2.6",
"bootstrap": "git://github.com/twbs/bootstrap.git#v3.0.0",
"clear-cut": "0.1.0",
"coffee-script": "1.6.3",
"coffeestack": "0.6.0",
"emissary": "0.6.0",
"first-mate": "0.4.0",
"first-mate": "0.5.0",
"fuzzaldrin": "0.1.0",
"git-utils": "0.26.0",
"git-utils": "0.28.0",
"guid": "0.0.10",
"jasmine-focused": "~0.15.0",
"mkdirp": "0.3.5",
"less-cache": "0.9.0",
"nslog": "0.1.0",
"oniguruma": "0.21.0",
"oniguruma": "0.22.0",
"optimist": "0.4.0",
"pathwatcher": "0.5.0",
"pathwatcher": "0.8.0",
"pegjs": "0.7.0",
"plist": "git://github.com/nathansobo/node-plist.git",
"q": "0.9.7",
"rimraf": "2.1.4",
"scandal": "0.5.0",
"scandal": "0.6.0",
"season": "0.13.0",
"semver": "1.1.4",
"space-pen": "2.0.0",
Expand Down Expand Up @@ -83,23 +83,23 @@
"find-and-replace": "0.32.0",
"fuzzy-finder": "0.15.0",
"gfm": "0.5.0",
"gists": "0.6.0",
"git-diff": "0.12.0",
"gists": "0.5.0",
"github-sign-in": "0.8.0",
"github-sign-in": "0.9.0",
"go-to-line": "0.8.0",
"grammar-selector": "0.8.0",
"image-view": "0.7.0",
"link": "0.7.0",
"markdown-preview": "0.12.0",
"metrics": "0.8.0",
"package-generator": "0.14.0",
"release-notes": "0.8.0",
"release-notes": "0.9.0",
"settings-view": "0.33.0",
"snippets": "0.11.0",
"spell-check": "0.8.0",
"spell-check": "0.9.0",
"status-bar": "0.15.0",
"styleguide": "0.9.0",
"symbols-view": "0.14.0",
"symbols-view": "0.15.0",
"tabs": "0.7.0",
"terminal": "0.14.0",
"timecop": "0.7.0",
Expand All @@ -110,41 +110,41 @@
"whitespace": "0.7.0",
"wrap-guide": "0.4.0",

"language-c": "0.1.0",
"language-c": "0.2.0",
"language-clojure": "0.1.0",
"language-coffee-script": "0.1.0",
"language-css": "0.1.0",
"language-git": "0.1.0",
"language-css": "0.2.0",
"language-git": "0.2.0",
"language-go": "0.2.0",
"language-html": "0.1.0",
"language-hyperlink": "0.2.0",
"language-java": "0.1.0",
"language-javascript": "0.2.0",
"language-json": "0.1.0",
"language-html": "0.2.0",
"language-hyperlink": "0.3.0",
"language-java": "0.2.0",
"language-javascript": "0.3.0",
"language-json": "0.2.0",
"language-less": "0.1.0",
"language-make": "0.1.0",
"language-mustache": "0.1.0",
"language-objective-c": "0.1.0",
"language-objective-c": "0.2.0",
"language-pegjs": "0.1.0",
"language-perl": "0.1.0",
"language-php": "0.1.0",
"language-perl": "0.2.0",
"language-php": "0.2.0",
"language-property-list": "0.2.0",
"language-puppet": "0.1.0",
"language-python": "0.1.0",
"language-ruby-on-rails": "0.2.0",
"language-ruby": "0.2.0",
"language-sass": "0.2.0",
"language-shellscript": "0.1.0",
"language-source": "0.1.0",
"language-sql": "0.1.0",
"language-text": "0.1.0",
"language-puppet": "0.2.0",
"language-python": "0.2.0",
"language-ruby": "0.4.0",
"language-ruby-on-rails": "0.3.0",
"language-sass": "0.3.0",
"language-shellscript": "0.2.0",
"language-source": "0.2.0",
"language-sql": "0.2.0",
"language-text": "0.2.0",
"language-todo": "0.2.0",
"language-xml": "0.1.0",
"language-xml": "0.2.0",
"language-yaml": "0.1.0"
},
"private": true,
"scripts": {
"preinstall": "true",
"test": "script/test"
"preinstall": "node -e 'process.exit(0)'",
"test": "node script/test"
}
}
11 changes: 0 additions & 11 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env node
var safeExec = require('./utils/child-process-wrapper.js').safeExec;
var exec = require('child_process').exec;
var path = require('path');

// Executes an array of commands one by one.
Expand All @@ -18,15 +17,6 @@ function joinCommands() {
return Array.prototype.slice.call(arguments, 0).join(commandSeparator);
}

function checkDependencies() {
exec("cmake -h", function(error) {
if (error) {
console.error("Error: cmake is required to build Atom.")
process.exit(1);
}
});
}

var echoNewLine = process.platform == 'win32' ? 'echo.' : 'echo';
var commands = [
'git submodule --quiet sync',
Expand All @@ -37,6 +27,5 @@ var commands = [
'node node_modules/.bin/apm install --silent'
];

checkDependencies()
process.chdir(path.dirname(__dirname));
executeCommands(commands, process.exit);
14 changes: 10 additions & 4 deletions src/browser/main.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
startTime = new Date().getTime()
startTime = Date.now()

autoUpdater = require 'auto-updater'
crashReporter = require 'crash-reporter'
Expand All @@ -8,11 +8,17 @@ fs = require 'fs'
module = require 'module'
path = require 'path'
optimist = require 'optimist'
nslog = require 'nslog'
# TODO: NSLog is missing .lib on windows
nslog = require 'nslog' unless process.platform is 'win32'
dialog = require 'dialog'

console.log = (args...) ->
nslog(args.map((arg) -> JSON.stringify(arg)).join(" "))
# TODO: Make NSLog work as expected
output = args.map((arg) -> JSON.stringify(arg)).join(" ")
if process.platform == 'darwin'
nslog(output)
else
fs.writeFileSync('debug.log', output, flag: 'a')

process.on 'uncaughtException', (error={}) ->
nslog(error.message) if error.message?
Expand Down Expand Up @@ -56,7 +62,7 @@ delegate.browserMainParts.preMainMessageLoopRun = ->
AtomApplication = require './atom-application'

AtomApplication.open(args)
console.log("App load time: #{new Date().getTime() - startTime}ms")
console.log("App load time: #{Date.now() - startTime}ms")

global.devResourcePath = path.join(app.getHomeDir(), 'github', 'atom')

Expand Down
14 changes: 13 additions & 1 deletion src/fs-utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ fsExtensions =
catch e
relativePath

# Public: Is the given path absolute?
#
# * pathToCheck:
# The relative or absolute path to check.
#
# Returns true if the path is absolute, false otherwise.
isAbsolute: (pathToCheck='') ->
if process.platform is 'win32'
pathToCheck[1] is ':' # C:\ style
else
pathToCheck[0] is '/' # /usr style

# Public: Returns true if a file or folder at the specified path exists.
exists: (pathToCheck) ->
# TODO: rename to existsSync
Expand Down Expand Up @@ -290,7 +302,7 @@ fsExtensions =
pathToResolve = args.pop()
loadPaths = args

if pathToResolve[0] is '/'
if @isAbsolute(pathToResolve)
if extensions and resolvedPath = @resolveExtension(pathToResolve, extensions)
return resolvedPath
else
Expand Down
2 changes: 1 addition & 1 deletion src/project.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class Project
if uri?.match(/[A-Za-z0-9+-.]+:\/\//) # leave path alone if it has a scheme
uri
else
uri = path.join(@getPath(), uri) unless uri[0] == '/'
uri = path.join(@getPath(), uri) unless fsUtils.isAbsolute(uri)
fsUtils.absolute uri

# Public: Make the given path relative to the project directory.
Expand Down
18 changes: 12 additions & 6 deletions tasks/build-task.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ module.exports = (grunt) ->

rm shellAppDir
mkdir path.dirname(buildDir)
cp 'atom-shell/Atom.app', shellAppDir

if process.platform is 'darwin'
cp 'atom-shell/Atom.app', shellAppDir
else if process.platform is 'win32'
cp 'atom-shell', shellAppDir

mkdir appDir

Expand All @@ -37,7 +41,6 @@ module.exports = (grunt) ->
path.join('git-utils', 'deps')
path.join('oniguruma', 'deps')
path.join('vendor', 'apm')
path.join('vendor', 'bootstrap', 'docs')
]
ignoredPaths = ignoredPaths.map (ignoredPath) -> "(#{ignoredPath})"
nodeModulesFilter = new RegExp(ignoredPaths.join('|'))
Expand All @@ -50,8 +53,11 @@ module.exports = (grunt) ->
cp 'src', path.join(appDir, 'src'), filter: /.+\.(cson|coffee)$/
cp 'static', path.join(appDir, 'static')

grunt.file.recurse path.join('resources', 'mac'), (sourcePath, rootDirectory, subDirectory='', filename) ->
unless /.+\.plist/.test(sourcePath)
grunt.file.copy(sourcePath, path.resolve(appDir, '..', subDirectory, filename))
if process.platform is 'darwin'
grunt.file.recurse path.join('resources', 'mac'), (sourcePath, rootDirectory, subDirectory='', filename) ->
unless /.+\.plist/.test(sourcePath)
grunt.file.copy(sourcePath, path.resolve(appDir, '..', subDirectory, filename))

grunt.task.run('compile', 'copy-info-plist')
dependencies = ['compile']
dependencies.push('copy-info-plist') if process.platform is 'darwin'
grunt.task.run(dependencies...)
30 changes: 18 additions & 12 deletions tasks/task-helpers.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ walkdir = require 'walkdir'

module.exports = (grunt) ->
cp: (source, destination, {filter}={}) ->
walkdir.sync source, (sourcePath, stats) ->
return if filter?.test(sourcePath)

destinationPath = path.join(destination, path.relative(source, sourcePath))
if stats.isSymbolicLink()
grunt.file.mkdir(path.dirname(destinationPath))
fs.symlinkSync(fs.readlinkSync(sourcePath), destinationPath)
else if stats.isFile()
grunt.file.copy(sourcePath, destinationPath)

if grunt.file.exists(destinationPath)
fs.chmodSync(destinationPath, fs.statSync(sourcePath).mode)
unless grunt.file.exists(source)
grunt.fatal("Cannot copy non-existent #{source.cyan} to #{destination.cyan}")

try
walkdir.sync source, (sourcePath, stats) ->
return if filter?.test(sourcePath)

destinationPath = path.join(destination, path.relative(source, sourcePath))
if stats.isSymbolicLink()
grunt.file.mkdir(path.dirname(destinationPath))
fs.symlinkSync(fs.readlinkSync(sourcePath), destinationPath)
else if stats.isFile()
grunt.file.copy(sourcePath, destinationPath)

if grunt.file.exists(destinationPath)
fs.chmodSync(destinationPath, fs.statSync(sourcePath).mode)
catch error
grunt.fatal(error)

grunt.log.writeln("Copied #{source.cyan} to #{destination.cyan}.")

Expand Down
1 change: 1 addition & 0 deletions tasks/update-atom-shell-task.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ module.exports = (grunt) ->
if newVersion and newVersion isnt previousVersion
grunt.log.writeln("Rebuilding native modules for new atom-shell version #{newVersion.cyan}.")
cmd = path.join('node_modules', '.bin', 'apm')
cmd += ".cmd" if process.platform is 'win32'
spawn {cmd, args: ['rebuild']}, (error) -> callback(error)
else
callback()
Expand Down