How to use the tmt.args function in tmt

To help you get started, we’ve selected a few tmt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thewca / tnoodle / server / tmtproject.py View on Github external
def compile(self):
		tmt.EclipseProject.compile(self)
		context = ''

		# We don't necessarily want all the plugins in self.plugins to load here,
		# we only want the ones that the project we're currently building somehow
		# depends on.
		deps = tmt.TmtProject.projects[tmt.args.project].getRecursiveDependenciesTopoSorted()

		for project in self.plugins.values():
			if project not in deps:
				continue
			contextFileName = project.contextFileName
			assert exists(contextFileName)

			if project != self:
				linkName = join(self.serverPluginBinDir, project.name)
				dest = relpath(project.serverPluginPackageBinDir, self.serverPluginBinDir)
				linkUpToDate = False
				if os.path.islink(linkName):
					linkTo = os.readlink(linkName)
					if linkTo == dest.replace(os.sep, '/'):
						linkUpToDate = True
				if not linkUpToDate:
github thewca / tnoodle / winstone / tmtproject.py View on Github external
def needsDb(self):
        if getattr(tmt.args, "project", None) is None:
            # None may not yet be a key in tmt.TmtProject.projects,
            # we just hack around this by unconditionally returning True here.
            return True
        webProject = tmt.TmtProject.projects[tmt.args.project]
        if webProject == self:
            return True
        deps = webProject.getRecursiveDependenciesTopoSorted(exclude=set([self]))

        for project in deps:
            if project in list(self.plugins.values()):
                if project.needsDb:
                    return True

        return False
github thewca / tnoodle / winstone / tmtproject.py View on Github external
def needsDb(self):
        if getattr(tmt.args, "project", None) is None:
            # None may not yet be a key in tmt.TmtProject.projects,
            # we just hack around this by unconditionally returning True here.
            return True
        webProject = tmt.TmtProject.projects[tmt.args.project]
        if webProject == self:
            return True
        deps = webProject.getRecursiveDependenciesTopoSorted(exclude=set([self]))

        for project in deps:
            if project in list(self.plugins.values()):
                if project.needsDb:
                    return True

        return False
github thewca / tnoodle / stackmat-flash / tmtproject.py View on Github external
def innerCompile(self, src, tempBin, bin):
        if src == self.src:
            if not self.mxmlcInstalled:
                # Couldn't find mxmlc with which to compile,
                # Note that there's a symlink from the src_tnoodle_resources
                # directory to the generated stackmat-flash/bin/StackApplet.swf.
                # This allows people without the flex sdk installed to work on tnoodle.
                # Fortunately, we don't follow symlinks when evaluating whether
                # a project needs to be rebuilt, so this symlink hack doesn't
                # force infinite rebuilds if mxmlc is installed.
                if not tmt.args.skip_noflex_warning:
                    realOutSwf = self.APPLET_FILENAME
                    print("""\n\nWARNING: It appears you do not have the flex sdk installed (specifically the mxmlc binary), which is needed to build stackmat-flash. I'm going to go ahead and use the version of %s from the git repository.""" % ( realOutSwf ))
                self.checkoutSwf(tempBin)
            else:
                # Wowow, you've gotta love it when you have such great tools
                asFile = join(src, 'StackApplet.as')
                if exists(asFile):
                    assert self.mxmlcInstalled
                    outSwf = self.APPLET_FILENAME
                    retVal, stdout, stderr = tmt.runCmd([ 'mxmlc', '-benchmark=True', '-creator=tnoodle', '-static-link-runtime-shared-libraries=true', '-output=%s' % outSwf, asFile ], showStatus=True)
                    assert retVal == 0

                    # Yikes. mxmlc doesn't seem to have any command line args to treat
                    # warnings as errors. Look what they've made me do!
                    assert len(stderr) == 0