Git Product home page Git Product logo

sbt-eta's People

Contributors

bbarker avatar n4to4 avatar puffnfresh avatar rahulmutt avatar romac avatar romastyi avatar xuwei-k avatar y-taka-23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sbt-eta's Issues

After first SBT compile, subsequent compiles fail with "[etlas] copyFile: permission denied (Access is denied.)"

On Windows 7 Enterprise, the initial SBT compilation of the example project works great. However, changing the Transform.hs file and recompiling will result in an etlas error copyFile: permission denied (Access is denied.). Here is some sample console output:

c:\Temp\example>sbt
"C:\Users\harveyw.sbt\preloaded\org.scala-sbt\sbt"1.0.0"\jars\sbt.jar"
[info] Loading global plugins from C:\Users\harveyw.sbt\0.13\plugins
[info] Loading project definition from C:\Temp\example\project
[info] [etlas] Checking Maven dependencies...
[info] Set current project to Hello (in build file:/C:/Temp/example/)
> compile
[info] [etlas] Preprocessing library for example-0.1.0.0..
[info] [etlas] Building library for example-0.1.0.0..
[info] [etlas] Linking C:\Temp\example\target\eta\dist\build\HSexample-0.1.0.0-HE1kIw7Yuzp8IzZKCddlt2.jar ...
[info] [etlas] Retrieving Eta dependency jar paths...
[info] Compiling 1 Scala source to C:\Temp\example\target\scala-2.12\classes...
[success] Total time: 3 s, completed Aug 21, 2017 5:37:50 PM
> compile
[info] [etlas] Preprocessing library for example-0.1.0.0..
[info] [etlas] Building library for example-0.1.0.0..
[info] [etlas] [1 of 1] Compiling Example.Transform ( Example\Transform.hs, C:\Temp\example\target\eta\dist\build\Example\Transform.jar )
[info] [etlas] Linking C:\Temp\example\target\eta\dist\build\HSexample-0.1.0.0-HE1kIw7Yuzp8IzZKCddlt2.jar ...
[error] [etlas] copyFile: permission denied (Access is denied.)
[trace] Stack trace suppressed: run last compile:etaCompile for the full output.
[error] (compile:etaCompile)
[error]
[error] [etlas] Exit Failure 1
[error] Total time: 1 s, completed Aug 21, 2017 5:38:05 PM

Running last compile:etaCompile gives the following stack trace:

> last compile:etaCompile
java.lang.RuntimeException:

[etlas] Exit Failure 1
at scala.sys.package$.error(package.scala:27)
at com.typelead.SbtEta$.etlas(SbtEta.scala:114)
at com.typelead.SbtEta$$anonfun$2.apply(SbtEta.scala:29)
at com.typelead.SbtEta$$anonfun$2.apply(SbtEta.scala:25)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:28)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:28)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestritions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (compile:etaCompile)
[error]
[error] [etlas] Exit Failure 1

Integration with `sbt test`

Proposal: How is executing etlas test (and etlas install --enable-tests if necessary) in the sbt test phase?

Coming to consider in the most cases of Eta-scala integration, Eta is in charge "pure" parts of application logic, in which automated testing should perform effectively. I guess we're happy if we can test Eta code in sbt workflow.

Sbt error when opening the project

Hi,

I'm trying to use the plugin inside an existing sbt project, but keep getting this error:

[error] [etlas] etlas: Expected exactly one target as an argument, see `etlas deps --help`.
java.lang.RuntimeException:

 [etlas] Exit Failure 1
	at scala.sys.package$.error(package.scala:27)
	at com.typelead.SbtEta$.etlas(SbtEta.scala:114)
	at com.typelead.SbtEta$$anonfun$7.apply(SbtEta.scala:57)
	at com.typelead.SbtEta$$anonfun$7.apply(SbtEta.scala:51)
	at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
	at sbt.EvaluateSettings$MixedNode.evaluate0(INode.scala:175)
	at sbt.EvaluateSettings$INode.evaluate(INode.scala:135)
	at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$submitEvaluate$1.apply$mcV$sp(INode.scala:69)
	at sbt.EvaluateSettings.sbt$EvaluateSettings$$run0(INode.scala:78)
	at sbt.EvaluateSettings$$anon$3.run(INode.scala:74)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

also tried with a fresh project, the one in the example and get the same.

Cheers,
Luigi

Support better directory structure

@carymrobbins suggested that the directory structure should look something like this:

example/
├── example.cabal
├── Setup.hs
└── src/
    ├── main/
    │   ├── eta/
    │   │   └── Example/
    │   │       └── Transform.hs
    │   └── java/
    │       └── Main.java
    └── test/
        └── eta/
            └── Example/
                └── TransformTest.hs

The layout is a lot better than the existing layout, which places the .cabal file inside of src/main/eta.

Feature parity with the Gradle plugin

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

Not published for sbt 1.1.x

sbt 1.1.x can't retrieve this plugin because it isn't published.

I can see that the artifact specified as a cross build:

crossSbtVersions := Seq("0.13.16", "1.1.0"),

To publish all cross build artifacts you have to prefix your command with + in sbt, e.g. +publish.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.