Code Monkey home page Code Monkey logo

cbt's People

Contributors

baccata avatar bbarker avatar bdd avatar bierbaum avatar buzden avatar cvogt avatar darthorimar avatar etorreborre avatar farmdawgnation avatar fmcgough avatar jodersky avatar katrinsharp avatar mariusae avatar mchav avatar megri avatar mosesn avatar nilday avatar nscarcella avatar paulp avatar piotrtrzpil avatar prassee avatar ritschwumm avatar rockjam avatar sake92 avatar stacycurl avatar stephenjudkins avatar tim-zh avatar tobias-johansson avatar tpolecat avatar travisbrown 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cbt's Issues

give an illusion of interactive mode

cbt will not have a real interactive mode by design (which is a good thing because stateless is better than stateful), but could give an illusion of one that allows people to not type the prefix.

# non interactive mode
$ cbt foo
...
$ cbt bar
...
# fake interative mode
$ cbt
cbt> foo
...
cbt> bar
...

Looping on Linux

Loop runs continuously and doesn't seem to watch for file changes.

cbt clean

would be nice to have something that removes the target directory. I am slightly worried about adding a rm -rf equivalent at this point thought, because if we mess up paths, it may go horribly wrong and delete user files

CBT Versioning

In order to have reproducibility, builds probably should be able to specify a version of CBT they should be compiled with. One option would be a build.properties file just like SBT does it.

CBT would need to download the appropriate CBT version in order to compile a given build.

Also, CBT is extended via traits. How does that relate to different CBT versions. If CBT releases version 1.1, can users use plugins developed for 1.0 if they are compatible in some way (source or binary)? How?

@tpolecat would be great to have a session about this tomorrow. @milessabin this sort of falls into the category of compiling different typelevel libraries together, which I assume would not upgrade CBT all at the exact same time, so maybe we can join or overlap this session with that session.

compile looping sees too many files

if compile looping is given a path to a file rather than a folder, it currently watches the files parent folder, which is wrong in case of a top-level file in a project, which leads to CBT watching the whole toplevel folder including the target folder into which it generates the class files

If cbt detects nailgun isn't there, it probably shouldn't print nailgun related messages

Ran cbt without nailgun installed and got...

$ ./cbt
(Note: nailgun not found. It makes CBT faster! Try 'brew install nailgun'.)
Starting up nailgun
Recompiling CBT BootstrapScala.java
downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.7/scala-library-2.11.7.jar
to /Users/matt/Projects/cbt/bootstrap_scala/cache/2.11.7/scala-library-2.11.7.jar
downloading https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.7/scala-compiler-2.11.7.jar
to /Users/matt/Projects/cbt/bootstrap_scala/cache/2.11.7/scala-compiler-2.11.7.jar
downloading https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.7/scala-reflect-2.11.7.jar
to /Users/matt/Projects/cbt/bootstrap_scala/cache/2.11.7/scala-reflect-2.11.7.jar
downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.5/scala-xml_2.11-1.0.5.jar
to /Users/matt/Projects/cbt/bootstrap_scala/cache/2.11.7/scala-xml_2.11-1.0.5.jar
Recompiling CBT. Detected source changes...
Stopping nailgun
Restarting nailgun

I will admit that I killed this before seeing whether or not it continued. Paused for a few minutes so that's probably something to check. But either way, we probably shouldn't be doing nailgun related things if we detect it isn't there.

ScalaJS support

assigning tentatively to milestone 1.1, but happier to get it in earlier

Properly detecting when zinc needs to run or not

The presented version at NEScala slightly differs from the released version in that the released version runs zinc more often than needed. This should be an easy fix which would basically entail detecting the return code of zinc and acting appropriately. Details in my head, hopefully solved soon enough to not be explained here

sbt does allow lazy dependencies

The README says sbt doesn't allow lazy dependencies. This is false, sbt does so allow lazy dependencies:

val flag = taskKey[Boolean]("a flag")
val taskA = taskKey[Unit]("task a")
val taskB = taskKey[Unit]("task b")
val dependentTask = taskKey[Unit]("dependent task")

taskA := println("task a")
taskB := println("task b")
flag := true

dependentTask <<= (flag, taskA.task, taskB.task).flatMap { (flag, a, b) =>
  if (flag) a else b
}

Running it shows that tasks A and B are lazily depended on:

> dependentTask
task a
> set flag := false
> dependentTask
task b
> 

clean up source code

there has been some superficial dirtiness been introduced in the last two days enhancements under time pressure. Let's clean that up.

simple install

It would be nice to install cbt easily

  • mac
    • brew install cbt
  • linux
    • apt-get
    • nix
    • yum
    • ...
  • window
    • chocolatey
    • msi

Different indentation

There are a few different indentation strategies used throughout the source. Some things are using tabs, others are using spaced. @cvogt Which is intended? :)

dynamic re-configuration

There are multiple use cases for re-configuring a build at runtime. E.g. appending "-SNAPSHOT" to the version number when deploying a snapshot. Or changing the scalaVersion for cross-builds. It is not obvious how to do this, because CBT builds are classes where things are hard wired after instantiation if members are final. More concretely, this isn't possible:

class Build ... {
  def publishSnapshot{
    this.version = this.version + "-SNAPSHOT"
    publish
  }
}

