sbt / sbt-onejar

Packages your project using One-JAR™
MIT License
268 stars 45 forks source link

One-Jar as a global plugin #13

Open ceilican opened 12 years ago

ceilican commented 12 years ago

I don't know if this is a bug report, a feature request or a request for additional documentation.

I would like to be able to use one-jar as a global plugin, i.e. declared not in my project but in "~/.sbt/plugins/".

However, according to the documentation in the README (https://github.com/sbt/sbt-onejar/blob/master/README.md), I need to add settings (https://github.com/retronym/sbt-onejar/blob/master/src/sbt-test/one-jar/basic/build.sbt#L1) to my project's build.sbt.

Now, if a user who doesn't have one-jar installed as a global plugin clones my project and tries to run sbt, he will get the following error:

build.sbt:22: error: object github is not a member of package com
seq(com.github.retronym.SbtOneJar.oneJarSettings: _*)
        ^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

Ideally, I would like not to be required to add anything to a project's "build.sbt" in order to use one-jar on this project. Would this be possible? Would it be possible to implement the necessary features to make this possible, at least for simple projects with a single main class?

If it is really necessary to add something in "build.sbt", would it be possible to make it in such a way that users without one-jar globally installed would still be able to run SBT without seeing the error above?

Finally, in case I misunderstood the README documentation somehow, could you please add some remarks in the documentation, explaining how to use one-jar as a globally installed plugin, as I described above?

Thanks! Best regards!