Пример #1
0
    def test_API(self):

        example = 'BST.py   # build (setup once + compile)'
        desc = 'Download the source code of a particular package from SVN. ' \
               'By default will fetch the HEAD revision, but with "--global" ' \
               'will checkout the revision that was used at last globalinstall ' \
               'time. Please note that certain SVN servers may require ' \
               'additional steps before connecting, such as setting up ' \
               '"authorized keys" or SSH agents.'

        argman = ArgsManagerV2.ArgsManager(desc)

        argman.addArgument(
            '-a',
            '--all',
            action='store_true',
            help='checkout full repository (not just specified version)')

        argman.addArgument('-g',
                           '--global',
                           action='store_true',
                           help='fetch last globally installed revision')

        argman.addExample(
            '%(prog)s -a Libraries/MasterClock/1.6       # full repository')
        argman.addExample(
            '%(prog)s -v -u monthy --global Libraries/MasterClock/1.6')
        argman.addExample(example)

        argman.setAllowUnknownArgs(True)

        args = vars(argman.run(['-v', '--all']))

        self.assertTrue(args['all'])
        self.assertTrue(args['verbose'])
        self.assertFalse(args['global'])
from __future__ import print_function

import logging

from ToolBOSCore.BuildSystem import BuildSystemTools
from ToolBOSCore.Tools import IntelliJ
from ToolBOSCore.Util import ArgsManagerV2
from ToolBOSCore.Util import FastScript

#----------------------------------------------------------------------------
# Commandline parsing
#----------------------------------------------------------------------------

desc = 'Turns a software package into a project for the JetBrains IntelliJ IDE.'

argman = ArgsManagerV2.ArgsManager(desc)

argman.addExample('cd MyPackage/1.0')
argman.addExample('%(prog)s')

argman.run()

#----------------------------------------------------------------------------
# Main program
#----------------------------------------------------------------------------

BuildSystemTools.requireTopLevelDir()

try:
    IntelliJ.createProject()
    FastScript.prettyPrintError('Now please execute: runIntelliJ.sh')