コード例 #1
0
    def Build(self):
        util.MakeParentDir(self.GetBuildDirectory())
        filecache.Purge(self.target)

        cmd = action.BuildCommand('mxmlc', 'flex build %s' % self.GetName())

        cmd.AddParamPath('-o', self.target)

        for lib in self.libs:
            cmd.Add('-compiler.library-path+=%s' % lib.target)

        for ext in self.ext_libs:
            cmd.Add('-compiler.library-path+=%s' % ext.GetPath())

        for s in self.sources:
            cmd.AddPath(s.GetPath())

        result = cmd.Run()
        # Strip output on success
        # TODO: Move to a Flex Binary base class
        if result.success:
            if (re.search('^Loading configuration file', result.output[0])
                    and re.search('\.swf \(\d+ bytes\)$', result.output[1])):
                result.output = []

        return result
コード例 #2
0
    def Clean(self):
        # TODO: Do we want this to run very often?

        if os.path.isdir(self.GetBuildDirectory()):
            return action.BuildCommand(
                'make uninstall && make clean',
                desc='uninstalled %s' % self.GetName(),
                work_dir=self.GetBuildDirectory()).Run()
        else:
            return None
コード例 #3
0
    def Build(self):
        util.MakeParentDir(self.target)
        filecache.Purge(self.target)

        cmd = action.BuildCommand('ar', 'build %s' % self.GetName())
        cmd.Add('rcs')
        cmd.AddPath(self.target)

        for o in sorted(self.objects, util.CompareName):
            cmd.AddPath(o.GetTargetName())

        return cmd.Run()
コード例 #4
0
  def Build(self):
    util.MakeDir(self.GetBuildDirectory())
    for target in self.targets.values():
      filecache.Purge(target.GetPath())

    self.CreatePythonTrail()

    cmd = action.BuildCommand('protoc', 'proto-compile %s' % self.GetName())  # Protocol Buffer Compiler
    cmd.Add('--as3_out=%s' % util.BuildPath())
    cmd.Add('--cpp_out=%s' % util.BuildPath())
    cmd.Add('--python_out=%s' % util.BuildPath())
    cmd.Extend('--proto_path=%s' % util.RelPath(dir) for dir in self.import_dirs)

    cmd.AddPath(self.source)
    return cmd.Run()
コード例 #5
0
    def Clean(self):
        # TODO: Need better way for Clean() to run multiple commands

        if os.path.isdir(self.GetBuildDirectory()):
            # 'distclean' make target cleans everything, incluing ./configure output.
            result = action.BuildCommand(
                'make distclean',
                desc='cleaned %s' % self.GetName(),
                work_dir=self.GetBuildDirectory()).Run()

            shutil.rmtree(self.GetBuildDirectory())

            return result
        else:
            return None
コード例 #6
0
    def Build(self):
        util.MakeDir(self.GetBuildDirectory())
        for t in self.library_targets:
            filecache.Purge(t.GetPath())

        # This 'installs' the libraries to our build directory (specified
        # by AutomakeConfig's build step.
        cmd = action.BuildCommand(action='make install',
                                  desc='automake %s' % self.GetName(),
                                  work_dir=self.GetBuildDirectory())
        result = cmd.Run()

        # if an automake project succeeds, we don't care about the output
        if result.success and not flags.verbose:
            result.output = []

        return result
コード例 #7
0
    def Build(self):
        util.MakeParentDir(self.target)
        filecache.Purge(self.target)

        cmd = action.BuildCommand('g++', 'compile %s' % self.GetName())
        cmd.Add('-Wall')
        cmd.Add('-c')
        if flags.debug:
            cmd.Add('-g')
        cmd.AddFlags(self.cc_flags)

        cmd.AddParamPath('-o', self.target)
        cmd.AddPath(self.source)

        for dir in self.include_dirs:
            cmd.AddParamPath('-I', dir)
        return cmd.Run()
コード例 #8
0
    def Build(self):
        util.MakeParentDir(self.target)
        filecache.Purge(self.target)

        cmd = action.BuildCommand('g++', 'link %s' % self.GetName())
        if flags.debug:
            cmd.Add('-g')
        cmd.AddFlags(self.ld_flags)
        cmd.AddParamPath('-o', self.target)

        for o in self.objects:
            cmd.AddPath(o.GetTargetName())

        for lib in self.OrderedLibraries():
            cmd.AddPath(lib.GetTargetName())

        for lib in self.ext_libs:
            cmd.Add('-l' + lib)

        return cmd.Run()
コード例 #9
0
    def NeedsBuild(self, timestamp):

        if timestamp > self.GetModifyTime():
            return True

        # THis is a very fast check that avoids calling the makefile on every infocation
        # (as below). The disadvantage is that it makes very risky assumptions that
        # the package only needs to be rebuilt if the ./configure targets are modified.
        return False

        # It should be rare for automake projects to require a build.
        # So we need to make it very fast to return 'false'.
        # We'll try running make in 'question' mode, but that might not be fast engouh.
        # Also , by checking here, we prevent the standard 'Clean' command from
        # being called before 'Build', which forces a rebuild every time.
        cmd = action.BuildCommand(action='make',
                                  work_dir=self.GetBuildDirectory())
        cmd.Add(
            '-q'
        )  # 'Question mode': Returns 0 if no build needed, 1 otherwise.
        result = cmd.Run()
        return not result.success
コード例 #10
0
    def Build(self):
        for target in self.targets:
            filecache.Purge(target)

        shutil.copytree(self.GetDirectory(), self.GetBuildDirectory())

        cmd = action.BuildCommand(
            action=
            './configure',  #os.path.join(util.AbsPath(self.GetDirectory()), 'configure'),
            desc='configure %s' % self.GetName(),
            work_dir=self.GetBuildDirectory())
        #cmd.Add('-C')  # Cache results -- not sure if this works/helps
        cmd.Add('--prefix="%s"' % util.AbsPath(self.install_dir))
        cmd.AddFlags(self.configure_flags)

        # TODO: Add optimization flags for -opt builds

        result = cmd.Run()
        # if an automake project succeeds, we don't care about the output
        if result.success and not flags.verbose:
            result.output = []

        return result