-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ydoc-server is a separate module (#10156)
- Remove remnants of deprecated Scala parser - The following projects are now JPMS modules provided on system module-path (in components directory): - `ydoc-server` - `profiling-utils` - `syntax-rust-definition` - The contents of the aforementioned modules are excluded from both `runner.jar` and `runtime.jar` fat jars. - Suggestions are serialized and deserialized with our Persistance framework, rather than via the default Java OutputObjectWriter.
- Loading branch information
Showing
29 changed files
with
403 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# sbt cheatsheet | ||
|
||
This document contains various references and notes about sbt build definition. | ||
One of the motivation for this document is that the | ||
[official sbt documentation](https://www.scala-sbt.org/1.x/docs/index.html) is | ||
not very informative. | ||
|
||
### Resources | ||
|
||
- [Official sbt documentation](https://www.scala-sbt.org/1.x/docs/index.html) | ||
- [sbt.Keys](https://github.com/sbt/sbt/blob/1.10.x/main/src/main/scala/sbt/Keys.scala) | ||
defines all the tasks and settings keys, including their documentation. | ||
|
||
### Logging | ||
|
||
- Get reference to the logger via `streams.value.log`. | ||
- Log and error via `streams.value.log.error("My error")` | ||
- Note that this will not cause the task to fail, this will only log an | ||
`[error]` message. IF you want to fail a task, refer to | ||
[Fail a task](#fail-a-task). | ||
|
||
### Fail a task | ||
|
||
- Simply throw a `java.lang.RuntimeException`. | ||
- This will always work - it will crash the whole sbt process with the | ||
RuntimeException. But it is not the official recommended way. | ||
|
||
### Inspect tasks and settings | ||
|
||
- `inspect tree project/assembly` | ||
- This prints all the tasks and settings that will be executed when | ||
`project / assembly` is run. | ||
- It may be helpful to increase the width of the ASCI tree with | ||
`set asciiGraphWidth := 150`. | ||
- See `help inspect`. | ||
|
||
## See all the transitive dependencies | ||
|
||
- `print dependencyTree` | ||
- This shows all the transitive dependencies for the default `Compile` scope. | ||
- `print Test/dependencyTree` | ||
- This show all the transitive dependencies for the `Test` scope. | ||
|
||
### Debugging sbt tasks | ||
|
||
- There is `--jvm-debug` cmd line option to sbt which allows to attach a | ||
debugger to the sbt process. | ||
- This option is not very handy, as you will still not be able to add a | ||
breakpoint to various task definitions inside `build.sbt`, only to some | ||
classes in the `project` directory. Moreover, once you run `reload`, the | ||
debugging will not work for sure. | ||
- This is because sbt internally compiles everything from `build.sbt` a | ||
various anonymous classes and the debugger does not see their sources. | ||
- It is better to either use `println` directly, or to use | ||
`streams.value.log.info` to log messages. | ||
|
||
### Exclude internal sbt project from a fat jar | ||
|
||
- Fat jar for `fat-project` is assembled via the `fat-project / assembly` task. | ||
- There is `fat-project / assembly / assemblyExcludedJars` setting which is of | ||
type `Def.ClassPath`. | ||
- To exclude internal `project` one must: | ||
- Set `project / Compile / exportJars := true`. This ensures that | ||
`project / Compile / exportedProducts` is a path to the jar. | ||
- In `fat-project / assembly / assemblyExcludedJars` get the path to the | ||
`project` jar via `project / Compile / exportedProducts`. | ||
- Declare dependency on `project / Compile / packageBin` from | ||
`fat-project / assembly`. | ||
- Note that this is complicated because `assemblyExcludedJars` setting only | ||
works if it points to an already existing jar file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/analyse/alias/Graph.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...in/scala/org/enso/syntax/text/Debug.scala → ...scala/org/enso/compiler/debug/Debug.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.enso.syntax.text | ||
package org.enso.compiler.debug | ||
|
||
import scala.annotation.tailrec | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
engine/runtime/src/main/java/org/enso/interpreter/caches/PersistUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.enso.interpreter.caches; | ||
|
||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
import org.enso.persist.Persistance; | ||
import org.openide.util.lookup.ServiceProvider; | ||
|
||
public class PersistUtils { | ||
@ServiceProvider(service = Persistance.class) | ||
public static final class PersistArrayList extends Persistance<ArrayList> { | ||
public PersistArrayList() { | ||
super(ArrayList.class, true, 30360); | ||
} | ||
|
||
@Override | ||
protected void writeObject(ArrayList obj, Output out) throws IOException { | ||
out.writeInt(obj.size()); | ||
for (Object o : obj) { | ||
out.writeObject(o); | ||
} | ||
} | ||
|
||
@Override | ||
protected ArrayList readObject(Input in) throws IOException, ClassNotFoundException { | ||
int size = in.readInt(); | ||
var lst = new ArrayList<>(size); | ||
for (int i = 0; i < size; i++) { | ||
var obj = in.readObject(); | ||
lst.add(obj); | ||
} | ||
return lst; | ||
} | ||
} | ||
} |
Oops, something went wrong.