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

Feature parity with the Gradle plugin #23

Open
2 of 6 tasks
rahulmutt opened this issue Apr 14, 2019 · 9 comments
Open
2 of 6 tasks

Feature parity with the Gradle plugin #23

rahulmutt opened this issue Apr 14, 2019 · 9 comments

Comments

@rahulmutt
Copy link
Member

rahulmutt commented Apr 14, 2019

The Gradle plugin almost contains all the features you'd ever need to work with Eta.

I'll list below the features missing currently in the SBT plugin:

  • DSL for configuring Eta projects
    Gradle allows you to specify configuration for Eta projects within its build.gradle file. Similarly, we should be able to specify Eta project configuration in the build.sbt and the SbtEta plugin should automatically generate a .cabal file in a local build artifact folder and update it as necessary. That .cabal file should then be used to run the build.

    You can read the Gradle plugin docs for how that's accomplished right now:
    https://eta-lang.org/docs/user-guides/gradle-user-guide/basic-configuration/plugin-basics

  • REPL task
    There should be a eta-repl command that runs the repl - calling etlas repl is sufficient provided that the stdin of the sbt console can be redirect to etlas repl's stdin.

  • Multi-project/module support

    • Consistent Dependencies
      When you have multiple Eta projects in a single SBT build, you must ensure that all the dependencies are consistent (using the same version for a given package). The gradle plugin accomplishes this by iterating through all the Eta projects in the build, collecting all their dependencies, And generation a "fake" .cabal file (with pretty much all fields set to default other than build-depends which should list all the collected dependencies) along with a "fake" cabal.project file (for git dependencies) and using etlas freeze against those.
    • In-build Eta dependencies
      Say you have two Eta projects A and B in a build such that B depends on A. You should ensure that the interface file for B is passed on to A. The way you do this is by generating a stub package database with the package conf file that will specify where to find the interface file and add this package database. You can see the Gradle plugin for how that's done (they're called Project dependencies). The easiest way to see this setup is to create a multi-module gradle project, built it, and inspect the build directory. There should be an example in the examples folder of the repo.
  • Etlas Configuration
    There should be a way to configure the etlas version to use and it should be downloaded automatically and stored in a cache directory. See this for the url structure.

I'll keep updating this as I remember what else needs to be done.

Cc: @Romastyi

rahulmutt added a commit that referenced this issue Apr 14, 2019
Feature parity with the Gradle plugin by #23
rahulmutt added a commit that referenced this issue Apr 19, 2019
Feature parity with the Gradle plugin, DSL #23
@rahulmutt
Copy link
Member Author

@Romastyi I've updated the original post with additional things that need to be done. The Etlas Configuration task should take priority, and the other one is for advanced usage (multiple Eta projects in an SBT build with optional dependencies amongst themselves).

rahulmutt added a commit that referenced this issue Apr 22, 2019
#23 Support for multi-project builds.
Romastyi added a commit to Romastyi/sbt-eta that referenced this issue Apr 22, 2019
rahulmutt added a commit that referenced this issue Apr 24, 2019
@Romastyi
Copy link
Contributor

Romastyi commented Apr 24, 2019

The original gradle plugin has one more feature: checker for default-language and default-extensions values by exploring them using eta. Additionally, it can be useful to add command, which will show all available values for these sections to user.

@Romastyi
Copy link
Contributor

Romastyi commented Apr 24, 2019

@rahulmutt Is it useful to add the ability to specify several executables and test suites for Eta project? As far as I know, cabal allows it.

@rahulmutt
Copy link
Member Author

@Romastyi Both your suggestions sound useful, go ahead!

rahulmutt added a commit that referenced this issue Apr 26, 2019
rahulmutt added a commit that referenced this issue Apr 28, 2019
#23 Compatibility with `sbt` 0.13.x
@rahulmutt
Copy link
Member Author

@Romastyi has finished this so all that remains is a release of the sbt-eta plugin.

@Romastyi
Copy link
Contributor

Romastyi commented Jun 5, 2019

@rahulmutt do you have any plans on release version of plugin?

@rahulmutt
Copy link
Member Author

@Romastyi Yes, I'll see if I can finish up the docs and release it by the weekend.

@Romastyi
Copy link
Contributor

Romastyi commented Jun 5, 2019

@rahulmutt Oh, it's wonderful! If you need any help from me let me know.

@rahulmutt
Copy link
Member Author

I have just released 0.3.0 that supports recent versions of Etlas.

I'll close this issue once the docs have been updated as well.

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