Move from target logic to steps logic.

This is the big change !!!!

Instead of handling target as primary object and prepare/build targets,
we are handling build steps.

A build step may be a source (preparation) or a build (of the source).
Actualy, a step is a tuple (context, Builder or Source).

The context define the context of the step. It can be :
- 'source', for a Source step
- 'neutral' or the name of a platform for Build step.

Target becomes a "Class only" class.
This commit is contained in:
Matthieu Gautier
2018-05-28 15:42:30 +02:00
parent 754df8df1d
commit 041826d0e8
17 changed files with 393 additions and 233 deletions

View File

@ -7,6 +7,7 @@ from .base import (
)
from kiwixbuild.utils import Remotefile, pj, Defaultdict, SkipCommand
from kiwixbuild._global import get_target_step
class LibMagicBase(Dependency):
name = "libmagic"
@ -48,7 +49,7 @@ class LibMagic_cross_compile(LibMagicBase):
make_target=self.make_target,
make_option=self.make_option
)
libmagic_native_dep = self.buildEnv.targetsDict['libmagic_native']
libmagic_native_builder = get_target_step('libmagic_native', self.buildEnv.platformInfo.name)
env = Defaultdict(str, os.environ)
env['PATH'] = ':'.join([pj(libmagic_native_dep.builder.build_path, 'src'), env['PATH']])
env['PATH'] = ':'.join([pj(libmagic_native_builder.build_path, 'src'), env['PATH']])
self.buildEnv.run_command(command, self.build_path, context, env=env)