Skip to content

Commit

Permalink
Developer Experience - Speed up Oni2 build (onivim#241)
Browse files Browse the repository at this point in the history
* Refactor libs to not need top-level libraries

* Only build Oni2 in main package.json

* Add test.json

* Update build steps

* Add test.esy.lock

* Add hygiene check for '@test' sandbox

* Update tests to point to new lbs

* Update missed test

* Fix libs

* Update test.json

* Wire test/bench back up

* Fix nested describe

* Update lockfile

* Update BufferViewTokenizer tests

* Update lockfile

* Update test instructions
  • Loading branch information
bryphe authored Apr 16, 2019
1 parent 4d92e4a commit e106a84
Show file tree
Hide file tree
Showing 113 changed files with 5,679 additions and 88 deletions.
6 changes: 4 additions & 2 deletions .ci/esy-build-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ steps:
displayName: 'Bootstrap Oni2 setup with system specific build variables'
- script: esy build
displayName: 'Build: esy build'
- script: esy test-ci
- script: esy @test install
displayName: 'Test: install'
- script: esy @test run
displayName: 'Unit Tests: esy test-ci (round 1)'
# TODO: Stabilize and bring back!
# - script: esy x OniUnitTestRunner
Expand All @@ -28,5 +30,5 @@ steps:
displayName: "Bench: install"
- script: esy @bench build
displayName: "Bench: build"
- script: esy @bench x oni-bench
- script: esy @bench run
displayName: "Bench: run"
4 changes: 4 additions & 0 deletions .ci/esy-check-hygiene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ steps:
displayName: 'esy @bench install'
- script: git diff --exit-code
displayName: 'check that `bench.esy.lock` is up-to-date. If this fails, commit `bench.esy.lock` changes and re-submit PR.'
- script: esy @test install
displayName: 'esy @test install'
- script: git diff --exit-code
displayName: 'check that `test.esy.lock` is up-to-date. If this fails, commit `test.esy.lock` changes and re-submit PR.'
- script: esy bootstrap
displayName: 'esy bootstrap'
- script: esy build
Expand Down
7 changes: 0 additions & 7 deletions Oni_Core.opam

This file was deleted.

7 changes: 0 additions & 7 deletions Oni_Extensions.opam

This file was deleted.

7 changes: 0 additions & 7 deletions Oni_Model.opam

This file was deleted.

7 changes: 0 additions & 7 deletions Oni_Neovim.opam

This file was deleted.

7 changes: 0 additions & 7 deletions Oni_Store.opam

This file was deleted.

7 changes: 0 additions & 7 deletions Oni_UI.opam

This file was deleted.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ The goal of this project is to build an editor that doesn't exist today - the _s

### Tests

- `esy test`
- `esy '@test' install`
- `esy '@test' build`
- `esy '@test' run`

### Benchmarks

- `esy '@bench' install`
- `esy '@bench' build`
- `esy '@bench' x oni-bench`
- `esy '@bench' run`

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion bench.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"source": "./package.json",
"scripts": {
"run": "esy '@bench' x oni-bench"
"run": "esy '@bench' x OniBench"
},
"override": {
"build": ["dune build --root . -j4"],
Expand Down
1 change: 0 additions & 1 deletion bench/exe/Bench.re

This file was deleted.

1 change: 1 addition & 0 deletions bench/exe/OniBench.re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OniBenchLib.BenchFramework.cli();
5 changes: 3 additions & 2 deletions bench/exe/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(executable
(name bench)
(public_name oni-bench)
(name OniBench)
(public_name OniBench)
(modules OniBench)
(libraries OniBench.lib)
(package OniBench)
)
4 changes: 2 additions & 2 deletions bench/lib/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name OniBench)
(name OniBenchLib)
(public_name OniBench.lib)
(ocamlopt_flags -linkall)
(libraries Oni_Core Oni_Neovim Oni_UI reperf.lib)
(libraries Oni2.core Oni2.neovim Oni2.ui reperf.lib)
)
1 change: 1 addition & 0 deletions dune
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(ignored_subdirs (node_modules _esy vendor extensions esy.lock bench.esy.lock test.esy.lock))
11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@
"description": "Lightweight code editor",
"license": "MIT",
"esy": {
"build": "refmterr dune build --root . -j4",
"build": "refmterr dune build -p Oni2 -j4",
"install": [
"esy-installer Oni2.install",
"esy-installer Oni_Core.install",
"esy-installer Oni_Extensions.install",
"esy-installer Oni_Model.install",
"esy-installer Oni_Store.install",
"esy-installer Oni_UI.install",
"esy-installer Oni_Neovim.install",
"esy-installer OniUnitTestRunner.install"
"esy-installer Oni2.install"
]
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/editor/Core/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name Oni_Core)
(public_name Oni_Core)
(public_name Oni2.core)
(libraries
str
bigarray
Expand Down
4 changes: 2 additions & 2 deletions src/editor/Extensions/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name Oni_Extensions)
(public_name Oni_Extensions)
(public_name Oni2.extensions)
(libraries
str
bigarray
Expand All @@ -15,6 +15,6 @@
ppx_deriving.runtime
ppx_deriving_yojson.runtime
reason-jsonrpc
Oni_Core
Oni2.core
)
(preprocess (pps ppx_deriving_yojson ppx_deriving.show)))
6 changes: 3 additions & 3 deletions src/editor/Model/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name Oni_Model)
(public_name Oni_Model)
(public_name Oni2.model)
(libraries
str
bigarray
Expand All @@ -16,8 +16,8 @@
ppx_deriving_yojson.runtime
reason-jsonrpc
isolinear
Oni_Core
Oni_Extensions
Oni2.core
Oni2.extensions
ReasonFuzz
)
(preprocess (pps ppx_deriving_yojson ppx_deriving.show)))
6 changes: 3 additions & 3 deletions src/editor/Neovim/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name Oni_Neovim)
(public_name Oni_Neovim)
(public_name Oni2.neovim)
(libraries
str
bigarray
Expand All @@ -9,8 +9,8 @@
msgpck
lwt
lwt.unix
Oni_Core
Oni_Model
Oni2.core
Oni2.model
Rench
Revery
ppx_deriving.runtime
Expand Down
10 changes: 5 additions & 5 deletions src/editor/Store/dune
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
(library
(name Oni_Store)
(public_name Oni_Store)
(public_name Oni2.store)
(libraries
Rench
Revery
yojson
ppx_deriving.runtime
ppx_deriving_yojson.runtime
Oni_Core
Oni_Model
Oni_Neovim
Oni_Extensions
Oni2.core
Oni2.model
Oni2.neovim
Oni2.extensions
isolinear
)
(preprocess (pps ppx_deriving_yojson ppx_deriving.show)))
6 changes: 3 additions & 3 deletions src/editor/UI/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name Oni_UI)
(public_name Oni_UI)
(public_name Oni2.ui)
(libraries
str
bigarray
Expand All @@ -9,8 +9,8 @@
msgpck
lwt
lwt.unix
Oni_Core
Oni_Model
Oni2.core
Oni2.model
Rench
Revery
))
12 changes: 6 additions & 6 deletions src/editor/bin/dune
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
lwt.unix
Rench
Revery
Oni_Core
Oni_Extensions
Oni_Neovim
Oni_Model
Oni_Store
Oni_UI
Oni2.core
Oni2.extensions
Oni2.neovim
Oni2.model
Oni2.store
Oni2.ui
)
(preprocess (
pps
Expand Down
3 changes: 3 additions & 0 deletions test.esy.lock/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

# Set eol to LF so files aren't converted to CRLF-eol on Windows.
* text eol=lf
3 changes: 3 additions & 0 deletions test.esy.lock/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

# Reset any possible .gitignore, we want all esy.lock to be un-ignored.
!*
Loading

0 comments on commit e106a84

Please sign in to comment.