mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Improve code builder for parallel builds (up to 4 times faster than before)
This commit is contained in:
@ -7,6 +7,7 @@ PlatformIO 2.0
|
|||||||
2.5.0 (2015-12-??)
|
2.5.0 (2015-12-??)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* Improved code builder for parallel builds (up to 4 times faster than before)
|
||||||
* Generate `.travis.yml <http://docs.platformio.org/en/latest/ci/travis.html>`__
|
* Generate `.travis.yml <http://docs.platformio.org/en/latest/ci/travis.html>`__
|
||||||
CI config for embedded projects by default
|
CI config for embedded projects by default
|
||||||
(`issue #354 <https://github.com/platformio/platformio/issues/354>`_)
|
(`issue #354 <https://github.com/platformio/platformio/issues/354>`_)
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
VERSION = (2, 5, "0.dev0")
|
VERSION = (2, 5, "0.dev1")
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from imp import load_source
|
from imp import load_source
|
||||||
|
from multiprocessing import cpu_count
|
||||||
from os.path import isdir, isfile, join
|
from os.path import isdir, isfile, join
|
||||||
|
|
||||||
import click
|
import click
|
||||||
@ -389,6 +390,8 @@ class BasePlatform(object):
|
|||||||
[
|
[
|
||||||
"scons",
|
"scons",
|
||||||
"-Q",
|
"-Q",
|
||||||
|
"-j %d" % self.get_job_nums(),
|
||||||
|
"--warn=no-no-parallel-support",
|
||||||
"-f", join(util.get_source_dir(), "builder", "main.py")
|
"-f", join(util.get_source_dir(), "builder", "main.py")
|
||||||
] + variables + targets,
|
] + variables + targets,
|
||||||
stdout=util.AsyncPipe(self.on_run_out),
|
stdout=util.AsyncPipe(self.on_run_out),
|
||||||
@ -432,3 +435,9 @@ class BasePlatform(object):
|
|||||||
self._last_echo_line = line
|
self._last_echo_line = line
|
||||||
|
|
||||||
click.secho(line, fg=fg, err=level < 3)
|
click.secho(line, fg=fg, err=level < 3)
|
||||||
|
|
||||||
|
def get_job_nums(self):
|
||||||
|
try:
|
||||||
|
return cpu_count()
|
||||||
|
except NotImplementedError:
|
||||||
|
return 1
|
||||||
|
Reference in New Issue
Block a user