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

Pack on root project doesn't works properly #132

Closed
tolikr opened this issue Jan 11, 2018 · 8 comments
Closed

Pack on root project doesn't works properly #132

tolikr opened this issue Jan 11, 2018 · 8 comments

Comments

@tolikr
Copy link

tolikr commented Jan 11, 2018

I use pack plugin 0.10.0.
Here is example of my project structures:
testPack.zip

In real i have few projects in libs directory and few modules that uses some of libs by dependsOn.
In this example:
If i run
sbt 'project module1' pack
project lib1 was successfully packed and moved to pack directory of module1. That is good.

But if i run
sbt pack
project lib1 wasn't moved to pack directory of module1. That is a problem.

In version 0.8.2
sbt pack
did it properly.

@xerial
Copy link
Owner

xerial commented Jan 11, 2018

Since 0.10.0, the root project needs to have explicit dependencies (to fix bugs in #67)

So adding dependsOn setting to your build.sbt is necessary to have the same behavior with the previous versions:

dependsOn(module1, module2)

@xerial
Copy link
Owner

xerial commented Jan 11, 2018

enablePlugins(PackPlugin)

// This is necessary since sbt-pack 0.10.0
dependsOn(module1, module2) 

lazy val module1 = (project in file("modules/module1")).dependsOn(lib1)
lazy val module2 = (project in file("modules/module2")).dependsOn(lib2)

lazy val lib1 = project in file("libs/lib1")
lazy val lib2 = project in file("libs/lib2")

@xerial
Copy link
Owner

xerial commented Jan 11, 2018

If you have a root project (that uses `file(".")) in your build.sbt, add dependsOn to this root project settings.

@tolikr
Copy link
Author

tolikr commented Jan 12, 2018

I added depends on, and now if i run
sbt clean pack
picture is
72fc063721
Module2 doesn't have depends on lib1, but lib1 packed to module2 directory. That is not what i want.
Module1 packed to module2 pack directory. That is very bad.

@xerial
Copy link
Owner

xerial commented Jan 12, 2018

That's really weird. Let me check.

xerial added a commit that referenced this issue Jan 12, 2018
#132: Handle the context project appropriately
@xerial
Copy link
Owner

xerial commented Jan 12, 2018

@tolikr Fixed this issue in 0.10.1. I'll release this version soon.

@xerial
Copy link
Owner

xerial commented Jan 13, 2018

@tolikr 0.10.1 is out, and actually I added your test project as a test case, https://github.com/xerial/sbt-pack/tree/master/src/sbt-test/sbt-pack/nested-project

Hopefully this version fixes your problem.

@tolikr
Copy link
Author

tolikr commented Jan 16, 2018

Thanks, it works as expected now.

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

No branches or pull requests

2 participants