Commit Graph

4958 Commits

Author SHA1 Message Date
Martijn Walraven
ef78afbca6 Fix CordovaProject#updatePlatforms 2015-08-26 19:26:55 +02:00
Martijn Walraven
a5a5b4c758 Use parsed run targets to detect a run on a device
This fixes a bug where test-packages on a device sets localhost as the
mobile server URL.
2015-08-26 19:26:55 +02:00
Martijn Walraven
0980cd8d04 Add log filtering and formatting for Android 2015-08-26 19:26:55 +02:00
Martijn Walraven
b2c5ff4d5a Allow specifying a destination option for execFileSync/Async
If specified, instead of capturing the output, the child process stdout
will be piped to the destination stream.

Although the standard spawn stdio option lets you pass in streams,
these have to be connected to an open file descriptor. The destination
option allows you to use any Writable, so it can be used with a
Transform for instance.
2015-08-26 19:26:55 +02:00
Martijn Walraven
df708d7309 Add first version of tailing logs on Android 2015-08-26 19:26:55 +02:00
Martijn Walraven
e55c9f46c4 Replace execFile with execFileSync when opening Xcode project 2015-08-26 19:26:54 +02:00
Martijn Walraven
a5b49b8aa4 Exit when running platforms are removed or plugins changed 2015-08-26 19:26:54 +02:00
Martijn Walraven
a5784d54b6 Don't rebuild packages immediately after add/remove platform
This happens automatically before build/run.
2015-08-26 19:26:54 +02:00
Martijn Walraven
1407143e9f Make CordovaProject#run use the new execFileAsync with waitForClose false
This fixes an issue where starting up the Android Emulator with stdio
piped would only exit when the emulator exits, instead of when the app
is successfully installed, thus blocking further startup.

The reason for this was that cordova-lib superspawn listens for the
‘close’ event of its child process, which is emitted when the stdio
streams have all terminated. If those streams are shared with other
processes (such as further child processes spawned by the child
process), that means we won't receive a 'close' until all processes
have exited, so we should listen for 'exit' instead.
2015-08-26 19:26:54 +02:00
Martijn Walraven
63461fcd8f Remove unused RunCommand and add promise-based execFileSync/Async
The execFileSync function is meant to resemble the similarly-named Node
0.12 synchronous process creation API, but instead of being fully
blocking it uses a promise-based implementation. You can also use
execFileAsync directly, which returns a promise.

Some functionality is currently missing but could be added when the
need arises (e.g. support for timeout, maxBuffer, and encoding options).

Eventually, these versions should replace the ones in
tools/utils/utils.js and tools/tool-testing/selftest.js.
2015-08-26 19:26:54 +02:00
Martijn Walraven
0538dc1f28 Some changes to the buildmessage structure and job naming 2015-08-26 19:26:54 +02:00
Martijn Walraven
1a4e940529 Create Cordova project from generated config.xml
We now create a temporary directory with a generated config.xml
to use as a template for creating the Cordova project. This way, we are
not dependent on the contents of cordova-app-hello-world but we base
our initial project state on our own defaults and optionally a
mobile-config.js.

This change was in part motivated by a bug in Cordova where changing
the app name to a version with a different case, on a case insensitive
file system like OS X, means the project will no longer build. Because
our app name on creation was based on the project directory and we
didn’t respect the app name set in mobile-config.js until the first
build, there was always a rename needed, triggering the bug.

This bug affected both the todos and localmarket example apps.
2015-08-26 19:26:54 +02:00
Martijn Walraven
4300e1b4f4 Call platform run script ourselves instead of leaving this to cordova-lib
Using cordova.raw.run() would swallow the error superspawn created from
the underlying error output, so we’re now calling the platform run
script ourselves and potentially receive an error through the promise.

Not relying on cordova-lib also means preparing the platform is no
longer done automatically for us. This means you'll have to make sure
CordovaProject#prepareForPlatform() is called before running. We do
this for all the current run target’s platforms in
CordovaRunner#prepareProject().

