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

Allow files for scala_import #411

Merged
merged 1 commit into from
Mar 6, 2018

Conversation

jjudd
Copy link
Contributor

@jjudd jjudd commented Jan 31, 2018

Hi everyone. Wanted to get people's thoughts on this before I added tests around it and prepared it to actually be merged.

I'm not sure if there is a reason the rules do not allow files for scala_import. We made this change and have been using files from scala_import. It also doesn't fail any tests locally.

If this change is something everyone is ok with, then I'll add a test for it and get it ready for merging.

@bazel-io
Copy link
Member

Can one of the admins verify this patch?

@ittaiz
Copy link
Member

ittaiz commented Jan 31, 2018

Hi @jjudd,
Thanks for this! I think there was a need in previous iterations of this rule (and there were plenty of those) before we had exports but now that we have exports it indeed looks as if we don't need it.
Adding a test sounds great

@ittaiz
Copy link
Member

ittaiz commented Feb 6, 2018

@jjudd gentle ping

@jjudd
Copy link
Contributor Author

jjudd commented Feb 6, 2018

Thanks for the ping. I should be able to add a test for this in the next couple days. I got sidetracked with the Scala IntelliJ plugin :)

@ittaiz
Copy link
Member

ittaiz commented Feb 6, 2018 via email

@jjudd
Copy link
Contributor Author

jjudd commented Feb 12, 2018

I haven't forgotten about this. It's next on my list.

@ittaiz
Copy link
Member

ittaiz commented Feb 22, 2018

@jjudd friendly ping

This enables targets that are files to be used with scala_import. For example
if you have a jar checked into your repository, you can use that with
scala_import.
@jjudd
Copy link
Contributor Author

jjudd commented Mar 6, 2018

Alright. I took a crack at adding a test for this. The jar I checked in to the repo comes from https://github.com/lucidsoftware/relate on Maven: http://central.maven.org/maven2/com/lucidchart/relate_2.11/2.1.1/relate_2.11-2.1.1.jar

I'm happy to use whatever jar people want. That was just the first one that came to my mine.

@johnynek johnynek merged commit efffa52 into bazelbuild:master Mar 6, 2018
@johnynek
Copy link
Member

johnynek commented Mar 6, 2018

this is great. thanks!

import org.specs2.mutable.SpecificationWithJUnit
import com.lucidchart.relate.SqlRow

class ScalaImportExposesJarsTest extends SpecificationWithJUnit {
Copy link
Member

Choose a reason for hiding this comment

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

@jjudd are you sure this runs/compiles? I don’t understand what target it belongs to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. My bad. I copied it, but then decided I wanted to add it to the original test instead. I accidentally added it to this new file. I'll make a PR real quick.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have a commit that fixes this and am running tests locally to make sure things are good. I'll open a PR as soon as it is done. Sorry about that.

class ScalaImportExposesJarsTest extends SpecificationWithJUnit {

"scala_import" should {
"enable using the jars it exposes" in {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this here? I think it was copied from another test and wasn’t removed right?

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

Successfully merging this pull request may close these issues.

5 participants