Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Commit

Permalink
Add target id to export
Browse files Browse the repository at this point in the history
Allows the intellij pants plugin to find the classpath based on the target id, without computing the target id in the plugin.

Testing Done:
Green: https://travis-ci.org/pantsbuild/pants/builds/100217667

Bugs closed: 2764

Reviewed at https://rbcommons.com/s/twitter/r/3291/
  • Loading branch information
wisechengyi authored and stuhood committed Jan 6, 2016
1 parent 046fb8c commit cc17780
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/python/pants/backend/project_info/tasks/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@


# Changing the behavior of this task may affect the IntelliJ Pants plugin.
# Please add fkorotkov, tdesai to reviews for this file.
# Please add tdesai to reviews for this file.
class ExportTask(IvyTaskMixin, PythonTask):
"""Base class for generating a json-formattable blob of data about the target graph.
Expand All @@ -56,7 +56,7 @@ class ExportTask(IvyTaskMixin, PythonTask):
#
# Note format changes in src/python/pants/docs/export.md and update the Changelog section.
#
DEFAULT_EXPORT_VERSION = '1.0.4'
DEFAULT_EXPORT_VERSION = '1.0.5'

@classmethod
def subsystem_dependencies(cls):
Expand Down Expand Up @@ -187,6 +187,7 @@ def get_target_type(target):
'targets': [],
'libraries': [],
'roots': [],
'id': current_target.id,
'target_type': get_target_type(current_target),
'is_code_gen': current_target.is_codegen,
'pants_target_type': self._get_pants_target_alias(type(current_target))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def test_without_dependencies(self):

def test_version(self):
result = self.execute_export_json('project_info:first')
self.assertEqual('1.0.4', result['version'])
self.assertEqual('1.0.5', result['version'])

def test_sources(self):
self.set_options(sources=True)
Expand Down Expand Up @@ -247,6 +247,7 @@ def test_jvm_target(self):
'globs': {'globs': ['project_info/this/is/a/source/Foo.scala',
'project_info/this/is/a/source/Bar.scala']},
'libraries': ['org.apache:apache-jar:12.12.2012', 'org.scala-lang:scala-library:2.10.5'],
'id': 'project_info.jvm_target',
'is_code_gen': False,
'targets': ['project_info:jar_lib', '//:scala-library'],
'roots': [
Expand Down

0 comments on commit cc17780

Please sign in to comment.