Skip to content

Allow setting project name#486

Merged
wisechengyi merged 1 commit intopantsbuild:masterfrom
mzarnowski:allow-setting-project-name
Feb 4, 2020
Merged

Allow setting project name#486
wisechengyi merged 1 commit intopantsbuild:masterfrom
mzarnowski:allow-setting-project-name

Conversation

@mzarnowski
Copy link
Contributor

Previously, project name was derived from the targets used for importing it. Now, user can specify it when importing.

The import window looks as follows
import-project-window-with-name

And the resulting structure is:
imported-modules

The project view:
project-list

The name field is being automatically populated if and only if it was not changed by the user.
autogenerated-name

The strategy for generation of project name tries to mimic current approach (with a change of prepending the build root directory name). Since I don't have much experience with using the pants build tool, I could use some suggestions on how those automatically generated names could look like to actually useful.

@mzarnowski
Copy link
Contributor Author

The four failures:

1) 
testModuleRunConfiguration(com.twitter.intellij.pants.execution.OSSPantsJvmRunConfigurationIntegrationTest)
  junit.framework.AssertionFailedError
    at junit.framework.Assert.fail(Assert.java:55)
    at junit.framework.Assert.assertTrue(Assert.java:22)
    at junit.framework.Assert.assertTrue(Assert.java:31)
    at junit.framework.TestCase.assertTrue(TestCase.java:201)
    at com.twitter.intellij.pants.execution.OSSPantsJvmRunConfigurationIntegrationTest.testModuleRunConfiguration(OSSPantsJvmRunConfigurationIntegrationTest.java:155)
 2) testScalaLibCompletions(com.twitter.intellij.pants.integration.TargetFileCompletionIntegrationTest)
  CompositeException (2 nested):
     [0]: java.lang.AssertionError: expected:<[scala_js_library(, scala_library(]> but was:<[scala_js_library(, scala_library, scala_library(]>
     [1]: com.intellij.testFramework.LoggedErrorProcessor$TestLoggerAssertionError: Editor of class com.intellij.openapi.editor.impl.EditorImpl hasn't been released:
3) testDependencies(com.twitter.intellij.pants.integration.TargetFileCompletionIntegrationTest)
  CompositeException (2 nested):
   ------------------------------
    [0]: java.lang.AssertionError: expected:<[examples/src/scala/org/pantsbuild/example/hello/exe:exe, examples/src/scala/org/pantsbuild/example/hello/welcome:welcome, examples/src/resources/org/pantsbuild/example/hello:hello, examples/src/java/org/pantsbuild/example/hello/greet:greet, examples/src/resources/org/pantsbuild/example:example, examples/src/resources/org/pantsbuild/example/jaxb:jaxb, examples/src/resources/org/pantsbuild/example:hello_directory, examples, examples/src/scala/org/pantsbuild/example/hello:hello, examples/src/resources/org/pantsbuild/example:jaxb_directory, examples/src/resources/org/pantsbuild/example/names:names, examples/src/resources/org/pantsbuild/example:names_directory]> but was:<[examples/tests/scala/org/pantsbuild/example:hello_directory, examples/tests/python/example_test/usethriftpy:usethrift, examples/src/java/org/pantsbuild/example/annotation/processor:processor, examples/tests/python/example_test/hello/greet:prep, examples/tests/java/org/pantsbuild/example/hello/greet:greet, examples/src/python/example:hello_directory, examples/src/protobuf/org/pantsbuild/example/distance:distance, examples/src/python/example:3rdparty_py, examples/tests/python/example_test:example_test, examples/src/java/org/pantsbuild/example/protobuf/distance:distance, examples/src/python/example/grpcio/server:server, examples/tests/scala/org/pantsbuild/example:example, examples/src/antlr/org/pantsbuild/example:exp_directory, examples/src/python/example:grpcio_directory, examples/src/java/org/pantsbuild/example/hello/main:main-bin, examples/src/python/example/grpcio/client:client, examples/src/resources/org/pantsbuild/example:names_directory, examples/tests/python/example_test:usethriftpy_directory, examples/src/python/example/hello/greet:greet, examples/src/python/example/grpcio/client:service, examples/src/scala/org/pantsbuild/example/hello/welcome:welcome, examples/tests/scala/org/pantsbuild/example:all_directories, examples/src/antlr/org/pantsbuild/example/exp:exp_antlr4, examples/src/antlr/org/pantsbuild/example/exp:exp_antlr3, examples/src/python/example/tensorflow_custom_op:tensorflow-zero-out-op-wrapper, examples/src/java/org/pantsbuild/example/annotation/example:example, examples/tests/scala/org/pantsbuild/example/hello/welcome:welcome, examples, examples/src/python/example:readme, examples/src/python/example/tensorflow_custom_op:tensorflow_custom_op, examples/src/python/example:pants_publish_plugin_directory, examples/src/resources/org/pantsbuild/example:jaxb_directory, examples/tests/java/org/pantsbuild/example/useproto:useproto, examples/tests/python/example_test/usethriftpy:usethriftpy, examples/src/python/example/hello/main:main, examples/src/scala/org/pantsbuild/example/hello/exe:exe, examples/src/java/org/pantsbuild/example/hello/main:main, examples/src/java/org/pantsbuild/example/annotation/main:main, examples/src/python/example:tensorflow_custom_op_directory, examples/src/resources/org/pantsbuild/example/jaxb:jaxb, examples/tests/python/example_test/hello/greet:greet, examples/src/python/example:example, examples/src/java/org/pantsbuild/example/hello/main:readme, examples/src/python/example/hello/main:hello-app, examples/src/python/example/pants_publish_plugin:pants-publish-plugin, examples/src/scala/org/pantsbuild/example/hello:hello, examples/src/antlr/org/pantsbuild/example/exp:exp, examples/src/java/org/pantsbuild/example/antlr3:antlr3, examples/src/python/example/pants_publish_plugin:pants_publish_plugin, examples/src/resources/org/pantsbuild/example/names:names, examples/tests/scala/org/pantsbuild/example/specs2:specs2, examples/src/scala/org/pantsbuild/example/scala_with_java_sources:scala_with_java_sources, examples/src/python/example/tensorflow_custom_op:tensorflow-zero-out-op, examples/src/java/org/pantsbuild/example/java_sources:java_sources, examples/src/resources/org/pantsbuild/example/hello:hello, examples/src/antlr/org/pantsbuild/example:example, examples/src/java/org/pantsbuild/example/hello/greet:greet, examples/src/java/org/pantsbuild/example/hello/simple:simple, examples/src/resources/org/pantsbuild/example:example, examples/tests/python/example_test:tensorflow_custom_op_directory, examples/src/python/example:all_directories, examples/tests/python/example_test/tensorflow_custom_op:tensorflow_custom_op, examples/src/resources/org/pantsbuild/example:hello_directory, examples/src/python/example/grpcio/client:imports, examples/tests/python/example_test:all_directories, examples/tests/python/example_test:hello_directory, examples/src/antlr/org/pantsbuild/example:all_directories, examples/tests/scala/org/pantsbuild/example:specs2_directory]>
    [1]: com.intellij.testFramework.LoggedErrorProcessor$TestLoggerAssertionError: Editor of class com.intellij.openapi.editor.impl.EditorImpl hasn't been released:
4) testFilePathRelativeMacro(com.twitter.intellij.pants.macro.FilePathRelativeToBuiltRootMacroTest)
  junit.framework.AssertionFailedError
    at junit.framework.Assert.fail(Assert.java:55)
    at junit.framework.Assert.assertTrue(Assert.java:22)
    at junit.framework.Assert.assertNotNull(Assert.java:256)
    at junit.framework.Assert.assertNotNull(Assert.java:248)
    at junit.framework.TestCase.assertNotNull(TestCase.java:417)
    at com.twitter.intellij.pants.macro.FilePathRelativeToBuiltRootMacroTest.testFilePathRelativeMacro(FilePathRelativeToBuiltRootMacroTest.java:26)

Are exactly the same as those in #483 (https://travis-ci.com/pantsbuild/intellij-pants-plugin/jobs/279379516) so I believe they are not related.

Copy link
Collaborator

@wisechengyi wisechengyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks @marek1840!

@wisechengyi wisechengyi merged commit b001d96 into pantsbuild:master Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants