Skip to content

Commit

Permalink
Add --dep-as-jar option for idea-plugin (pantsbuild#8632)
Browse files Browse the repository at this point in the history
  • Loading branch information
wisechengyi authored Nov 26, 2019
1 parent 1b38c8f commit 415538a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
_TEMPLATE_BASEDIR = 'templates/idea'

# Follow `export.py` for versioning strategy.
IDEA_PLUGIN_VERSION = '0.0.3'
IDEA_PLUGIN_VERSION = '0.0.4'


class IdeaPluginGen(ConsoleTask):
Expand Down Expand Up @@ -62,6 +62,8 @@ def register_options(cls, register):
register('--incremental-import', type=int, default=None,
help='Enable incremental import of targets with the given graph depth. Supported '
'by IntelliJ Pants plugin versions `>= 1.9.2`.')
register('--dep-as-jar', type=bool, default=False,
help='If true, treat source dependencies as 3rdparty jars.')
register('--java-encoding', default='UTF-8',
help='Sets the file encoding for java files in this project.')
register('--open-with', type=str, default=None, recursive=True,
Expand Down Expand Up @@ -139,6 +141,7 @@ def generate_project(self):
project_path=os.path.join(get_buildroot(), abs_target_specs[0].split(':')[0]),
idea_plugin_version=IDEA_PLUGIN_VERSION,
incremental_import=self.get_options().incremental_import,
dep_as_jar=self.get_options().dep_as_jar,
)

# Generate (without merging in any extra components).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
{{#workspace.incremental_import?}}
<property name="incremental_import" value="{{workspace.incremental_import}}" />
{{/workspace.incremental_import?}}
<property name="dep_as_jar" value="{{workspace.dep_as_jar}}" />
</component>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def _do_check(self, project_dir_path, expected_project_path, expected_targets,
'targets',
'project_path',
'pants_idea_plugin_version',
'incremental_import'
'incremental_import',
'dep_as_jar'
}
self.assertTrue({p.getAttribute('name')
for p in actual_properties}.issubset(valid_property_names))
Expand Down

0 comments on commit 415538a

Please sign in to comment.