Beispiel #1
0
  def setup_parser(self, parser, args):
    Ide.setup_parser(self, parser, args)

    supported_versions = list(_VERSIONS.keys())
    supported_versions.sort()
    parser.add_option("-i", "--idea-version", dest = "version",
                      default = '10', type = "choice", choices = supported_versions,
                      help = "[%%default] The IntelliJ IDEA version the project configuration "
                      "should be generated for; can be one of: %s" % supported_versions)

    parser.add_option("-o", "--idea-project-file-dir", dest = "project_file_dir",
                      default = self.root_dir, help = "[%default] Specifies the directory to "
                      "output the generated project files to.")
    parser.add_option("--nomerge", action = "store_true", dest = "nomerge",
                      default = False, help = "Stomp any manual customizations in existing "
                      "Intellij IDEA configuration. If unspecified, manual customizations will be "
                      " merged into the new configuration.")
    parser.add_option("--idea-build-output-dir", dest = "intellij_output_dir",
                      default = os.path.join(self.root_dir, 'target/intellij/out'),
                      help = "[%default] Specifies the directory IntelliJ IDEA should use for its "
                      "own build output.")
    parser.add_option("-b", "--bash", action = "store_true", dest = "bash",
                      default = False, help = "Adds a bash facet to the generated project "
                      "configuration.")
    parser.add_option("-f", "--fsc", action = "store_true", dest = "fsc",
                      default = False, help = "If the project contains any scala targets this "
                      "specifies the fsc compiler should be enabled.")
    parser.add_option("-e", "--java-encoding", dest = "java_encoding",
                      default = "UTF-8", help = "[%default] Sets the file encoding for java files "
                      "in this project.")
    parser.epilog = """Creates an IntelliJ IDEA project appropriate for editing, debugging and
Beispiel #2
0
    def setup_parser(self, parser, args):
        Ide.setup_parser(self, parser, args)

        supported_versions = list(_VERSIONS.keys())
        supported_versions.sort()
        parser.add_option(
            "-i",
            "--idea-version",
            dest="version",
            default='10',
            type="choice",
            choices=supported_versions,
            help=
            "[%%default] The IntelliJ IDEA version the project configuration "
            "should be generated for; can be one of: %s" % supported_versions)

        parser.add_option("-o",
                          "--idea-project-file-dir",
                          dest="project_file_dir",
                          default=self.root_dir,
                          help="[%default] Specifies the directory to "
                          "output the generated project files to.")
        parser.add_option(
            "--nomerge",
            action="store_true",
            dest="nomerge",
            default=False,
            help="Stomp any manual customizations in existing "
            "Intellij IDEA configuration. If unspecified, manual customizations will be "
            " merged into the new configuration.")
        parser.add_option(
            "--idea-build-output-dir",
            dest="intellij_output_dir",
            default=os.path.join(self.root_dir, 'target/intellij/out'),
            help=
            "[%default] Specifies the directory IntelliJ IDEA should use for its "
            "own build output.")
        parser.add_option("-b",
                          "--bash",
                          action="store_true",
                          dest="bash",
                          default=False,
                          help="Adds a bash facet to the generated project "
                          "configuration.")
        parser.add_option(
            "-f",
            "--fsc",
            action="store_true",
            dest="fsc",
            default=False,
            help="If the project contains any scala targets this "
            "specifies the fsc compiler should be enabled.")
        parser.add_option(
            "-e",
            "--java-encoding",
            dest="java_encoding",
            default="UTF-8",
            help="[%default] Sets the file encoding for java files "
            "in this project.")
        parser.epilog = """Creates an IntelliJ IDEA project appropriate for editing, debugging and
Beispiel #3
0
  def __init__(self, root_dir, parser, argv):
    Ide.__init__(self, root_dir, parser, argv)

    idea_version = _VERSIONS[self.options.version]
    self.project_template = os.path.join(_TEMPLATE_BASEDIR, 'project-%s.mk' % idea_version)
    self.module_template = os.path.join(_TEMPLATE_BASEDIR, 'module-%s.mk' % idea_version)

    project_file_dir = os.path.abspath(self.options.project_file_dir)
    if not os.path.exists(project_file_dir):
      os.makedirs(project_file_dir)

    self.project_filename = os.path.join(project_file_dir, '%s.ipr' % self.project_name)
    self.module_filename = os.path.join(project_file_dir, '%s.iml' % self.project_name)
Beispiel #4
0
    def __init__(self, root_dir, parser, argv):
        Ide.__init__(self, root_dir, parser, argv)

        idea_version = _VERSIONS[self.options.version]
        self.project_template = os.path.join(_TEMPLATE_BASEDIR,
                                             'project-%s.mk' % idea_version)
        self.module_template = os.path.join(_TEMPLATE_BASEDIR,
                                            'module-%s.mk' % idea_version)

        project_file_dir = os.path.abspath(self.options.project_file_dir)
        if not os.path.exists(project_file_dir):
            os.makedirs(project_file_dir)

        self.project_filename = os.path.join(project_file_dir,
                                             '%s.ipr' % self.project_name)
        self.module_filename = os.path.join(project_file_dir,
                                            '%s.iml' % self.project_name)
Beispiel #5
0
  def testInterpolation(self):
    testFileContents = '''
base.dir=${root.dir}/base
sub.dir.1=${base.dir}/a
sub.dir.2=${base.dir}/b

checkstyle.suppression.files=\
${sub.dir.1}/checkstyle_suppressions.xml,\
${sub.dir.2}/checkstyle_suppressions.xml
    '''
    result = Ide._find_checkstyle_suppressions(testFileContents, '/root')
    self.assertEquals(['/root/base/a/checkstyle_suppressions.xml',
                       '/root/base/b/checkstyle_suppressions.xml' ], result)
Beispiel #6
0
    def testInterpolation(self):
        testFileContents = '''
base.dir=${root.dir}/base
sub.dir.1=${base.dir}/a
sub.dir.2=${base.dir}/b

checkstyle.suppression.files=\
${sub.dir.1}/checkstyle_suppressions.xml,\
${sub.dir.2}/checkstyle_suppressions.xml
    '''
        result = Ide._find_checkstyle_suppressions(testFileContents, '/root')
        self.assertEquals([
            '/root/base/a/checkstyle_suppressions.xml',
            '/root/base/b/checkstyle_suppressions.xml'
        ], result)