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

Fix directory structure of examples sub-project #21

Merged
merged 1 commit into from
Sep 29, 2014

Conversation

samuelgruetter
Copy link
Collaborator

With the current structure of the examples directory, the compile and test sbt commands succeed, but they do nothing, and the run command doesn't detect the main classes:

> projects
[info] In file:/home/sam/Documents/git/ReactiveX/RxScala/
[info]     examples
[info]   * root
> project examples
[info] Set current project to examples (in build file:/home/sam/Documents/git/ReactiveX/RxScala/)
> test
[warn] Credentials file /home/sam/.bintray/.credentials does not exist
[info] Updating {file:/home/sam/Documents/git/ReactiveX/RxScala/}examples...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[success] Total time: 2 s, completed Sep 27, 2014 2:56:52 AM
> compile
[warn] Credentials file /home/sam/.bintray/.credentials does not exist
[success] Total time: 0 s, completed Sep 27, 2014 2:56:59 AM
> project
[info] examples (in build file:/home/sam/Documents/git/ReactiveX/RxScala/)
> run
[warn] Credentials file /home/sam/.bintray/.credentials does not exist
java.lang.RuntimeException: No main class detected.
    at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last examples/compile:run for the full output.
[error] (examples/compile:run) No main class detected.
[error] Total time: 0 s, completed Sep 27, 2014 2:57:10 AM

This PR changes the directory structure of the examples project to the sbt default structure. Now the files are not ignored any more, but the examples project does not inherit the library dependencies of the root project, so the compilation fails:

> projects
[info] In file:/home/sam/Documents/git/ReactiveX/RxScala/
[info]     examples
[info]   * root
> project examples
[info] Set current project to examples (in build file:/home/sam/Documents/git/ReactiveX/RxScala/)
> test
[warn] Credentials file /home/sam/.bintray/.credentials does not exist
[info] Compiling 7 Scala sources to /home/sam/Documents/git/ReactiveX/RxScala/examples/target/scala-2.10/classes...
[info] Compiling 4 Scala sources and 1 Java source to /home/sam/Documents/git/ReactiveX/RxScala/examples/target/scala-2.10/test-classes...
[error] /home/sam/Documents/git/ReactiveX/RxScala/examples/src/test/scala/rx/lang/scala/examples/RxScalaDemo.scala:30: object junit is not a member of package org
[error] import org.junit.Assert.assertEquals
...

I tried to solve this following this guide, but didn't succeed.

@jmhofer any idea how to make this work?

@samuelgruetter
Copy link
Collaborator Author

Travis says the build passed, but it just says so because it only built the root project, but not the examples project. This should be fixed as well.

@benjchristensen benjchristensen force-pushed the 0.x branch 2 times, most recently from 9b9abec to 53185db Compare September 27, 2014 15:23
@jmhofer
Copy link
Collaborator

jmhofer commented Sep 28, 2014

The subproject probably just doesn't inherit any test dependencies. We'll have to use "dependsOn (root % "test->test") or something similar.

@jmhofer jmhofer merged commit a93cb02 into ReactiveX:0.x Sep 29, 2014
@jmhofer
Copy link
Collaborator

jmhofer commented Sep 29, 2014

Thanks for fixing this!

I took the liberty of modifying the dependsOn line in the build, and together with removing the deprecations from the examples, it compiles, tests and runs again now.

@samuelgruetter samuelgruetter deleted the examples-project branch September 29, 2014 19:25
@samuelgruetter
Copy link
Collaborator Author

Cool, thanks! Now I'm very happy with the build infrastructure :-)

@samuelgruetter samuelgruetter mentioned this pull request Sep 29, 2014
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