(We don’t do it automatically within CordovaProject#run because this
way the prepare is not part of ‘Starting …’, and also because running
multiple targets of the same platform would mean unnecessarily running
prepare multiple times).
2015-08-26 19:26:53 +02:00
Martijn Walraven
a880a8b709 Don't start run targets in parallel until we figure out a good UX for this
This would likely involve some kind of concurrent progress display, but
we might also need to revise logging as we don’t want ongoing logs to
mess up the progress status.
2015-08-26 19:26:53 +02:00
Martijn Walraven
db0d6ca41d Fix tests for parseServerOptionsForRunCommand that stopped working due to recent changes 2015-08-26 19:26:53 +02:00
Martijn Walraven
f96ab94f7c Remove failing check in test that assumes we uninstall all plugins on error
I’ve removed the code that uninstalls all plugins on error because
there is no indication this is still an issue (nothing found on the
Cordova JIRA).
2015-08-26 19:26:53 +02:00
Martijn Walraven
68607c39f9 Add Cordova CLI dependency to dev bundle and use it from tests 2015-08-26 19:26:53 +02:00
Martijn Walraven
e25ccacac7 Fix indentation in tools/cli/commands.js 2015-08-26 19:26:53 +02:00
Martijn Walraven
06e955951a Fix typo in tools/cordova/README.md 2015-08-26 19:26:53 +02:00
Martijn Walraven
5cb18f3559 Whitespace fixes in tools/cli/commands.js 2015-08-26 19:26:53 +02:00
Martijn Walraven
f1bc608d51 Remove unnecessary try/catches for utils.parseUrl() 2015-08-26 19:26:52 +02:00
Martijn Walraven
3c529ef540 Add clarifying comment to cordova.filterPlatforms() 2015-08-26 19:26:52 +02:00
Martijn Walraven
5b00fa1fac Print link to host and platform-specific Wiki page for install-sdk command 2015-08-26 19:26:52 +02:00
Martijn Walraven
fffc3833c2 Remove undocumented android-launch command 2015-08-26 19:26:52 +02:00
Martijn Walraven
3b9b09d591 Fix Cordova project template path 2015-08-26 19:26:52 +02:00
Martijn Walraven
a1e68d84fb Fix line length for tools/cordova/README.md 2015-08-26 19:26:52 +02:00
Martijn Walraven
b03455f382 Re-enable netroute for platforms other than win32 2015-08-26 19:26:52 +02:00
Martijn Walraven
0bf177411d Fix project creation by specifying path to template on create 2015-08-26 19:26:52 +02:00
Martijn Walraven
5777018f36 Stop using superspawn hack and just save and restore env 2015-08-26 19:26:52 +02:00
Martijn Walraven
982d854660 Add ios-sim path to all commands and not just the run target 2015-08-26 19:26:51 +02:00
Martijn Walraven
b5d2e828e8 Make sure we only accept Git URLs with a SHA reference as plugin target 2015-08-26 19:26:51 +02:00
Martijn Walraven
b71325f177 Some changes to tools/cordova/README.md 2015-08-26 19:26:51 +02:00
Martijn Walraven
652d116dcf Some cosmetic changes and comments 2015-08-26 19:26:51 +02:00
Martijn Walraven
5ad4f822b2 Add ios-sim path instead of npm bin from the cordova package 2015-08-26 19:26:51 +02:00
Martijn Walraven
af70287656 Remove cordova package and put cordova-lib and ios-sim back into the dev bundle 2015-08-26 19:26:51 +02:00
Martijn Walraven
ba8c8f17ad Move control over build process from builder to project 2015-08-26 19:26:51 +02:00
Martijn Walraven
6ffd018ee7 Show OS converted path in error message 2015-08-26 19:26:51 +02:00
Martijn Walraven
e638fb828a Fix opening Xcode project for run ios-device 2015-08-26 19:26:51 +02:00
Martijn Walraven
6e622a36f6 Revert "Temporarily print errors until meteor-promise exception handling is fixed"
See https://github.com/meteor/promise/issues/2.
2015-08-26 19:26:50 +02:00
Martijn Walraven
141e800c9c Keep track of when Cordova runner has been started to not just start on first run 2015-08-26 19:26:50 +02:00
Martijn Walraven
59e16c3408 Starting run targets should happen within a capture 2015-08-26 19:26:50 +02:00
Martijn Walraven
b7857e4c1f Pass config attributes to plugin add 2015-08-26 19:26:50 +02:00
Martijn Walraven
09473594aa Add a buildmessage instead of throwing an exception when processing mobile-config.js 2015-08-26 19:26:50 +02:00
Martijn Walraven
22cce1c316 Improve debug output and error reporting 2015-08-26 19:26:50 +02:00
Martijn Walraven
f8f847ff1f Resolve plugin path to absolute local path and check if directory exists 2015-08-26 19:26:50 +02:00
Martijn Walraven
c3238b2ba9 Combine installed plugins with fetched plugins metadata 2015-08-26 19:26:50 +02:00
Martijn Walraven
56550d9b13 Remove unused paths from CordovaProject 2015-08-26 19:26:50 +02:00
Martijn Walraven
dccd43848c First version of tools/cordova/README.md 2015-08-26 19:26:49 +02:00
Martijn Walraven
2165a6b6eb Let Cordova install plugins from Git instead of downloading tarballs
This also fixes a problem where we were reinstalling all plugins on
every build.
2015-08-26 19:26:49 +02:00
Martijn Walraven
7716e587e6 Change installedPlatforms property to listInstalledPlatforms() 2015-08-26 19:26:49 +02:00