diff --git a/src/docs/export.md b/src/docs/export.md index e46640e81bd..b5d108caea7 100644 --- a/src/docs/export.md +++ b/src/docs/export.md @@ -107,15 +107,6 @@ The following is an abbreviated export file from a command in the pants repo: }, "default_interpreter": "CPython-2.7.10" }, - "scala_platform": { - "scala_version": "2.12", - "compiler_classpath": [ - "/Users/dmcclanahan/tools/pants-v4/.pants.d/bootstrap/bootstrap-jvm-tools/a0ebe8e0b001/ivy/jars/org.scala-lang/scala-compiler/jars/scala-compiler-2.12.8.jar", - "/Users/dmcclanahan/tools/pants-v4/.pants.d/bootstrap/bootstrap-jvm-tools/a0ebe8e0b001/ivy/jars/org.scala-lang/scala-library/jars/scala-library-2.12.8.jar", - "/Users/dmcclanahan/tools/pants-v4/.pants.d/bootstrap/bootstrap-jvm-tools/a0ebe8e0b001/ivy/jars/org.scala-lang/scala-reflect/jars/scala-reflect-2.12.8.jar", - "/Users/dmcclanahan/tools/pants-v4/.pants.d/bootstrap/bootstrap-jvm-tools/a0ebe8e0b001/ivy/jars/org.scala-lang.modules/scala-xml_2.12/jars/scala-xml_2.12-1.0.6.jar" - ] - }, "targets": { "examples/tests/java/org/pantsbuild/example/usethrift:usethrift": { "is_code_gen": false, @@ -177,10 +168,6 @@ The following is an abbreviated export file from a command in the pants repo: # Export Format Changes -## 1.0.11 - -The 'scala_platform' field is added to the top-level keys, containing the 'scala_version' string (without patch version, e.g. "2.12") and the 'compiler_classpath' jars (a list of absolute paths to jar files). - ## 1.0.10 Coursier is added to be an option for the resolve path which ignores the confs for library sources and javadoc yet. diff --git a/src/python/pants/backend/project_info/tasks/export.py b/src/python/pants/backend/project_info/tasks/export.py index fc252889a16..5ece83c146b 100644 --- a/src/python/pants/backend/project_info/tasks/export.py +++ b/src/python/pants/backend/project_info/tasks/export.py @@ -9,7 +9,6 @@ from pants.backend.jvm.subsystems.jvm_platform import JvmPlatform from pants.backend.jvm.subsystems.resolve_subsystem import JvmResolveSubsystem -from pants.backend.jvm.subsystems.scala_platform import ScalaPlatform from pants.backend.jvm.targets.jar_library import JarLibrary from pants.backend.jvm.targets.junit_tests import JUnitTests from pants.backend.jvm.targets.jvm_app import JvmApp @@ -56,7 +55,7 @@ class ExportTask(ResolveRequirementsTaskBase, IvyTaskMixin, CoursierMixin): # # Note format changes in src/docs/export.md and update the Changelog section. # - DEFAULT_EXPORT_VERSION = '1.0.11' + DEFAULT_EXPORT_VERSION = '1.0.10' @classmethod def subsystem_dependencies(cls): @@ -283,15 +282,6 @@ def iter_transitive_jars(jar_lib): for target in targets: process_target(target) - scala_platform = ScalaPlatform.global_instance() - scala_platform_map = { - 'scala_version': scala_platform.version, - 'compiler_classpath': [ - cp_entry.path - for cp_entry in scala_platform.compiler_classpath_entries(self.context.products) - ], - } - jvm_platforms_map = { 'default_platform' : JvmPlatform.global_instance().default_platform.name, 'platforms': { @@ -306,7 +296,6 @@ def iter_transitive_jars(jar_lib): 'version': self.DEFAULT_EXPORT_VERSION, 'targets': targets_map, 'jvm_platforms': jvm_platforms_map, - 'scala_platform': scala_platform_map, # `jvm_distributions` are static distribution settings from config, # `preferred_jvm_distributions` are distributions that pants actually uses for the # given platform setting. diff --git a/tests/python/pants_test/backend/project_info/tasks/test_export.py b/tests/python/pants_test/backend/project_info/tasks/test_export.py index 4733a7507ab..547275ccd1e 100644 --- a/tests/python/pants_test/backend/project_info/tasks/test_export.py +++ b/tests/python/pants_test/backend/project_info/tasks/test_export.py @@ -20,7 +20,6 @@ from pants.backend.jvm.targets.jvm_binary import JvmBinary from pants.backend.jvm.targets.jvm_target import JvmTarget from pants.backend.jvm.targets.scala_library import ScalaLibrary -from pants.backend.jvm.tasks.bootstrap_jvm_tools import BootstrapJvmTools from pants.backend.jvm.tasks.classpath_products import ClasspathProducts from pants.backend.project_info.tasks.export import Export from pants.backend.python.register import build_file_aliases as register_python @@ -46,9 +45,6 @@ def task_type(cls): def alias_groups(cls): return register_core().merge(register_jvm()).merge(register_python()) - # Version of the scala compiler and libraries used for this test. - _scala_toolchain_version = '2.10.5' - def setUp(self): super().setUp() @@ -60,47 +56,10 @@ def setUp(self): } init_subsystems([JUnit, ScalaPlatform, ScoveragePlatform], scala_options) - self.make_target( - ':jar-tool', - JarLibrary, - jars=[JarDependency('org.pantsbuild', 'jar-tool', '0.0.10')] - ) - - self.make_target( - ':jarjar', - JarLibrary, - jars=[JarDependency(org='org.pantsbuild', name='jarjar', rev='1.7.2')] - ) - self.make_target( ':scala-library', JarLibrary, - jars=[JarDependency('org.scala-lang', 'scala-library', self._scala_toolchain_version)] - ) - - self.make_target( - ':scalac', - JarLibrary, - jars=[JarDependency('org.scala-lang', 'scala-compiler', self._scala_toolchain_version)] - ) - - self.make_target( - ':scalac_2_12', - JarLibrary, - jars=[JarDependency('org.scala-lang', 'scala-compiler', '2.12.8')] - ) - - - self.make_target( - ':scala-reflect', - JarLibrary, - jars=[JarDependency('org.scala-lang', 'scala-reflect', self._scala_toolchain_version)] - ) - - self.make_target( - ':scala-repl', - JarLibrary, - jars=[JarDependency('org.scala-lang', 'scala-repl', self._scala_toolchain_version)] + jars=[JarDependency('org.scala-lang', 'scala-library', '2.10.5')] ) self.make_target( @@ -222,20 +181,17 @@ def setUp(self): self.add_to_build_file('src/python/has_reqs/BUILD', textwrap.dedent(""" python_library(name="has_reqs", sources=globs("*.py"), dependencies=[':six']) - + python_requirement_library( name='six', requirements=[ python_requirement('six==1.9.0') ] - ) + ) """)) def execute_export(self, *specs, **options_overrides): options = { - ScalaPlatform.options_scope: { - 'version': 'custom' - }, JvmResolveSubsystem.options_scope: { 'resolver': 'ivy' }, @@ -248,14 +204,10 @@ def execute_export(self, *specs, **options_overrides): } options.update(options_overrides) - BootstrapJvmTools.options_scope = 'bootstrap-jvm-tools' context = self.context(options=options, target_roots=[self.target(spec) for spec in specs], - for_subsystems=[JvmPlatform], - for_task_types=[BootstrapJvmTools]) + for_subsystems=[JvmPlatform]) context.products.safe_create_data('compile_classpath', init_func=ClasspathProducts.init_func(self.pants_workdir)) - bootstrap_task = BootstrapJvmTools(context, self.pants_workdir) - bootstrap_task.execute() task = self.create_task(context) return list(task.console_output(list(task.context.targets()), context.products.get_data('compile_classpath'))) @@ -297,27 +249,7 @@ def test_without_dependencies(self): def test_version(self): result = self.execute_export_json('project_info:first') # If you have to update this test, make sure export.md is updated with changelog notes - self.assertEqual('1.0.11', result['version']) - - def test_scala_platform_custom(self): - result = self.execute_export_json('project_info:first') - scala_platform = result['scala_platform'] - scala_version = scala_platform['scala_version'] - self.assertEqual(scala_version, 'custom') - scala_jars = scala_platform['compiler_classpath'] - self.assertTrue(any(self._scala_toolchain_version in jar_path for jar_path in scala_jars)) - - def test_scala_platform_standard(self): - result = self.execute_export_json('project_info:first', **{ - ScalaPlatform.options_scope: { - 'version': '2.12' - } - }) - scala_platform = result['scala_platform'] - scala_version = scala_platform['scala_version'] - self.assertEqual(scala_version, '2.12') - scala_jars = scala_platform['compiler_classpath'] - self.assertTrue(any('2.12' in jar_path for jar_path in scala_jars)) + self.assertEqual('1.0.10', result['version']) def test_sources(self): self.set_options(sources=True)