def setUp( self, useScm = False, useEnvironments = False ): MomTestCase.setUp( self, False ) sys.argv = [] # reset command line arguments build = Build( name = 'XmlReportTestBuild' ) project = Project( 'XmlReportTestProject' ) build.setProject( project ) if useScm: project.createScm( 'git://github.com/KDAB/Make-O-Matic.git' ) if useEnvironments: environments = Environments( [ 'dep-a-1.?.0' ], 'Test dependency', project ) else: environments = Environments() # add some plugin dox = DoxygenGenerator() dox.setEnabled( False ) project.addPlugin( dox ) # add some configurations Configuration( 'Debug', environments ) Configuration( 'Release', environments ) build.getSettings().set( Settings.EnvironmentsBaseDir, self.TEST_MOM_ENVIRONMENTS ) self.build = build self.project = project self.cwd = os.getcwd()
def getProject( build, name, url, version, revision, branch, tag, versionName ): '''Create a standard default getProject object. A default project will have a ConsoleLogger, and a ConsoleReporter. makeProject will also parse the configuration files. ''' project = Project( name ) # the command line parameter takes precedence url = build.getParameters().getScmLocation() or url revision = build.getParameters().getRevision() or revision if build.getParameters().getBranch() or build.getParameters().getTag(): # if either branch or tag are specified on the command line, reset both and only use the command line selection: branch = None tag = None branch = build.getParameters().getBranch() or branch tag = build.getParameters().getTag() or tag mApp().getSettings().set( Settings.ProjectVersionNumber, version ) mApp().getSettings().set( Settings.ProjectVersionName, versionName ) mApp().getSettings().set( Settings.ProjectSourceLocation, url ) mApp().getSettings().set( Settings.ProjectRevision, revision ) mApp().getSettings().set( Settings.ProjectBranch, branch ) mApp().getSettings().set( Settings.ProjectTag, tag ) project.createScm( url, branch, tag, revision ) build.setProject( project ) return project