Skip to content

Commit

Permalink
Persistent/worker scala compiler (#91)
Browse files Browse the repository at this point in the history
* Squashed commit of the following:

commit d3ed208
Merge: 61b3b57 cd24529
Author: Ian O'Connell <[email protected]>
Date:   Mon Sep 12 21:21:53 2016 -0700

    Merge pull request #3 from ianoc/oscar/worker-resources

    Add resource support, minor cleanups

commit cd24529
Author: Oscar Boykin <[email protected]>
Date:   Mon Sep 12 18:05:01 2016 -1000

    Add resource support, minor cleanups

commit 61b3b57
Merge: 9bf9087 d0d6658
Author: P. Oscar Boykin <[email protected]>
Date:   Mon Sep 12 16:53:40 2016 -1000

    Merge pull request #2 from ianoc/oscar/javac_scala_worker

    Add javac support for mixed targets

commit d0d6658
Author: Oscar Boykin <[email protected]>
Date:   Mon Sep 12 14:29:18 2016 -1000

    Add javac support for mixed targets

commit 9bf9087
Merge: 617885e 30b0efc
Author: Ian O'Connell <[email protected]>
Date:   Mon Sep 12 16:25:56 2016 -0700

    Merge pull request #1 from ianoc/oscar/resident-compiler

    Factor out ScalaCInvoker option parsing

commit 30b0efc
Author: Oscar Boykin <[email protected]>
Date:   Mon Sep 12 13:22:56 2016 -1000

    address review

commit b28dcd1
Author: Oscar Boykin <[email protected]>
Date:   Mon Sep 12 12:35:14 2016 -1000

    Factor out ScalaCInvoker option parsing

commit 617885e
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 21:43:59 2016 -0700

    Adding

commit 821ab21
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 19:47:11 2016 -0700

    wip

commit f6bebe6
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 19:38:41 2016 -0700

    wip

commit 4ab6810
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 19:33:02 2016 -0700

    wip

commit cdc4995
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 17:55:40 2016 -0700

    wip

commit 51b9251
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 17:45:45 2016 -0700

    WIP

commit e4b53aa
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 17:29:09 2016 -0700

    WIP

commit 1cc779c
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 17:16:05 2016 -0700

    Wip

commit 1f9600c
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 14:13:33 2016 -0700

    WIP

commit d2dce89
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 14:11:14 2016 -0700

    Undo

commit ec05677
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 14:06:17 2016 -0700

    WIP

commit dcf82b4
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 12:19:19 2016 -0700

    Some formatting so my editor is less cranky

commit f11926a
Author: Ian O Connell <[email protected]>
Date:   Sun Sep 11 12:12:29 2016 -0700

    WIP -- have the jar creator code inlined

commit 0a1ad35
Author: Ian O Connell <[email protected]>
Date:   Sat Sep 10 21:01:44 2016 -0700

    wip

commit 3a0c1ab
Author: Ian O Connell <[email protected]>
Date:   Sat Sep 10 20:58:10 2016 -0700

    WIP

commit 15d02b1
Author: Ian O Connell <[email protected]>
Date:   Sat Sep 10 18:10:28 2016 -0700

    Make deploy jar name easier to grep for

commit d3823aa
Author: Ian O Connell <[email protected]>
Date:   Tue Aug 9 11:40:40 2016 -0700

    Use bind's for twitter scrooge so local repo's can override scrooge versions

commit f11e814
Merge: f82800b 4146c9e
Author: Ian O Connell <[email protected]>
Date:   Thu Jul 28 16:28:02 2016 -0700

    Merge branch 'master' of github.com:bazelbuild/rules_scala

commit f82800b
Author: Ian O Connell <[email protected]>
Date:   Thu Jul 28 15:32:14 2016 -0700

    Fix repl test

commit 9c3f37c
Author: Ian O Connell <[email protected]>
Date:   Thu Jul 28 15:30:46 2016 -0700

    Update test rules

* Handle passing through jvm options correctly, fix up merges from master

* Set bazel version to a tag

* Bump bazel version

* Remove cat

* Review comments. Collapsing code, killing code

* delete code, unused import statements.

* Remove unused code/ unneeded comments

* Add the jvm options back in for usage with javac

* Review comments

* Add comment describing the args to a worker cmd

* Move compile java sources to its own method

* Kill maven_jar of guava

* Update readme

* Readme edit
  • Loading branch information
ianoc authored and johnynek committed Sep 13, 2016
1 parent 9148441 commit bdd5e29
Show file tree
Hide file tree
Showing 14 changed files with 901 additions and 350 deletions.
2 changes: 1 addition & 1 deletion .bazel-installer-linux-x86_64.sh.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e0e4efe35b2c9f2b1f3c3929fc401e27c312090e6a305c046ecb59b9e3128e00 bazel-0.2.3-installer-linux-x86_64.sh
97dd53414e12da1c9a8a23911ebe732b4b278295ed6b226a5ddee4cd6775a01b bazel-0.3.1-installer-linux-x86_64.sh
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ jdk:
- oraclejdk8

before_install:
- wget 'https://github.com/bazelbuild/bazel/releases/download/0.2.3/bazel-0.2.3-installer-linux-x86_64.sh'
- wget 'https://github.com/bazelbuild/bazel/releases/download/0.3.1/bazel-0.3.1-installer-linux-x86_64.sh'
- sha256sum -c .bazel-installer-linux-x86_64.sh.sha256
- chmod +x bazel-0.2.3-installer-linux-x86_64.sh
- ./bazel-0.2.3-installer-linux-x86_64.sh --user
- chmod +x bazel-0.3.1-installer-linux-x86_64.sh
- ./bazel-0.3.1-installer-linux-x86_64.sh --user
- mv .bazelrc.travis .bazelrc
- cat ~/.bazelrc >> .bazelrc

script:
- bash test_run.sh
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ and `scala_test`.
## Getting started

In order to use `scala_library`, `scala_macro_library`, and `scala_binary`,
you must have bazel 0.2.3 and add the following to your WORKSPACE file:
you must have bazel 0.3.1 and add the following to your WORKSPACE file:

```python
git_repository(
name = "io_bazel_rules_scala",
remote = "https://github.com/bazelbuild/rules_scala.git",
commit = "7b891adb975b4e3e6569b763d39ab6e9234196c9", # update this as needed
)
git_repository(
name = "io_bazel",
remote = "git://github.com/bazelbuild/bazel.git",
tag = "0.3.1",
)

load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()
```
Expand All @@ -40,6 +46,13 @@ load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library", "scala_binary",
```
You may wish to have these rules loaded by default using bazel's prelude. You can add the above to the file `tools/build_rules/prelude_bazel` in your repo (don't forget to have a, possibly empty, BUILD file there) and then it will be automatically prepended to every BUILD file in the workspace.

To run with a persistant worker (much faster), you need to add
```python
build --strategy=Scalac=worker
test --strategy=Scalac=worker
```
to your command line, or to enable by default for building/testing add it to your .bazelrc.

[scala]: http://www.scala-lang.org/

<a name="scala_library"></a>
Expand Down
7 changes: 7 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@ maven_jar(
name = "org_psywerx_hairyfotr__linter",
artifact = scala_mvn_artifact("org.psywerx.hairyfotr:linter:0.1.13"),
sha1 = "e5b3e2753d0817b622c32aedcb888bcf39e275b4")


git_repository(
name = "io_bazel",
remote = "git://github.com/bazelbuild/bazel.git",
commit = "0.3.1",
)
Loading

0 comments on commit bdd5e29

Please sign in to comment.