Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small improvements to Idea project generation #616

Merged
merged 11 commits into from Jun 28, 2019
Merged

Small improvements to Idea project generation #616

merged 11 commits into from Jun 28, 2019

Conversation

ghost
Copy link

@ghost ghost commented May 26, 2019

Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the issues. How do you tested it? Do you have any example or public projects you tried? Would be great if we could add them as test cases. Also, do you plan to continue to work on this, or why is this PR marked as Draft?

scalalib/src/GenIdeaImpl.scala Outdated Show resolved Hide resolved

// The scala version here is non incidental
s"SBT: $groupId:$artifactId:$version:jar"
val artifactWithScalaVersion = artifactId.substring(artifactId.length - 5) match {
Copy link
Member

Choose a reason for hiding this comment

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

Can you comment what is and why it is happening here? Shouldn't the val be named artifactWithoutScalaVersion ?

Copy link
Member

Choose a reason for hiding this comment

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

Forget about the suggested val name, I misread.
My concern is primary the explicit versions. What about 2.13?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, I don't like it anymore than you do

The naming that Idea expects is very strange. I will add some examples/tests in order to clarify.

I ended up the writing the code that checks for the Scala version suffix that way because it mimics the way that the Idea Scala Plugin actually does it. I think it was a bad decision.

About appending "_2.12", Idea expects the version to match mill's version of Scala. I wanted to use the BuildInfo plugin for that, but I am not sure if mill itself is using it. I saw the version already hardcoded in the code, so I went with it. I will try to use the BuildInfo plugin instead.

@ghost
Copy link
Author

ghost commented Jun 6, 2019

I marked this PR as draft because I want it to have some kind of testing .and because I found myself adding more commits all the time (and because I wanted to test the github feature :D).

Usually, I test manually with an example per issue, with mill itself, and with the projects my organization is using mill on.

@ghost
Copy link
Author

ghost commented Jun 11, 2019

I modified the current GenIdeaTests to use ScriptTestSuite. I made this change in order to be able to test issues like #527.
@lefou Maybe you (or anyone else who is interested :D) could guide me in the right direction on this, given that this looks more like an integration test now, and it may need forking to work cleanly(right now, the GenIdea module inherits the PWD, so it overwrites the current generated idea files :S)

@lihaoyi
Copy link
Member

lihaoyi commented Jun 16, 2019

@andres-pipicello-olx the intellij idea script doesn't really have that great coverage, so I honestly wouldn't mind "seems to work on my repos" as an acceptable test plan

@lefou
Copy link
Member

lefou commented Jun 26, 2019

Sorry, I have no explicit pointers about testing this, besides GenIdeaTests, which you already mentioned. But if you want to test more complex cases, in principle, we could just call out to a sub process with complex enough mock project and check the expected outcome.

But, as @lihaoyi already said, we can just merge now, if it works for you. But you have to change the draft status before we can merge.

@ghost ghost marked this pull request as ready for review June 26, 2019 20:09
@ghost
Copy link
Author

ghost commented Jun 26, 2019

Ok, I marked the PR as ready
In my last set of commits I added some fixes in order to make the generator more testable, so in the future adding tests should be somewhat easier.

@lefou
Copy link
Member

lefou commented Jun 28, 2019

Finally, I was able to convince Travis to build without errors (after lots of restarts, https://travis-ci.org/lefou/mill/builds/551179779), so I guess we're fine to merge.

(We really need to fix the unreliable travis setup.)

@lefou
Copy link
Member

lefou commented Jun 28, 2019

I'm going to keep each commit to keep the various bug fixes separated.

@lefou lefou merged commit da1436a into com-lihaoyi:master Jun 28, 2019
@lefou lefou added this to the after-0.4.1 milestone Jun 28, 2019
@lefou
Copy link
Member

lefou commented Jun 28, 2019

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants