Skip to content

Commit

Permalink
Ensure wrapper projects are listed in aggregates (#11323)
Browse files Browse the repository at this point in the history
* Ensure wrapper projects are listed in aggregates

Previously, doing clean to deal with weird modularization failures would
have no effect.

* And updated formatting

* More projects

As cherry-picked from #11321
  • Loading branch information
hubertp authored Oct 14, 2024
1 parent d1ee7fa commit e1da31b
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 49 deletions.
14 changes: 13 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ lazy val enso = (project in file("."))
.settings(version := "0.1")
.aggregate(
`akka-native`,
`akka-wrapper`,
`benchmark-java-helpers`,
`benchmarks-common`,
`bench-processor`,
Expand All @@ -301,6 +302,7 @@ lazy val enso = (project in file("."))
`connected-lock-manager`,
`connected-lock-manager-server`,
`desktop-environment`,
`directory-watcher-wrapper`,
`distribution-manager`,
downloader,
editions,
Expand All @@ -311,13 +313,16 @@ lazy val enso = (project in file("."))
`engine-runner`,
`enso-test-java-helpers`,
`exploratory-benchmark-java-helpers`,
`fansi-wrapper`,
filewatcher,
`http-test-helper`,
`interpreter-dsl`,
`interpreter-dsl-test`,
`jna-wrapper`,
`json-rpc-server-test`,
`json-rpc-server`,
`language-server`,
`language-server-deps-wrapper`,
launcher,
`library-manager`,
`library-manager-test`,
Expand All @@ -338,6 +343,7 @@ lazy val enso = (project in file("."))
`project-manager`,
`refactoring-utils`,
runtime,
`runtime-and-langs`,
`runtime-benchmarks`,
`runtime-compiler`,
`runtime-integration-tests`,
Expand All @@ -348,14 +354,19 @@ lazy val enso = (project in file("."))
`runtime-instrument-id-execution`,
`runtime-instrument-repl-debugger`,
`runtime-instrument-runtime-server`,
`runtime-integration-tests`,
`runtime-parser`,
`runtime-suggestions`,
`runtime-version-manager`,
`runtime-version-manager-test`,
`runtime-test-instruments`,
`scala-libs-wrapper`,
`scala-yaml`,
searcher,
semver,
`std-aws`,
`std-base`,
`std-benchmarks`,
`std-database`,
`std-google-api`,
`std-image`,
Expand All @@ -369,7 +380,8 @@ lazy val enso = (project in file("."))
`test-utils`,
`text-buffer`,
`version-output`,
`ydoc-server`
`ydoc-server`,
`zio-wrapper`
)
.settings(Global / concurrentRestrictions += Tags.exclusive(Exclusive))
.settings(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

provides org.graalvm.polyglot.tck.LanguageProvider with
org.enso.interpreter.test.instruments.tck.EnsoTckLanguageProvider;

provides com.oracle.truffle.api.instrumentation.provider.TruffleInstrumentProvider with
org.enso.interpreter.test.instruments.CodeIdsTestInstrumentProvider,
org.enso.interpreter.test.instruments.CodeLocationsTestInstrumentProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.oracle.truffle.api.nodes.Node;
import java.util.LinkedHashMap;
import java.util.Map;

import java.util.UUID;
import org.enso.interpreter.test.instruments.service.RuntimeTestService;
import org.openide.util.Lookup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.oracle.truffle.api.instrumentation.TruffleInstrument;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.source.SourceSection;

import java.util.List;
import java.util.Map;
import java.util.UUID;
Expand Down Expand Up @@ -77,10 +76,12 @@ public Map<Class, List<Node>> assertNewNodes(String msg, int min, int max) {
};

if (value < min) {
throw new AssertionError(dump.apply(msg + ". Minimal size should be " + min + ", but was: " + value + " in"));
throw new AssertionError(
dump.apply(msg + ". Minimal size should be " + min + ", but was: " + value + " in"));
}
if (value > max) {
throw new AssertionError(dump.apply(msg + ". Maximal size should be " + max + ", but was: " + value + " in"));
throw new AssertionError(
dump.apply(msg + ". Maximal size should be " + max + ", but was: " + value + " in"));
}
counter = new ConcurrentHashMap<>();
return prev;
Expand Down Expand Up @@ -131,7 +132,6 @@ public void onReturnValue(VirtualFrame frame, Object result) {
calls.put(nodeId, funcCallInfo);
}
}

}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package org.enso.interpreter.test.instruments.service;

