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

How to use your libraries from my SBT build? #9

Closed
PhilAndrew opened this issue Aug 2, 2022 · 4 comments
Closed

How to use your libraries from my SBT build? #9

PhilAndrew opened this issue Aug 2, 2022 · 4 comments

Comments

@PhilAndrew
Copy link

Hi, I'm lazy, how to use your libraries?

@propensive
Copy link
Owner

Most of my effort so far has gone into developing these libraries rather than promoting them for public consumption, but both are ongoing work. As such, I've been developing them alongside a new build tool, Irk, which is usable but incomplete, undocumented and essentially not yet published. So this is the current state of things, which I expect to improve in time.

I plan to start publishing the libraries, though. I've had a few trial runs at this already, and the most difficult steps are in place already. There are enough different libraries with dependencies between them that the only feasible way to do this is by automation. I've created issues #10 and #11 to track the two main tasks I need to complete to get this working.

If you're planning to use them with SBT, I should first check that you're aware that they all require Scala 3 and are unlikely to work with Scala 2.

Assuming that's fine, and you don't mind the generally experimental state of everything, you could do one of the following:

1. Copy the sources into your own project

This might be an acceptable solution, depending on the nature of your project. Most of the libraries have at least some dependencies. The best way to do this may be to recursively copy all of one project's sources into yours, then if you see a package ${foo} not found error, git clone [email protected]/propensive/${foo} and copy its sources. Alternatively, you could inspect the build.irk file for each project, which is JSON and should be intuitive enough.

2. Run the Irk build

Each project should include a file called irk which you can run in-place (./irk) and it should download and run the build tool, cloning any dependencies (binary or source) it needs along the way. If you want to keep developing with Irk, then you could create a project with a build.irk file that mirrors the format of one of the simple projects. If you have any questions, ask in the Discord channel.

3. Use Irk to build a JAR

If you prefer to use SBT (which is fair enough), then you could have Irk build a fat JAR containing whatever you need. If this is the case, let me know and I'll provide some instructions on this.

Obviously, none of this is ideal yet, but this is very much a work-in-progress.

@PhilAndrew
Copy link
Author

In my limited time tonight I copied the files into my project but IntelliJ doesn't like it, lots of red, otherwise its good Scala 3 code to look at....

@propensive
Copy link
Owner

You will probably need to configure the experimental fewerBraces language import, since I'm using that style everywhere. But a full list of compilation flags is here.

@propensive
Copy link
Owner

I've started publishing the libraries to Maven Central. The first is Kaleidoscope (and its dependencies), and I'll keep publishing them every week for the next few months.

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