Candidate solutions are

  1. exposing selected fields like the through the constructor and providing via cli mechanism that fills them in (easy to implement, easy to work with, limited to hard coded use cases)

  2. mutable members (easy to implement, tricky to work with, probably not a good idea)

  3. providing users with a general purpose runtime mixins mechanism (hard to implement, easy to work with). Could look like this

    class BasicBuild(...){
      def publishSnapshot: Unit = {
        val reconfiguredBuild = this.mixin(
          new BasicBuild{
            override def version = super.version+-SNAPSHOT”
          }
        ): reconfiguredBuild
        b.publish
      }
    }
  4. Hard-coding something like 3, but specific to CBT (slightly less hard to implement, easy to work with, less universal). It would look at what's given and generate a trait that overrides exactly those fields. E.g. if a version is given via the command line, CBT would create build objects like this

    class DynamicOverrides{
      override def version = super.version+-SNAPSHOT”
    }
    new Build(...) with DynamicOverrides

    Or if the user needs to override things, there could be an api to do so:

    val reconfiguredBuild = this.replace( version = this.version+"-SNAPSHOT" )

    or

    val reconfiguredBuild = (this.version = this.version+"-SNAPSHOT")

    or

    val reconfiguredBuild = this.version.set(this.version+"-SNAPSHOT")

    All of these would need to be magical of course, turning the given expression into the right hand side of a def of a mixed in trait.

  5. On the Typelevel front people are considering creating an alternative frontend (which CBT supports), that is not based on inheritance, but a state monad instead. Would be interesting to see how that would look like and how it would differ from SBT's state monad

untyped licenses

currently licences accepts any (String, Url)

case class License(name: String, url: URL)

this causes a complete mess in practice:
https://github.com/metadoc/metadoc/tree/develop/observations/licences

I would suggest something like:

trait License { // << not sealed
  def url: Url
  def toString: String
}
Apache2
MIT
AGPL
GPL2
GPL3
LGPL
MPL2
BSD
// ...

Nix uses this approach: https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix#L1 (spdx standard)

cbt hanging forever at Waiting for nailgun to start...

Workaround: Crtl+C and rerun

Asked by @tpolecat on gitter ( https://gitter.im/cvogt/cbt?at=56db6fa9a54928411668ac17 ):
how do I diagnose cbt hanging forever at Waiting for nailgun to start...?

bash ./cbt clean
/usr/bin/java -server -jar /usr/local/Cellar/nailgun/0.9.1/libexec/nailgun-server-0.9.1.jar 127.0.
ng --nailgun-port 4444 cbt.NailgunLauncher cbt.Stage1 /Users/rnorris/Scala/cbt/stage1/target/scala

To diagnose this:
All the nailgun related output is piped into nailgun_launcher/target/nailgun.stderr.log and nailgun_launcher/target/nailgun.stdout.log

check task propagation

I think right now, in a multi project build, tasks may not be properly propagated between dependent builds.

Trying to run on JDK 7 should show a better error message

See also: #29

> javac -version 
javac 1.7.0_95
> cbt run
(Note: nailgun not found. It makes CBT faster! Try 'brew install nailgun'.)
Starting up nailgun
Recompiling CBT BootstrapScala.java
/home/tobias/Projects/cbt/bootstrap_scala/BootstrapScala.java:38: error: illegal start of expression
            Arrays.stream(ds).forEach( d -> {
                                          ^
[ ... lots of javac errors ... ]

JDK version >= 8 should probably be checked in the launcher bash script to print a more helpful error message

supporting sbt plugins

We may be able to support some or all SBT plugins fully or in a limited fashion by programatically turning CBT builds into SBT builds and then executing tasks on them. Not sure that's actually possible because the wiring of CBT builds is by method calls and can't be explored programatically unless we have TASTY or do some macro annotation magic (which may actually be fine for sbt interop).

This is definitely worth exploring i order to tap on the solutions for use cases already implemented as SBT plugins.

Any opinions on this @clhodapp @MasseGuillaume

ArrayIndexOutOfBoundsException in NailgunLauncher

Clean bootstrap on 5488e70 (problem not present on c2f53c5)
(Ubuntu, javac 1.8.0_66-internal, OpenJDK Runtime Environment (build 1.8.0_66-internal-b17))

> cbt run
(Note: nailgun not found. It makes CBT faster! Try 'brew install nailgun'.)
Recompiling CBT BootstrapScala.java
downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.7/scala-library-2.11.7.jar
to /home/tobias/Projects/cbt/bootstrap_scala/cache/2.11.7/scala-library-2.11.7.jar
downloading https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.7/scala-compiler-2.11.7.jar
to /home/tobias/Projects/cbt/bootstrap_scala/cache/2.11.7/scala-compiler-2.11.7.jar
downloading https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.7/scala-reflect-2.11.7.jar
to /home/tobias/Projects/cbt/bootstrap_scala/cache/2.11.7/scala-reflect-2.11.7.jar
downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.5/scala-xml_2.11-1.0.5.jar
to /home/tobias/Projects/cbt/bootstrap_scala/cache/2.11.7/scala-xml_2.11-1.0.5.jar
Recompiling NailgunLauncher. Detected source changes.
Stopping nailgun
Restarting nailgun
Recompiling Stage1. Detected source changes.
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
    at cbt.NailgunLauncher.main(NailgunLauncher.java:42)

embedding SBT builds

It would be great to be able to embed projects built with SBT as subprojects into CBT builds. This will allow to depend on SBT projects by source, (once we have GIT dependencies, which I'll start working on tonight).

This shouldn't be too hard actually. A cbt.Dependency subclass that delegates to a SBT build under the hood should do it.

Somebody with solid SBT knowledge wanna pick this up :)? @clhodapp @MasseGuillaume ?

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.