public record FunctionCallInfo(
String moduleName,
String typeName,
String functionName
) {
public record FunctionCallInfo(String moduleName, String typeName, String functionName) {

@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package org.enso.interpreter.test.instruments.service;

import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.RootNode;
import java.util.UUID;
import org.enso.interpreter.test.instruments.service.FunctionCallInfo;

/**
* A service that provides information from the `runtime` project to the instruments in this project
Expand All @@ -12,9 +10,14 @@
*/
public interface RuntimeTestService {
UUID getNodeID(Node node);

boolean isExpressionNode(Object node);

boolean isTailCallException(Object obj);

boolean isFunctionCallInstrumentationNode(Object node);

boolean isFunctionCall(Object obj);

FunctionCallInfo extractFunctionCallInfo(Object functionCall);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.Collection;
import java.util.List;

import org.graalvm.polyglot.Context;
import org.graalvm.polyglot.Source;
import org.graalvm.polyglot.Value;
Expand All @@ -11,8 +10,7 @@
import org.graalvm.polyglot.tck.TypeDescriptor;

public class EnsoTckLanguageProvider implements LanguageProvider {
public EnsoTckLanguageProvider() {
}
public EnsoTckLanguageProvider() {}

@Override
public String getId() {
Expand All @@ -34,42 +32,52 @@ public Collection<? extends Snippet> createValueConstructors(Context context) {

@Override
public Collection<? extends Snippet> createExpressions(Context context) {
var plus = context.eval("enso", """
var plus =
context
.eval("enso", """
plus a b = a + b
""").invokeMember("eval_expression", "plus");
""")
.invokeMember("eval_expression", "plus");

return List.of(
/* disabled until + is defined on Numbers again
Snippet.newBuilder("plus:Number", plus, TypeDescriptor.NUMBER)
.parameterTypes(TypeDescriptor.NUMBER, TypeDescriptor.NUMBER)
.build(),
*/
Snippet.newBuilder("plus:Text", plus, TypeDescriptor.STRING)
.parameterTypes(TypeDescriptor.STRING, TypeDescriptor.STRING)
.build()
);
/* disabled until + is defined on Numbers again
Snippet.newBuilder("plus:Number", plus, TypeDescriptor.NUMBER)
.parameterTypes(TypeDescriptor.NUMBER, TypeDescriptor.NUMBER)
.build(),
*/
Snippet.newBuilder("plus:Text", plus, TypeDescriptor.STRING)
.parameterTypes(TypeDescriptor.STRING, TypeDescriptor.STRING)
.build());
}

@Override
public Collection<? extends Snippet> createStatements(Context context) {
var when = context.eval("enso", """
var when =
context
.eval("enso", """
when c = if c then 1 else -1
""").invokeMember("eval_expression", "when");;
var which = context.eval("enso", """
""")
.invokeMember("eval_expression", "when");
;
var which =
context
.eval(
"enso",
"""
which c = case c of
0 -> "zero"
1 -> "one"
2 -> "two"
_ -> "a lot"
""").invokeMember("eval_expression", "which");
""")
.invokeMember("eval_expression", "which");
return List.of(
Snippet.newBuilder("if", when, TypeDescriptor.NUMBER)
.parameterTypes(TypeDescriptor.BOOLEAN)
.build(),
Snippet.newBuilder("if", which, TypeDescriptor.STRING)
.parameterTypes(TypeDescriptor.NUMBER)
.build()
);
Snippet.newBuilder("if", when, TypeDescriptor.NUMBER)
.parameterTypes(TypeDescriptor.BOOLEAN)
.build(),
Snippet.newBuilder("if", which, TypeDescriptor.STRING)
.parameterTypes(TypeDescriptor.NUMBER)
.build());
}

@Override
Expand All @@ -80,9 +88,9 @@ public Collection<? extends Snippet> createScripts(Context context) {
@Override
public Collection<? extends Source> createInvalidSyntaxScripts(Context context) {
return List.of(
Source.newBuilder("enso", """
Source.newBuilder("enso", """
main = x + 2
""", "unknown_x.enso").buildLiteral()
);
""", "unknown_x.enso")
.buildLiteral());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@

exports io.methvin.watcher;
exports io.methvin.watchservice;

opens io.methvin.watchservice.jna;
}
7 changes: 4 additions & 3 deletions lib/java/scala-libs-wrapper/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@
exports cats.kernel.instances.string;
exports cats.kernel.instances.sortedSet;

// "com.github.plokhotnyuk.jsoniter-scala" % ("jsoniter-scala-core_" + scalaVer) % jsoniterVersion,
// "com.github.plokhotnyuk.jsoniter-scala" % ("jsoniter-scala-core_" + scalaVer) %
// jsoniterVersion,
exports com.github.plokhotnyuk.jsoniter_scala.core;

// "com.github.plokhotnyuk.jsoniter-scala" % ("jsoniter-scala-macros_" + scalaVer) % jsoniterVersion,
// "com.github.plokhotnyuk.jsoniter-scala" % ("jsoniter-scala-macros_" + scalaVer) %
// jsoniterVersion,
exports com.github.plokhotnyuk.jsoniter_scala.macros;

// "com.typesafe.scala-logging" % ("scala-logging_" + scalaVer) % scalaLoggingVersion,
Expand All @@ -62,7 +64,6 @@
// "io.circe" % ("circe-parser_" + scalaVer) % circeVersion,
exports io.circe.parser;


// "io.circe" % ("circe-generic_" + scalaVer) % circeVersion,
exports io.circe.generic.decoding;
exports io.circe.generic;
Expand Down
7 changes: 3 additions & 4 deletions lib/java/zio-wrapper/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
exports zio.stacktracer;

// dev.zio:zio-interop-cats_2.13:23.0.0.6
//exports zio.interop.console;
//exports zio.interop.stm;
//exports zio.stream.interop;
// exports zio.interop.console;
// exports zio.interop.stm;
// exports zio.stream.interop;

// dev.zio:izumi-reflect_2.13:2.3.8
exports izumi.reflect;
Expand All @@ -35,5 +35,4 @@

// dev.zio:izumi-reflect-thirdparty-boopickle-shaded_2.13:2.3.8
exports izumi.reflect.thirdparty.internal.boopickle;

}

0 comments on commit e1da31b

Please sign in to comment.