From 55d52372595243381e00f85c92c954f37d7a1ed5 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 11 Nov 2022 12:37:50 -0600 Subject: [PATCH 1/9] Update GWT, and prune unneeded dependencies --- buildSrc/src/main/groovy/Classpaths.groovy | 11 +++++------ buildSrc/src/main/groovy/GwtTools.groovy | 4 ++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index a09da2269ad..9ca77f841fd 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -24,7 +24,7 @@ class Classpaths { static final String ELEMENTAL_VERSION = '1.1.0' static final String GWT_GROUP = 'com.google.gwt' - static final String GWT_VERSION = '2.9.0' + static final String GWT_VERSION = '2.10.0' static final String JAVA_PARSER_GROUP = 'com.github.javaparser' static final String JAVA_PARSER_NAME = 'javaparser-core' @@ -36,8 +36,7 @@ class Classpaths { static final String JAVAX_ANNOTATIONS_NAME = 'validation-api' static final String JAVAX_ANNOTATIONS_VERSION = '1.0.0.GA' - static final String JETTY_GROUP = 'org.eclipse.jetty' - static final String JETTY_VERSION = '9.4.20.v20190813' + static final String JETTY_VERSION = '9.4.44.v20210927' static final String JS_INTEROP_GROUP = 'com.google.jsinterop' static final String JS_INTEROP_VERSION = '2.0.0' @@ -146,9 +145,9 @@ class Classpaths { if (addDependency(config, GWT_GROUP, name, GWT_VERSION)) { // when we add gwt-dev, lets also force asm version, just to be safe. name == 'gwt-dev' && config.resolutionStrategy { - force 'org.ow2.asm:asm:5.0.3' - force 'org.ow2.asm:asm-util:5.0.3' - force 'org.ow2.asm:asm-commons:5.0.3' + force 'org.ow2.asm:asm:9.2' + force 'org.ow2.asm:asm-util:9.2' + force 'org.ow2.asm:asm-commons:9.2' } } } diff --git a/buildSrc/src/main/groovy/GwtTools.groovy b/buildSrc/src/main/groovy/GwtTools.groovy index 64517239f87..40acb779c4a 100644 --- a/buildSrc/src/main/groovy/GwtTools.groovy +++ b/buildSrc/src/main/groovy/GwtTools.groovy @@ -83,6 +83,10 @@ class GwtTools { static void applyDefaults(Project p, GwtExtension gwt, boolean compile = false) { gwt.gwtVersion = Classpaths.GWT_VERSION gwt.jettyVersion = Classpaths.JETTY_VERSION + p.configurations.each { + it.exclude group: 'net.sourceforge.htmlunit' + it.exclude group: 'org.eclipse.jetty' + } if (compile) { String warPath = new File(p.buildDir, 'gwt').absolutePath From 5591d2ca556d53bd51f47b9eaac939f728faba73 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Tue, 25 Jul 2023 10:36:16 -0500 Subject: [PATCH 2/9] Start moving to updated jsinterop jars --- buildSrc/src/main/groovy/Classpaths.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 9ca77f841fd..15a3b2e1031 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -39,7 +39,7 @@ class Classpaths { static final String JETTY_VERSION = '9.4.44.v20210927' static final String JS_INTEROP_GROUP = 'com.google.jsinterop' - static final String JS_INTEROP_VERSION = '2.0.0' + static final String JS_INTEROP_VERSION = '2.0.2' static final String COMMONS_GROUP = 'org.apache.commons' @@ -167,7 +167,7 @@ class Classpaths { addDependency config, JS_INTEROP_GROUP, name, // google is annoying, and have different versions released for the same groupId // :base: is the only one that is different, so we'll use it in the ternary. - name == 'base'? '1.0.0' : JS_INTEROP_VERSION + name == 'base'? '1.0.1' : JS_INTEROP_VERSION } static void inheritElemental(Project p, String name, String configName) { From 448a5895604742e27cde51317c9ea59e47066c33 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Sun, 25 Feb 2024 18:17:02 -0600 Subject: [PATCH 3/9] Update elemental2 --- buildSrc/src/main/groovy/Classpaths.groovy | 2 +- .../io/deephaven/web/client/api/CoreClient.java | 2 +- .../web/client/api/HasEventHandling.java | 2 +- .../web/client/api/JsPartitionedTable.java | 2 +- .../io/deephaven/web/client/api/JsTable.java | 4 ++-- .../web/client/api/JsTotalsTableConfig.java | 10 +++++----- .../web/client/api/WorkerConnection.java | 2 +- .../client/api/barrage/stream/BiDiStream.java | 2 +- .../barrage/stream/HandshakeStreamFactory.java | 16 ++++++++-------- .../web/client/api/storage/JsStorageService.java | 2 +- .../web/client/api/tree/JsRollupConfig.java | 10 +++++----- .../web/client/api/tree/JsTreeTable.java | 8 ++++---- .../web/client/api/widget/JsWidget.java | 2 +- .../api/widget/calendar/JsBusinessCalendar.java | 6 +++--- .../client/api/widget/calendar/JsHoliday.java | 2 +- .../web/client/api/widget/plot/ChartData.java | 6 +++--- .../api/widget/plot/FigureSubscription.java | 2 +- .../api/widget/plot/JsChartDescriptor.java | 6 +++--- .../api/widget/plot/JsFigureDescriptor.java | 8 ++++---- .../client/api/widget/plot/JsFigureFactory.java | 2 +- .../client/api/widget/plot/JsMultiSeries.java | 2 +- .../api/widget/plot/JsSeriesDescriptor.java | 2 +- .../web/client/api/widget/plot/OneClick.java | 2 +- .../java/io/deephaven/web/client/fu/JsItr.java | 2 +- .../io/deephaven/web/client/ide/IdeSession.java | 4 ++-- 25 files changed, 54 insertions(+), 54 deletions(-) diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 15a3b2e1031..06fc40ed55e 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -21,7 +21,7 @@ import org.gradle.internal.Actions class Classpaths { static final String ELEMENTAL_GROUP = 'com.google.elemental2' - static final String ELEMENTAL_VERSION = '1.1.0' + static final String ELEMENTAL_VERSION = '1.2.1' static final String GWT_GROUP = 'com.google.gwt' static final String GWT_VERSION = '2.10.0' diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/CoreClient.java b/web/client-api/src/main/java/io/deephaven/web/client/api/CoreClient.java index 2b11d61d8aa..8687dedcd18 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/CoreClient.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/CoreClient.java @@ -84,7 +84,7 @@ public String getServerUrl() { public Promise getAuthConfigValues() { return ideConnection.getConnectOptions().then(options -> { BrowserHeaders metadata = new BrowserHeaders(); - JsObject.keys(options.headers).forEach((key, index, arr) -> { + JsObject.keys(options.headers).forEach((key, index) -> { metadata.set(key, options.headers.get(key)); return null; }); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/HasEventHandling.java b/web/client-api/src/main/java/io/deephaven/web/client/api/HasEventHandling.java index adb57092f10..1f39d076dcd 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/HasEventHandling.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/HasEventHandling.java @@ -178,7 +178,7 @@ public void fireEvent(String type, CustomEvent e) { } if (map.has(e.type)) { final JsArray> callbacks = Js.cast(JsArray.from((JsArrayLike>) map.get(e.type))); - callbacks.forEach((item, ind, all) -> { + callbacks.forEach((item, ind) -> { try { item.onEvent(e); } catch (Throwable t) { diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/JsPartitionedTable.java b/web/client-api/src/main/java/io/deephaven/web/client/api/JsPartitionedTable.java index 04e34010d1f..38a184716a6 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/JsPartitionedTable.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/JsPartitionedTable.java @@ -163,7 +163,7 @@ private void handleKeys(Event update) { RangeSet added = eventData.getAdded().getRange(); added.indexIterator().forEachRemaining((long index) -> { // extract the key to use - JsArray key = eventData.getColumns().map((c, p1, p2) -> eventData.getData(index, c)); + JsArray key = eventData.getColumns().map((c, p1) -> eventData.getData(index, c)); knownKeys.add(key.asList()); CustomEventInit> init = CustomEventInit.create(); init.setDetail(key); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/JsTable.java b/web/client-api/src/main/java/io/deephaven/web/client/api/JsTable.java index 6f9a38f096c..4e380631ad7 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/JsTable.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/JsTable.java @@ -634,7 +634,7 @@ default CustomColumn asCustomColumn() { @JsMethod @SuppressWarnings("unusable-by-js") public JsArray applyCustomColumns(JsArray customColumns) { - String[] customColumnStrings = customColumns.map((item, index, array) -> { + String[] customColumnStrings = customColumns.map((item, index) -> { if (item.isString() || item.isCustomColumn()) { return item.toString(); } @@ -1728,7 +1728,7 @@ public void processSnapshot() { return; } JsArray viewportColumns = - getColumns().filter((item, index, all) -> debounce.columns.get(item.getIndex())); + getColumns().filter((item, index) -> debounce.columns.get(item.getIndex())); ViewportData data = new ViewportData(debounce.includedRows, debounce.dataColumns, viewportColumns, currentState.getRowFormatColumn() == null ? NO_ROW_FORMAT_COLUMN : currentState.getRowFormatColumn().getIndex(), diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/JsTotalsTableConfig.java b/web/client-api/src/main/java/io/deephaven/web/client/api/JsTotalsTableConfig.java index 8777f250dd0..b92364c9a6d 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/JsTotalsTableConfig.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/JsTotalsTableConfig.java @@ -133,7 +133,7 @@ public JsTotalsTableConfig(JsPropertyMap source) { if (source.has("operationMap")) { operationMap = source.getAsAny("operationMap").cast(); operationMap.forEach(key -> { - operationMap.get(key).forEach((value, index, array) -> { + operationMap.get(key).forEach((value, index) -> { checkOperation(Js.cast(value)); return null; }); @@ -237,9 +237,9 @@ public AggregateRequest buildRequest(JsArray allColumns) { Map> aggs = new HashMap<>(); List colsNeedingCompoundNames = new ArrayList<>(); Set seenColNames = new HashSet<>(); - groupBy.forEach((col, p1, p2) -> seenColNames.add(Js.cast(col))); + groupBy.forEach((col, p1) -> seenColNames.add(Js.cast(col))); this.operationMap.forEach(colName -> { - this.operationMap.get(colName).forEach((agg, index, arr) -> { + this.operationMap.get(colName).forEach((agg, index) -> { if (!JsAggregationOperation.canAggregateType(agg, columnTypes.get(colName))) { // skip this column. to follow DHE's behavior return null; @@ -272,7 +272,7 @@ public AggregateRequest buildRequest(JsArray allColumns) { AggregationCount count = new AggregationCount(); count.setColumnName("Count"); agg.setCount(count); - aggColumns.forEach((p0, p1, p2) -> { + aggColumns.forEach((p0, p1) -> { String colName = p0.split("=")[0].trim(); customColumns.push(colName + " = Count"); return null; @@ -296,7 +296,7 @@ public AggregateRequest buildRequest(JsArray allColumns) { columns.setSpec(spec); columns.setMatchPairsList(aggColumns); agg.setColumns(columns); - aggColumns.forEach((p0, p1, p2) -> { + aggColumns.forEach((p0, p1) -> { String colName = p0.split("=")[0].trim(); customColumns.push(colName + "= `` + " + colName); return null; diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java index a3808691c8b..625b80443df 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/WorkerConnection.java @@ -278,7 +278,7 @@ private void connectToWorker() { }), info.getConnectOptions().then(options -> { // set other specified headers, if any - JsObject.keys(options.headers).forEach((key, index, arr) -> { + JsObject.keys(options.headers).forEach((key, index) -> { metadata.set(key, options.headers.get(key)); return null; }); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/barrage/stream/BiDiStream.java b/web/client-api/src/main/java/io/deephaven/web/client/api/barrage/stream/BiDiStream.java index 0132c24899b..758fe62f20c 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/barrage/stream/BiDiStream.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/barrage/stream/BiDiStream.java @@ -187,7 +187,7 @@ static class EmulatedBiDiStream extends BiDiStream { public void send(T payload) { if (responseStream == null) { responseStream = responseStreamFactory.apply(payload); - pending.forEach((p0, p1, p2) -> { + pending.forEach((p0, p1) -> { p0.apply(responseStream); return null; }); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/barrage/stream/HandshakeStreamFactory.java b/web/client-api/src/main/java/io/deephaven/web/client/api/barrage/stream/HandshakeStreamFactory.java index 260a85254db..bae2d3c41fd 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/barrage/stream/HandshakeStreamFactory.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/barrage/stream/HandshakeStreamFactory.java @@ -50,18 +50,18 @@ public static BiDiStream create(WorkerConne Client client = Grpc.client(FlightService.Handshake, (io.deephaven.javascript.proto.dhinternal.grpcweb.grpc.ClientRpcOptions) options); client.onEnd((status, statusMessage, trailers) -> { - listeners.get(STATUS_EVENT_LISTENER_NAME).forEach((item, index, arr) -> item.call(null, + listeners.get(STATUS_EVENT_LISTENER_NAME).forEach((item, index) -> item.call(null, ResponseStreamWrapper.Status.of(status, statusMessage, metadata))); - listeners.get(END_EVENT_LISTENER_NAME).forEach((item, index, arr) -> item.call(null, + listeners.get(END_EVENT_LISTENER_NAME).forEach((item, index) -> item.call(null, ResponseStreamWrapper.Status.of(status, statusMessage, metadata))); listeners.clear(); }); client.onMessage(message -> { - listeners.get(DATA_EVENT_LISTENER_NAME).forEach((item, index, arr) -> item.call(null, message)); + listeners.get(DATA_EVENT_LISTENER_NAME).forEach((item, index) -> item.call(null, message)); }); client.onHeaders(headers -> { listeners.get(HEADERS_EVENT_LISTENER_NAME) - .forEach((item, index, arr) -> item.call(null, headers)); + .forEach((item, index) -> item.call(null, headers)); }); client.start(metadata); @@ -103,20 +103,20 @@ public BidirectionalStream write( props.setDebug(false); props.setOnMessage(responseMessage -> { listeners.get(DATA_EVENT_LISTENER_NAME) - .forEach((item, index, arr) -> item.call(null, responseMessage)); + .forEach((item, index) -> item.call(null, responseMessage)); }); props.setOnEnd((status, statusMessage, trailers) -> { listeners.get(STATUS_EVENT_LISTENER_NAME).forEach( - (item, index, arr) -> item.call(null, + (item, index) -> item.call(null, ResponseStreamWrapper.Status.of(status, statusMessage, metadata))); listeners.get(END_EVENT_LISTENER_NAME).forEach( - (item, index, arr) -> item.call(null, + (item, index) -> item.call(null, ResponseStreamWrapper.Status.of(status, statusMessage, metadata))); listeners.clear(); }); props.setOnHeaders(headers -> { listeners.get(HEADERS_EVENT_LISTENER_NAME) - .forEach((item, index, arr) -> item.call(null, headers)); + .forEach((item, index) -> item.call(null, headers)); }); Request client = Grpc.invoke.onInvoke(BrowserFlightService.OpenHandshake, props); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsStorageService.java b/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsStorageService.java index 0ec927df9ee..2e92acb3c01 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsStorageService.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/storage/JsStorageService.java @@ -65,7 +65,7 @@ public Promise> listItems(String path, @JsOptional String return Callbacks.grpcUnaryPromise(c -> client().listItems(req, metadata(), c::apply)) .then(response -> Promise .resolve(response.getItemsList() - .map((item, i, arr) -> JsItemDetails.fromProto(response.getCanonicalPath(), item)))); + .map((item, i) -> JsItemDetails.fromProto(response.getCanonicalPath(), item)))); } /** diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/tree/JsRollupConfig.java b/web/client-api/src/main/java/io/deephaven/web/client/api/tree/JsRollupConfig.java index f2861b1872c..1a0e966abc3 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/tree/JsRollupConfig.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/tree/JsRollupConfig.java @@ -115,10 +115,10 @@ public RollupRequest buildRequest(JsArray tableColumns) { Map> aggs = new HashMap<>(); List colsNeedingCompoundNames = new ArrayList<>(); Set seenColNames = new HashSet<>(); - groupingColumns.forEach((col, p1, p2) -> seenColNames.add(Js.cast(col))); + groupingColumns.forEach((col, p1) -> seenColNames.add(Js.cast(col))); this.aggregations.forEach(key -> { LinkedHashSet cols = new LinkedHashSet<>(); - this.aggregations.get(key).forEach((col, index, arr) -> { + this.aggregations.get(key).forEach((col, index) -> { String colName = Js.cast(col); cols.add(colName); if (seenColNames.contains(colName)) { @@ -297,14 +297,14 @@ private JsArray dedup(LinkedHashSet cols, List colsNeedi private String unusedColumnName(JsArray existingColumns, String... suggestedNames) { // Try to use the default column names for (String suggestedName : suggestedNames) { - if (!existingColumns.some((p0, p1, p2) -> p0.getName().equals(suggestedName))) { + if (!existingColumns.some((p0, p1) -> p0.getName().equals(suggestedName))) { return suggestedName; } } // Next add a suffix and use that if possible for (String suggestedName : suggestedNames) { - if (!existingColumns.some((p0, p1, p2) -> p0.getName().equals(suggestedName + "_"))) { + if (!existingColumns.some((p0, p1) -> p0.getName().equals(suggestedName + "_"))) { return suggestedName + "_"; } } @@ -312,7 +312,7 @@ private String unusedColumnName(JsArray existingColumns, String... sugge // Give up and add a timestamp suffix for (String suggestedName : suggestedNames) { if (!existingColumns - .some((p0, p1, p2) -> p0.getName().equals(suggestedName + "_" + System.currentTimeMillis()))) { + .some((p0, p1) -> p0.getName().equals(suggestedName + "_" + System.currentTimeMillis()))) { return suggestedName + "_" + System.currentTimeMillis(); } } diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/tree/JsTreeTable.java b/web/client-api/src/main/java/io/deephaven/web/client/api/tree/JsTreeTable.java index 37d8fecd497..50808f9776d 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/tree/JsTreeTable.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/tree/JsTreeTable.java @@ -158,7 +158,7 @@ private TreeViewportData(double offset, long viewportSize, double treeSize, Colu // Without modifying this.columns (copied and frozen), make sure our key columns are present // in the list of columns that we will copy data for the viewport - keyColumns.forEach((col, p1, p2) -> { + keyColumns.forEach((col, p1) -> { if (this.columns.indexOf(col) == -1) { columns[columns.length] = col; } @@ -567,8 +567,8 @@ private Promise makeKeyTable() { keyTableColumns.push(rowDepthCol); keyTableColumns.push(actionCol); keyTable = connection.newTable( - Js.uncheckedCast(keyTableColumns.map((p0, p1, p2) -> p0.getName())), - Js.uncheckedCast(keyTableColumns.map((p0, p1, p2) -> p0.getType())), + Js.uncheckedCast(keyTableColumns.map((p0, p1) -> p0.getName())), + Js.uncheckedCast(keyTableColumns.map((p0, p1) -> p0.getType())), keyTableData, null, null); @@ -804,7 +804,7 @@ private BitSet makeColumnSubscriptionBitset() { } columnsBitset.set(rowDepthCol.getIndex()); columnsBitset.set(rowExpandedCol.getIndex()); - keyColumns.forEach((p0, p1, p2) -> { + keyColumns.forEach((p0, p1) -> { columnsBitset.set(p0.getIndex()); return null; }); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/JsWidget.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/JsWidget.java index 3581ce102a4..e0a35c53791 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/JsWidget.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/JsWidget.java @@ -145,7 +145,7 @@ public Promise refetch() { messageStream.onData(res -> { JsArray responseObjects = res.getData().getExportedReferencesList() - .map((p0, p1, p2) -> new JsWidgetExportedObject(connection, p0)); + .map((p0, p1) -> new JsWidgetExportedObject(connection, p0)); if (!hasFetched) { response = res; exportedObjects = responseObjects; diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/calendar/JsBusinessCalendar.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/calendar/JsBusinessCalendar.java index c2a50c1417a..837a67a1618 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/calendar/JsBusinessCalendar.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/calendar/JsBusinessCalendar.java @@ -28,9 +28,9 @@ public JsBusinessCalendar(BusinessCalendarDescriptor businessCalendarDescriptor) JsObject.freeze(this.businessCalendarDescriptor); timeZone = JsTimeZone.getTimeZone(businessCalendarDescriptor.getTimeZone()); businessPeriods = - businessCalendarDescriptor.getBusinessPeriodsList().map((p0, p1, p2) -> new JsBusinessPeriod(p0)); + businessCalendarDescriptor.getBusinessPeriodsList().map((p0, p1) -> new JsBusinessPeriod(p0)); JsObject.freeze(businessPeriods); - holidays = businessCalendarDescriptor.getHolidaysList().map((p0, p1, p2) -> new JsHoliday(p0)); + holidays = businessCalendarDescriptor.getHolidaysList().map((p0, p1) -> new JsHoliday(p0)); JsObject.freeze(holidays); } @@ -62,7 +62,7 @@ public JsTimeZone getTimeZone() { @JsProperty public JsArray getBusinessDays() { return businessCalendarDescriptor.getBusinessDaysList() - .map((p0, p1, p2) -> JsDayOfWeek.values()[(int) (double) p0]); + .map((p0, p1) -> JsDayOfWeek.values()[(int) (double) p0]); } /** diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/calendar/JsHoliday.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/calendar/JsHoliday.java index 5cce1d42ee5..f3deea8d0fc 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/calendar/JsHoliday.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/calendar/JsHoliday.java @@ -21,7 +21,7 @@ public class JsHoliday { public JsHoliday(Holiday holiday) { date = new LocalDateWrapper(holiday.getDate().getYear(), holiday.getDate().getMonth(), holiday.getDate().getDay()); - businessPeriods = holiday.getBusinessPeriodsList().map((p0, p1, p2) -> new JsBusinessPeriod(p0)); + businessPeriods = holiday.getBusinessPeriodsList().map((p0, p1) -> new JsBusinessPeriod(p0)); JsObject.freeze(businessPeriods); } diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/ChartData.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/ChartData.java index b81b84dbc3b..8a30411fd33 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/ChartData.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/ChartData.java @@ -128,7 +128,7 @@ public void update(UpdateEventData tableData) { assert cachedData.values().stream().flatMap(m -> m.values().stream()) .allMatch(arr -> arr.length == indexes.length); assert cachedData.values().stream().flatMap(m -> m.values().stream()).allMatch(arr -> arr - .reduce((Object val, Any p1, int p2, JsArray p3) -> ((Integer) val) + 1, 0) == indexes.length); + .reduce((Object val, Any p1, int p2) -> ((Integer) val) + 1, 0) == indexes.length); JsRangeSet fullIndex = tableData.getFullIndex(); PrimitiveIterator.OfLong iter = fullIndex.getRange().indexIterator(); @@ -240,10 +240,10 @@ public JsArray getColumn(String columnName, JsFunction mappingFun private JsArray collectAllData(String columnName, JsFunction mappingFunc, TableData currentUpdate) { Column column = table.findColumn(columnName); if (mappingFunc == null) { - return currentUpdate.getRows().map((p0, p1, p2) -> p0.get(column)); + return currentUpdate.getRows().map((p0, p1) -> p0.get(column)); } - return currentUpdate.getRows().map((p0, p1, p2) -> mappingFunc.apply(p0.get(column))); + return currentUpdate.getRows().map((p0, p1) -> mappingFunc.apply(p0.get(column))); } /** diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/FigureSubscription.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/FigureSubscription.java index e71ba18e458..2b1ed636861 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/FigureSubscription.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/FigureSubscription.java @@ -252,7 +252,7 @@ private Promise subscribe(final Promise tablePromise } TableSubscription sub = table.subscribe( - table.getColumns().filter((c, index, all) -> this.requiredColumns.contains(c.getName()))); + table.getColumns().filter((c, index) -> this.requiredColumns.contains(c.getName()))); // TODO, technically we can probably unsubscribe to the table at this point, since we're listening to the // subscription itself diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsChartDescriptor.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsChartDescriptor.java index ee4147d0238..c6e8f048dc9 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsChartDescriptor.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsChartDescriptor.java @@ -55,21 +55,21 @@ public JsChartDescriptor(JsPropertyMap source) { Map axisMap = new HashMap<>(); if (source.has("axes")) { JsArray axes = source.getAsAny("axes").cast(); - this.axes = Js.uncheckedCast(axes.map((axisSource, index, all) -> { + this.axes = Js.uncheckedCast(axes.map((axisSource, index) -> { if (axisSource instanceof JsAxisDescriptor) { return (JsAxisDescriptor) axisSource; } else { return new JsAxisDescriptor((JsPropertyMap) axisSource); } })); - this.axes.forEach((axis, i, all) -> axisMap.put(axes.getAt(i), axis)); + this.axes.forEach((axis, i) -> axisMap.put(axes.getAt(i), axis)); } else { throw new IllegalArgumentException("'axes' property must be set"); } if (source.has("series")) { JsArray series = source.getAsAny("series").cast(); - this.series = Js.uncheckedCast(series.map((seriesSource, index, all) -> { + this.series = Js.uncheckedCast(series.map((seriesSource, index) -> { if (seriesSource instanceof JsSeriesDescriptor) { return (JsSeriesDescriptor) seriesSource; } else { diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigureDescriptor.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigureDescriptor.java index aeb5624898b..4d1d4f17e60 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigureDescriptor.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigureDescriptor.java @@ -50,7 +50,7 @@ public JsFigureDescriptor(JsPropertyMap source) { this(); JsArray charts = JsData.getRequiredProperty(source, "charts").cast(); - this.charts = Js.uncheckedCast(charts.map((chartSource, index, all) -> { + this.charts = Js.uncheckedCast(charts.map((chartSource, index) -> { if (chartSource instanceof JsChartDescriptor) { return (JsChartDescriptor) chartSource; } else { @@ -70,9 +70,9 @@ public JsFigureDescriptor(JsPropertyMap source) { @JsIgnore public JsArray getTables() { Set tableSet = new HashSet<>(); - charts.forEach((chart, i1, a1) -> { - chart.series.forEach((series, i2, a2) -> { - series.dataSources.forEach((source, i3, a3) -> { + charts.forEach((chart, i1) -> { + chart.series.forEach((series, i2) -> { + series.dataSources.forEach((source, i3) -> { tableSet.add(source.table); return null; }); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigureFactory.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigureFactory.java index 38a6780fcbf..0b2dd4109ca 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigureFactory.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsFigureFactory.java @@ -43,7 +43,7 @@ private static Promise create(JsFigureDescriptor descriptor) { FetchObjectResponse response = new FetchObjectResponse(); response.setData(figureDescriptor.serializeBinary()); Promise[] tableCopyPromises = - tables.map((table, index, all) -> table.copy(false)).asArray(new Promise[0]); + tables.map((table, index) -> table.copy(false)).asArray(new Promise[0]); return Promise.all(tableCopyPromises) .then(unknownTableCopies -> { JsArray jsTableCopies = Js.cast(unknownTableCopies); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsMultiSeries.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsMultiSeries.java index 432b9ca6ad9..482bb9e281f 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsMultiSeries.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsMultiSeries.java @@ -84,7 +84,7 @@ private void requestTable(JsPartitionedTable partitionedTable, Object key) { seriesInstance.setDataSourcesList( descriptor.getDataSourcesList() - .map((multiSeriesSource, p1, p2) -> { + .map((multiSeriesSource, p1) -> { SourceDescriptor sourceDescriptor = new SourceDescriptor(); sourceDescriptor.setColumnName(multiSeriesSource.getColumnName()); sourceDescriptor.setAxisId(multiSeriesSource.getAxisId()); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsSeriesDescriptor.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsSeriesDescriptor.java index 3fea7c635a4..8ac17cc7302 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsSeriesDescriptor.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/JsSeriesDescriptor.java @@ -57,7 +57,7 @@ public JsSeriesDescriptor(JsPropertyMap source, Map> dataSources = JsData.getRequiredProperty(source, "dataSources").cast(); - this.dataSources = dataSources.map((sourceSource, index, all) -> new JsSourceDescriptor(sourceSource, axisMap)); + this.dataSources = dataSources.map((sourceSource, index) -> new JsSourceDescriptor(sourceSource, axisMap)); linesVisible = JsData.getNullableBooleanProperty(source, "linesVisible"); shapesVisible = JsData.getNullableBooleanProperty(source, "shapesVisible"); gradientVisible = JsData.getNullableBooleanProperty(source, "gradientVisible"); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/OneClick.java b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/OneClick.java index 2736ecc0344..d95fa11614b 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/OneClick.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/widget/plot/OneClick.java @@ -129,7 +129,7 @@ private Object[] getCurrentKeys() { } // Some of the values aren't set, need to iterate through all the table map keys and select the ones that match - return JsArray.from(partitionedTable.getKeys()).filter((tableKey, index, all) -> { + return JsArray.from(partitionedTable.getKeys()).filter((tableKey, index) -> { if (!(tableKey instanceof String[])) { return false; } diff --git a/web/client-api/src/main/java/io/deephaven/web/client/fu/JsItr.java b/web/client-api/src/main/java/io/deephaven/web/client/fu/JsItr.java index b1254a8f973..d1658750014 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/fu/JsItr.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/fu/JsItr.java @@ -64,7 +64,7 @@ public T next() { * js forEach signature is a bit weird, so we'll adapt it to something saner here */ public static void forEach(JsMap map, JsBiConsumer callback) { - map.forEach((v, k, m) -> { + map.forEach((v, k) -> { callback.apply(k, v); return null; }); diff --git a/web/client-api/src/main/java/io/deephaven/web/client/ide/IdeSession.java b/web/client-api/src/main/java/io/deephaven/web/client/ide/IdeSession.java index 314daf265a9..438c5c857e4 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/ide/IdeSession.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/ide/IdeSession.java @@ -370,7 +370,7 @@ public Promise> getCompl .timeout(JsTable.MAX_BATCH_TIME) .asPromise() .then(res -> Promise.resolve( - res.getCompletionItems().getItemsList().map((item, index, arr) -> LspTranslate.toJs(item))), + res.getCompletionItems().getItemsList().map((item, index) -> LspTranslate.toJs(item))), fail -> { // noinspection unchecked, rawtypes return (Promise>) (Promise) Promise @@ -398,7 +398,7 @@ public Promise> ge .timeout(JsTable.MAX_BATCH_TIME) .asPromise() .then(res -> Promise.resolve( - res.getSignatures().getSignaturesList().map((item, index, arr) -> LspTranslate.toJs(item))), + res.getSignatures().getSignaturesList().map((item, index) -> LspTranslate.toJs(item))), fail -> { // noinspection unchecked, rawtypes return (Promise>) (Promise) Promise From 4d12c1d48450a4090fbc8735f7a72bb91eedc74a Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Sun, 25 Feb 2024 20:44:21 -0600 Subject: [PATCH 4/9] Dirty hack to use newer gwt --- buildSrc/build.gradle | 2 +- buildSrc/src/main/groovy/Classpaths.groovy | 4 +- buildSrc/src/main/groovy/GwtTools.groovy | 274 +++++++++--------- web/client-api/client-api.gradle | 22 +- web/client-backplane/client-backplane.gradle | 2 +- .../table_pb_service/TableServiceClient.java | 2 - web/shared-beans/shared-beans.gradle | 2 +- .../io/deephaven/web/shared/data/Range.java | 3 +- .../shared/data/TableSubscriptionRequest.java | 3 +- 9 files changed, 164 insertions(+), 150 deletions(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index a413615a03c..9230722e592 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -17,7 +17,7 @@ repositories { } dependencies { - implementation('de.esoco.gwt:gwt-gradle-plugin:1.2.0') { + implementation('org.docstr:gwt-gradle-plugin:1.1.30') { exclude group: 'org.codehaus.groovy' because('needed for GwtTools') } diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 06fc40ed55e..23d98b50539 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -23,8 +23,8 @@ class Classpaths { static final String ELEMENTAL_GROUP = 'com.google.elemental2' static final String ELEMENTAL_VERSION = '1.2.1' - static final String GWT_GROUP = 'com.google.gwt' - static final String GWT_VERSION = '2.10.0' + static final String GWT_GROUP = 'org.gwtproject' + static final String GWT_VERSION = '2.11.0' static final String JAVA_PARSER_GROUP = 'com.github.javaparser' static final String JAVA_PARSER_NAME = 'javaparser-core' diff --git a/buildSrc/src/main/groovy/GwtTools.groovy b/buildSrc/src/main/groovy/GwtTools.groovy index 40acb779c4a..ef728cce19d 100644 --- a/buildSrc/src/main/groovy/GwtTools.groovy +++ b/buildSrc/src/main/groovy/GwtTools.groovy @@ -1,137 +1,137 @@ -import de.esoco.gwt.gradle.GwtLibPlugin -import de.esoco.gwt.gradle.GwtPlugin -import de.esoco.gwt.gradle.extension.GwtExtension -import de.esoco.gwt.gradle.task.GwtCheckTask -import de.esoco.gwt.gradle.task.GwtCompileTask -import groovy.transform.CompileStatic -import org.gradle.api.Project -import org.gradle.api.artifacts.ProjectDependency -import org.gradle.api.file.ConfigurableFileCollection -import org.gradle.api.plugins.JavaPlugin -import org.gradle.api.tasks.compile.JavaCompile - -import java.nio.file.Files - -/** - * Helper to simplify / centralize configuring gwt plugins in build files - */ -@CompileStatic -class GwtTools { - - static GwtExtension gwtLib(Project p) { - p.plugins.apply(GwtLibPlugin) - GwtExtension ext = p.extensions.getByType(GwtExtension) - applyDefaults(p, ext) - return ext - } - static GwtExtension gwtCompile(Project p, String module, String description) { - p.plugins.apply(GwtPlugin) - GwtExtension ext = p.extensions.getByType(GwtExtension) - applyDefaults(p, ext, true) - - // Apply our module settings to and gwtc task; - // currently, there should only be one such task, - // but we used to have two, and may have two again later, - // so we'll leave this setup to be friendly-for-reuse - p.tasks.withType(GwtCompileTask).all { - GwtCompileTask gwtc -> - applyModuleSettings p, gwtc, module,description - } - // This GWT plugin will fail if tests are run after compilation, instead - // we suppress running the test at all, and ensure that it doesn't check - // if it even can be run until after compile finishes. - p.tasks.withType(GwtCheckTask).configureEach {t -> - t.mustRunAfter(p.tasks.withType(GwtCompileTask)) - t.onlyIf { false } - } - - return ext - } - - static void applyModuleSettings(Project p, GwtCompileTask gwtc, String mod, String description) { - gwtc.onlyIf WebTools.&shouldRun - boolean gwtDev = p.findProperty('gwtDev') == 'true' - String extras = new File(p.buildDir, "gwt/dhapi/extra").absolutePath - - GwtExtension gwt = p.extensions.findByType(GwtExtension) - - gwt.with { - module "${mod}${gwtDev ? 'Dev' : ''}" - compile.with { - style = 'PRETTY' - generateJsInteropExports = true - // TODO move this down a line when we want to give clients js that is not super strict / rigged to blow - checkAssertions = true - if (gwtDev) { - saveSource = true - extra = extras - logLevel = 'INFO' - draftCompile = true - } - } - } - - p.gradle.projectsEvaluated { - addGeneratedSources(p, gwtc) - } - - gwtDev && gwtc.doFirst { - gwtc.logger.quiet('Running in gwt dev mode; saving source to {}/dh/src', extras) - } - } - - static void applyDefaults(Project p, GwtExtension gwt, boolean compile = false) { - gwt.gwtVersion = Classpaths.GWT_VERSION - gwt.jettyVersion = Classpaths.JETTY_VERSION - p.configurations.each { - it.exclude group: 'net.sourceforge.htmlunit' - it.exclude group: 'org.eclipse.jetty' - } - if (compile) { - - String warPath = new File(p.buildDir, 'gwt').absolutePath - - gwt.compile.with { - // See https://github.com/esoco/gwt-gradle-plugin for all options - /** The level of logging detail (ERROR, WARN, INFO, TRACE, DEBUG, SPAM, ALL) */ - logLevel = "INFO" - /** Where to write output files */ - war = warPath - /** Compile a report that tells the "Story of Your Compile". */ - compileReport = false - /** Compile quickly with minimal optimizations. */ - draftCompile = false - /** Include assert statements in compiled output. */ - checkAssertions = false - /** Script output style. (OBF, PRETTY, DETAILED)*/ - style = "OBF" - /** Sets the optimization level used by the compiler. 0=none 9=maximum. */ - optimize = 9 - /** Fail compilation if any input file contains an error. */ - strict = true - /** Specifies Java source level. ("1.6", "1.7")*/ - sourceLevel = "11" - /** The number of local workers to use when compiling permutations. */ - localWorkers = 1 - /** Emit extra information allow chrome dev tools to display Java identifiers in many places instead of JavaScript functions. (NONE, ONLY_METHOD_NAME, ABBREVIATED, FULL)*/ -// methodNameDisplayMode = "NONE" - - /** Java args */ - maxHeapSize = "1024m" - minHeapSize = "512m" - } - } - } - - static void addGeneratedSources(Project project, GwtCompileTask gwtc) { - if (project.configurations.getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME).dependencies) { - (gwtc.src as ConfigurableFileCollection).from( - (project.tasks.getByName(JavaPlugin.COMPILE_JAVA_TASK_NAME) as JavaCompile).options.generatedSourceOutputDirectory - ) - } - project.configurations.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME).allDependencies.withType(ProjectDependency)*.dependencyProject*.each { - Project p -> addGeneratedSources(p, gwtc) - } - } - -} +//import de.esoco.gwt.gradle.GwtLibPlugin +//import de.esoco.gwt.gradle.GwtPlugin +//import de.esoco.gwt.gradle.extension.GwtExtension +//import de.esoco.gwt.gradle.task.GwtCheckTask +//import de.esoco.gwt.gradle.task.GwtCompileTask +//import groovy.transform.CompileStatic +//import org.gradle.api.Project +//import org.gradle.api.artifacts.ProjectDependency +//import org.gradle.api.file.ConfigurableFileCollection +//import org.gradle.api.plugins.JavaPlugin +//import org.gradle.api.tasks.compile.JavaCompile +// +//import java.nio.file.Files +// +///** +// * Helper to simplify / centralize configuring gwt plugins in build files +// */ +//@CompileStatic +//class GwtTools { +// +// static GwtExtension gwtLib(Project p) { +// p.plugins.apply(GwtLibPlugin) +// GwtExtension ext = p.extensions.getByType(GwtExtension) +// applyDefaults(p, ext) +// return ext +// } +// static GwtExtension gwtCompile(Project p, String module, String description) { +// p.plugins.apply(GwtPlugin) +// GwtExtension ext = p.extensions.getByType(GwtExtension) +// applyDefaults(p, ext, true) +// +// // Apply our module settings to and gwtc task; +// // currently, there should only be one such task, +// // but we used to have two, and may have two again later, +// // so we'll leave this setup to be friendly-for-reuse +// p.tasks.withType(GwtCompileTask).all { +// GwtCompileTask gwtc -> +// applyModuleSettings p, gwtc, module,description +// } +// // This GWT plugin will fail if tests are run after compilation, instead +// // we suppress running the test at all, and ensure that it doesn't check +// // if it even can be run until after compile finishes. +// p.tasks.withType(GwtCheckTask).configureEach {t -> +// t.mustRunAfter(p.tasks.withType(GwtCompileTask)) +// t.onlyIf { false } +// } +// +// return ext +// } +// +// static void applyModuleSettings(Project p, GwtCompileTask gwtc, String mod, String description) { +// gwtc.onlyIf WebTools.&shouldRun +// boolean gwtDev = p.findProperty('gwtDev') == 'true' +// String extras = new File(p.buildDir, "gwt/dhapi/extra").absolutePath +// +// GwtExtension gwt = p.extensions.findByType(GwtExtension) +// +// gwt.with { +// module "${mod}${gwtDev ? 'Dev' : ''}" +// compile.with { +// style = 'PRETTY' +// generateJsInteropExports = true +// // TODO move this down a line when we want to give clients js that is not super strict / rigged to blow +// checkAssertions = true +// if (gwtDev) { +// saveSource = true +// extra = extras +// logLevel = 'INFO' +// draftCompile = true +// } +// } +// } +// +// p.gradle.projectsEvaluated { +// addGeneratedSources(p, gwtc) +// } +// +// gwtDev && gwtc.doFirst { +// gwtc.logger.quiet('Running in gwt dev mode; saving source to {}/dh/src', extras) +// } +// } +// +// static void applyDefaults(Project p, GwtExtension gwt, boolean compile = false) { +// gwt.gwtVersion = Classpaths.GWT_VERSION +// gwt.jettyVersion = Classpaths.JETTY_VERSION +// p.configurations.each { +// it.exclude group: 'net.sourceforge.htmlunit' +// it.exclude group: 'org.eclipse.jetty' +// } +// if (compile) { +// +// String warPath = new File(p.buildDir, 'gwt').absolutePath +// +// gwt.compile.with { +// // See https://github.com/esoco/gwt-gradle-plugin for all options +// /** The level of logging detail (ERROR, WARN, INFO, TRACE, DEBUG, SPAM, ALL) */ +// logLevel = "INFO" +// /** Where to write output files */ +// war = warPath +// /** Compile a report that tells the "Story of Your Compile". */ +// compileReport = false +// /** Compile quickly with minimal optimizations. */ +// draftCompile = false +// /** Include assert statements in compiled output. */ +// checkAssertions = false +// /** Script output style. (OBF, PRETTY, DETAILED)*/ +// style = "OBF" +// /** Sets the optimization level used by the compiler. 0=none 9=maximum. */ +// optimize = 9 +// /** Fail compilation if any input file contains an error. */ +// strict = true +// /** Specifies Java source level. ("1.6", "1.7")*/ +// sourceLevel = "11" +// /** The number of local workers to use when compiling permutations. */ +// localWorkers = 1 +// /** Emit extra information allow chrome dev tools to display Java identifiers in many places instead of JavaScript functions. (NONE, ONLY_METHOD_NAME, ABBREVIATED, FULL)*/ +//// methodNameDisplayMode = "NONE" +// +// /** Java args */ +// maxHeapSize = "1024m" +// minHeapSize = "512m" +// } +// } +// } +// +// static void addGeneratedSources(Project project, GwtCompileTask gwtc) { +// if (project.configurations.getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME).dependencies) { +// (gwtc.src as ConfigurableFileCollection).from( +// (project.tasks.getByName(JavaPlugin.COMPILE_JAVA_TASK_NAME) as JavaCompile).options.generatedSourceOutputDirectory +// ) +// } +// project.configurations.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME).allDependencies.withType(ProjectDependency)*.dependencyProject*.each { +// Project p -> addGeneratedSources(p, gwtc) +// } +// } +// +//} diff --git a/web/client-api/client-api.gradle b/web/client-api/client-api.gradle index 2aba31ade74..6398392f385 100644 --- a/web/client-api/client-api.gradle +++ b/web/client-api/client-api.gradle @@ -6,6 +6,7 @@ import io.deephaven.tools.docker.WaitForHealthyContainer plugins { id 'io.deephaven.project.register' id 'io.deephaven.deephaven-in-docker' + id 'gwt-compiler' } evaluationDependsOn(Docker.registryProject('selenium')) @@ -36,12 +37,29 @@ Classpaths.inheritElemental(project, 'elemental2-core', 'implementation') Classpaths.inheritElemental(project, 'elemental2-promise', 'implementation') Classpaths.inheritElemental(project, 'elemental2-dom', 'implementation') -GwtTools.gwtCompile project, 'io.deephaven.web.DeephavenApi', 'Create a jar of client JS API' +//GwtTools.gwtCompile project, 'io.deephaven.web.DeephavenApi', 'Create a jar of client JS API' + +evaluationDependsOn ':web-shared-beans' +evaluationDependsOn ':web-client-backplane' +gwt { + gwtVersion = '2.11.0' + modules 'io.deephaven.web.DeephavenApi' + + src += files(project.files(project(':web-shared-beans').sourceSets.main.allSource.srcDirs)) + src += files(project.files(project(':web-client-backplane').sourceSets.main.allSource.srcDirs)) + src += files(project.files(project(':open-api-shared-fu').sourceSets.main.allSource.srcDirs)) + + maxHeapSize '1024m' + + jsInteropExports{ + setGenerate true + } +} def jsOutput = layout.buildDirectory.dir('js') def gwtOutput = tasks.register('gwtOutput', Sync) { includeEmptyDirs = false - from(tasks.getByName('gwtCompile').outputs.files) { + from(tasks.getByName('compileGwt').outputs.files) { // only copy the dhapi module, and don't give it a wrapper directory include 'dhapi/**' eachFile { it.path = 'jsapi/' + it.path.substring('dhapi/'.length()) } diff --git a/web/client-backplane/client-backplane.gradle b/web/client-backplane/client-backplane.gradle index 789e55560d8..6a43d7c2124 100644 --- a/web/client-backplane/client-backplane.gradle +++ b/web/client-backplane/client-backplane.gradle @@ -7,7 +7,7 @@ evaluationDependsOn ':proto:proto-backplane-grpc' apply from: "$rootDir/gradle/web-common.gradle" -GwtTools.gwtLib project +//GwtTools.gwtLib project Classpaths.inheritJsInterop(project, 'base', 'implementation') Classpaths.inheritJsInterop(project, 'jsinterop-annotations', 'compileOnly') Classpaths.inheritElemental(project, 'elemental2-core', 'implementation') diff --git a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/table_pb_service/TableServiceClient.java b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/table_pb_service/TableServiceClient.java index 1ebc02af377..26614581ffe 100644 --- a/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/table_pb_service/TableServiceClient.java +++ b/web/client-backplane/src/main/java/io/deephaven/javascript/proto/dhinternal/io/deephaven/proto/table_pb_service/TableServiceClient.java @@ -49,8 +49,6 @@ import jsinterop.base.Js; import jsinterop.base.JsPropertyMap; -import javax.validation.constraints.NotNull; - @JsType( isNative = true, name = "dhinternal.io.deephaven.proto.table_pb_service.TableServiceClient", diff --git a/web/shared-beans/shared-beans.gradle b/web/shared-beans/shared-beans.gradle index fce2b3afde0..17b7319784b 100644 --- a/web/shared-beans/shared-beans.gradle +++ b/web/shared-beans/shared-beans.gradle @@ -5,7 +5,7 @@ plugins { apply from: "$rootDir/gradle/web-common.gradle" -GwtTools.gwtLib project +//GwtTools.gwtLib project configurations { testImplementation.extendsFrom junit diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/data/Range.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/data/Range.java index 16ef88a4e60..dd27d94535d 100644 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/data/Range.java +++ b/web/shared-beans/src/main/java/io/deephaven/web/shared/data/Range.java @@ -3,7 +3,6 @@ // package io.deephaven.web.shared.data; -import javax.annotation.Nonnull; import java.io.Serializable; /** @@ -45,7 +44,7 @@ void setLast(long last) { } @Override - public int compareTo(@Nonnull Range o) { + public int compareTo(Range o) { return Long.compare(first, o.first); } diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/data/TableSubscriptionRequest.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/data/TableSubscriptionRequest.java index 3dc940db123..eff667c2899 100644 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/data/TableSubscriptionRequest.java +++ b/web/shared-beans/src/main/java/io/deephaven/web/shared/data/TableSubscriptionRequest.java @@ -3,7 +3,6 @@ // package io.deephaven.web.shared.data; -import javax.annotation.Nullable; import java.io.Serializable; import java.util.BitSet; @@ -35,7 +34,7 @@ public TableSubscriptionRequest() { } - public TableSubscriptionRequest(int subscriptionId, @Nullable RangeSet rows, BitSet columns) { + public TableSubscriptionRequest(int subscriptionId, RangeSet rows, BitSet columns) { this.subscriptionId = subscriptionId; this.rows = rows; this.columns = columns; From c3e6dba8dfdc53899e3283134af5b9c6c1fb7cc5 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Mon, 26 Feb 2024 11:56:38 -0600 Subject: [PATCH 5/9] WIP --- buildSrc/src/main/groovy/Classpaths.groovy | 3 ++- .../groovy/io.deephaven.repository-conventions.gradle | 4 ++++ web/client-api/client-api.gradle | 11 ++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index 23d98b50539..f69830ea7fe 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -24,7 +24,8 @@ class Classpaths { static final String ELEMENTAL_VERSION = '1.2.1' static final String GWT_GROUP = 'org.gwtproject' - static final String GWT_VERSION = '2.11.0' + static final String GWT_VERSION = '2.12.0-instanceof-SNAPSHOT' +// static final String GWT_VERSION = '2.11.0' static final String JAVA_PARSER_GROUP = 'com.github.javaparser' static final String JAVA_PARSER_NAME = 'javaparser-core' diff --git a/buildSrc/src/main/groovy/io.deephaven.repository-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.repository-conventions.gradle index 1deccf352c0..92fcd2771cc 100644 --- a/buildSrc/src/main/groovy/io.deephaven.repository-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.repository-conventions.gradle @@ -13,4 +13,8 @@ repositories { includeGroup 'org.apache.kafka' } } +// maven { +// url 'https://oss.sonatype.org/content/repositories/snapshots/' +// } + mavenLocal() } diff --git a/web/client-api/client-api.gradle b/web/client-api/client-api.gradle index 6398392f385..6676c504be8 100644 --- a/web/client-api/client-api.gradle +++ b/web/client-api/client-api.gradle @@ -41,8 +41,14 @@ Classpaths.inheritElemental(project, 'elemental2-dom', 'implementation') evaluationDependsOn ':web-shared-beans' evaluationDependsOn ':web-client-backplane' +repositories { + maven { + url 'https://oss.sonatype.org/content/repositories/snapshots/' + } +} gwt { - gwtVersion = '2.11.0' + gwtVersion = "2.12.0-instanceof-SNAPSHOT" +// gwtVersion = "2.11.0" modules 'io.deephaven.web.DeephavenApi' src += files(project.files(project(':web-shared-beans').sourceSets.main.allSource.srcDirs)) @@ -51,9 +57,12 @@ gwt { maxHeapSize '1024m' + extraJvmArgs += ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005'] + jsInteropExports{ setGenerate true } +// extraDir layout.buildDirectory.dir('gwt/extra') } def jsOutput = layout.buildDirectory.dir('js') From dd6e35007a48c4bf6d9816df99c77ccfe27d8e04 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Mon, 25 Mar 2024 12:37:02 -0500 Subject: [PATCH 6/9] Clean up to consider merging --- buildSrc/src/main/groovy/Classpaths.groovy | 3 +-- web/client-api/client-api.gradle | 18 ++++-------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/buildSrc/src/main/groovy/Classpaths.groovy b/buildSrc/src/main/groovy/Classpaths.groovy index f69830ea7fe..23d98b50539 100644 --- a/buildSrc/src/main/groovy/Classpaths.groovy +++ b/buildSrc/src/main/groovy/Classpaths.groovy @@ -24,8 +24,7 @@ class Classpaths { static final String ELEMENTAL_VERSION = '1.2.1' static final String GWT_GROUP = 'org.gwtproject' - static final String GWT_VERSION = '2.12.0-instanceof-SNAPSHOT' -// static final String GWT_VERSION = '2.11.0' + static final String GWT_VERSION = '2.11.0' static final String JAVA_PARSER_GROUP = 'com.github.javaparser' static final String JAVA_PARSER_NAME = 'javaparser-core' diff --git a/web/client-api/client-api.gradle b/web/client-api/client-api.gradle index 6676c504be8..028db31557d 100644 --- a/web/client-api/client-api.gradle +++ b/web/client-api/client-api.gradle @@ -10,6 +10,8 @@ plugins { } evaluationDependsOn(Docker.registryProject('selenium')) +evaluationDependsOn ':web-shared-beans' +evaluationDependsOn ':web-client-backplane' apply from: "$rootDir/gradle/web-client.gradle" @@ -37,18 +39,8 @@ Classpaths.inheritElemental(project, 'elemental2-core', 'implementation') Classpaths.inheritElemental(project, 'elemental2-promise', 'implementation') Classpaths.inheritElemental(project, 'elemental2-dom', 'implementation') -//GwtTools.gwtCompile project, 'io.deephaven.web.DeephavenApi', 'Create a jar of client JS API' - -evaluationDependsOn ':web-shared-beans' -evaluationDependsOn ':web-client-backplane' -repositories { - maven { - url 'https://oss.sonatype.org/content/repositories/snapshots/' - } -} gwt { - gwtVersion = "2.12.0-instanceof-SNAPSHOT" -// gwtVersion = "2.11.0" + gwtVersion = Classpaths.GWT_VERSION modules 'io.deephaven.web.DeephavenApi' src += files(project.files(project(':web-shared-beans').sourceSets.main.allSource.srcDirs)) @@ -57,9 +49,7 @@ gwt { maxHeapSize '1024m' - extraJvmArgs += ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005'] - - jsInteropExports{ + jsInteropExports { setGenerate true } // extraDir layout.buildDirectory.dir('gwt/extra') From cfbe4ca13a2fd5d5bb0a10b2b4a632b8f61ce4b0 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 5 Jun 2024 14:01:23 -0500 Subject: [PATCH 7/9] Revert plugin change, apply rules to change groupId, and clean up old code --- buildSrc/build.gradle | 2 +- buildSrc/src/main/groovy/GwtTools.groovy | 275 +++++++++--------- ...io.deephaven.repository-conventions.gradle | 4 - gradle/web-client.gradle | 8 - gradle/web-common.gradle | 20 -- open-api/lang-parser/lang-parser.gradle | 2 - open-api/lang-tools/lang-tools.gradle | 2 - open-api/shared-fu/shared-fu.gradle | 2 - web/client-api/client-api.gradle | 23 +- web/client-backplane/client-backplane.gradle | 9 +- web/shared-beans/shared-beans.gradle | 4 +- .../io/deephaven/web/shared/data/Range.java | 3 +- .../shared/data/TableSubscriptionRequest.java | 3 +- 13 files changed, 148 insertions(+), 209 deletions(-) delete mode 100644 gradle/web-client.gradle delete mode 100644 gradle/web-common.gradle diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 9230722e592..a413615a03c 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -17,7 +17,7 @@ repositories { } dependencies { - implementation('org.docstr:gwt-gradle-plugin:1.1.30') { + implementation('de.esoco.gwt:gwt-gradle-plugin:1.2.0') { exclude group: 'org.codehaus.groovy' because('needed for GwtTools') } diff --git a/buildSrc/src/main/groovy/GwtTools.groovy b/buildSrc/src/main/groovy/GwtTools.groovy index ef728cce19d..dfed4edb5a4 100644 --- a/buildSrc/src/main/groovy/GwtTools.groovy +++ b/buildSrc/src/main/groovy/GwtTools.groovy @@ -1,137 +1,138 @@ -//import de.esoco.gwt.gradle.GwtLibPlugin -//import de.esoco.gwt.gradle.GwtPlugin -//import de.esoco.gwt.gradle.extension.GwtExtension -//import de.esoco.gwt.gradle.task.GwtCheckTask -//import de.esoco.gwt.gradle.task.GwtCompileTask -//import groovy.transform.CompileStatic -//import org.gradle.api.Project -//import org.gradle.api.artifacts.ProjectDependency -//import org.gradle.api.file.ConfigurableFileCollection -//import org.gradle.api.plugins.JavaPlugin -//import org.gradle.api.tasks.compile.JavaCompile -// -//import java.nio.file.Files -// -///** -// * Helper to simplify / centralize configuring gwt plugins in build files -// */ -//@CompileStatic -//class GwtTools { -// -// static GwtExtension gwtLib(Project p) { -// p.plugins.apply(GwtLibPlugin) -// GwtExtension ext = p.extensions.getByType(GwtExtension) -// applyDefaults(p, ext) -// return ext -// } -// static GwtExtension gwtCompile(Project p, String module, String description) { -// p.plugins.apply(GwtPlugin) -// GwtExtension ext = p.extensions.getByType(GwtExtension) -// applyDefaults(p, ext, true) -// -// // Apply our module settings to and gwtc task; -// // currently, there should only be one such task, -// // but we used to have two, and may have two again later, -// // so we'll leave this setup to be friendly-for-reuse -// p.tasks.withType(GwtCompileTask).all { -// GwtCompileTask gwtc -> -// applyModuleSettings p, gwtc, module,description -// } -// // This GWT plugin will fail if tests are run after compilation, instead -// // we suppress running the test at all, and ensure that it doesn't check -// // if it even can be run until after compile finishes. -// p.tasks.withType(GwtCheckTask).configureEach {t -> -// t.mustRunAfter(p.tasks.withType(GwtCompileTask)) -// t.onlyIf { false } -// } -// -// return ext -// } -// -// static void applyModuleSettings(Project p, GwtCompileTask gwtc, String mod, String description) { -// gwtc.onlyIf WebTools.&shouldRun -// boolean gwtDev = p.findProperty('gwtDev') == 'true' -// String extras = new File(p.buildDir, "gwt/dhapi/extra").absolutePath -// -// GwtExtension gwt = p.extensions.findByType(GwtExtension) -// -// gwt.with { -// module "${mod}${gwtDev ? 'Dev' : ''}" -// compile.with { -// style = 'PRETTY' -// generateJsInteropExports = true -// // TODO move this down a line when we want to give clients js that is not super strict / rigged to blow -// checkAssertions = true -// if (gwtDev) { -// saveSource = true -// extra = extras -// logLevel = 'INFO' -// draftCompile = true -// } -// } -// } -// -// p.gradle.projectsEvaluated { -// addGeneratedSources(p, gwtc) -// } -// -// gwtDev && gwtc.doFirst { -// gwtc.logger.quiet('Running in gwt dev mode; saving source to {}/dh/src', extras) -// } -// } -// -// static void applyDefaults(Project p, GwtExtension gwt, boolean compile = false) { -// gwt.gwtVersion = Classpaths.GWT_VERSION -// gwt.jettyVersion = Classpaths.JETTY_VERSION -// p.configurations.each { -// it.exclude group: 'net.sourceforge.htmlunit' -// it.exclude group: 'org.eclipse.jetty' -// } -// if (compile) { -// -// String warPath = new File(p.buildDir, 'gwt').absolutePath -// -// gwt.compile.with { -// // See https://github.com/esoco/gwt-gradle-plugin for all options -// /** The level of logging detail (ERROR, WARN, INFO, TRACE, DEBUG, SPAM, ALL) */ -// logLevel = "INFO" -// /** Where to write output files */ -// war = warPath -// /** Compile a report that tells the "Story of Your Compile". */ -// compileReport = false -// /** Compile quickly with minimal optimizations. */ -// draftCompile = false -// /** Include assert statements in compiled output. */ -// checkAssertions = false -// /** Script output style. (OBF, PRETTY, DETAILED)*/ -// style = "OBF" -// /** Sets the optimization level used by the compiler. 0=none 9=maximum. */ -// optimize = 9 -// /** Fail compilation if any input file contains an error. */ -// strict = true -// /** Specifies Java source level. ("1.6", "1.7")*/ -// sourceLevel = "11" -// /** The number of local workers to use when compiling permutations. */ -// localWorkers = 1 -// /** Emit extra information allow chrome dev tools to display Java identifiers in many places instead of JavaScript functions. (NONE, ONLY_METHOD_NAME, ABBREVIATED, FULL)*/ -//// methodNameDisplayMode = "NONE" -// -// /** Java args */ -// maxHeapSize = "1024m" -// minHeapSize = "512m" -// } -// } -// } -// -// static void addGeneratedSources(Project project, GwtCompileTask gwtc) { -// if (project.configurations.getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME).dependencies) { -// (gwtc.src as ConfigurableFileCollection).from( -// (project.tasks.getByName(JavaPlugin.COMPILE_JAVA_TASK_NAME) as JavaCompile).options.generatedSourceOutputDirectory -// ) -// } -// project.configurations.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME).allDependencies.withType(ProjectDependency)*.dependencyProject*.each { -// Project p -> addGeneratedSources(p, gwtc) -// } -// } -// -//} +import de.esoco.gwt.gradle.GwtLibPlugin +import de.esoco.gwt.gradle.GwtPlugin +import de.esoco.gwt.gradle.extension.GwtExtension +import de.esoco.gwt.gradle.task.GwtCheckTask +import de.esoco.gwt.gradle.task.GwtCompileTask +import groovy.transform.CompileStatic +import org.gradle.api.Project +import org.gradle.api.artifacts.Configuration +import org.gradle.api.artifacts.ProjectDependency +import org.gradle.api.file.ConfigurableFileCollection +import org.gradle.api.plugins.JavaPlugin +import org.gradle.api.tasks.compile.JavaCompile + +/** + * Helper to simplify / centralize configuring gwt plugins in build files + */ +@CompileStatic +class GwtTools { + + static GwtExtension gwtLib(Project p) { + p.plugins.apply(GwtLibPlugin) + GwtExtension ext = p.extensions.getByType(GwtExtension) + applyDefaults(p, ext) + return ext + } + static GwtExtension gwtCompile(Project p, String module, String description) { + p.plugins.apply(GwtPlugin) + GwtExtension ext = p.extensions.getByType(GwtExtension) + applyDefaults(p, ext, true) + + // Apply our module settings to and gwtc task; + // currently, there should only be one such task, + // but we used to have two, and may have two again later, + // so we'll leave this setup to be friendly-for-reuse + p.tasks.withType(GwtCompileTask).all { + GwtCompileTask gwtc -> + applyModuleSettings p, gwtc, module,description + } + // This GWT plugin will fail if tests are run after compilation, instead + // we suppress running the test at all, and ensure that it doesn't check + // if it even can be run until after compile finishes. + p.tasks.withType(GwtCheckTask).configureEach {t -> + t.mustRunAfter(p.tasks.withType(GwtCompileTask)) + t.onlyIf { false } + } + + return ext + } + + static void applyModuleSettings(Project p, GwtCompileTask gwtc, String mod, String description) { + gwtc.onlyIf WebTools.&shouldRun + boolean gwtDev = p.findProperty('gwtDev') == 'true' + String extras = new File(p.buildDir, "gwt/dhapi/extra").absolutePath + + GwtExtension gwt = p.extensions.findByType(GwtExtension) + + gwt.with { + module "${mod}${gwtDev ? 'Dev' : ''}" + compile.with { + style = 'PRETTY' + generateJsInteropExports = true + // TODO move this down a line when we want to give clients js that is not super strict / rigged to blow + checkAssertions = true + if (gwtDev) { + saveSource = true + extra = extras + logLevel = 'INFO' + draftCompile = true + } + } + } + + p.gradle.projectsEvaluated { + addGeneratedSources(p, gwtc) + } + + gwtDev && gwtc.doFirst { + gwtc.logger.quiet('Running in gwt dev mode; saving source to {}/dh/src', extras) + } + } + + static void applyDefaults(Project p, GwtExtension gwt, boolean compile = false) { + gwt.gwtVersion = Classpaths.GWT_VERSION + gwt.jettyVersion = Classpaths.JETTY_VERSION + p.configurations.all { Configuration c -> + c.resolutionStrategy.dependencySubstitution { sub -> + sub.substitute(sub.module("com.google.gwt:gwt-codeserver")).using(sub.module('org.gwtproject:gwt-codeserver:2.11.0')) + sub.substitute(sub.module("com.google.gwt:gwt-user")).using(sub.module('org.gwtproject:gwt-user:2.11.0')) + sub.substitute(sub.module("com.google.gwt:gwt-dev")).using(sub.module('org.gwtproject:gwt-dev:2.11.0')) + } + } + if (compile) { + String warPath = new File(p.buildDir, 'gwt').absolutePath + + gwt.compile.with { + // See https://github.com/esoco/gwt-gradle-plugin for all options + /** The level of logging detail (ERROR, WARN, INFO, TRACE, DEBUG, SPAM, ALL) */ + logLevel = "INFO" + /** Where to write output files */ + war = warPath + /** Compile a report that tells the "Story of Your Compile". */ + compileReport = false + /** Compile quickly with minimal optimizations. */ + draftCompile = false + /** Include assert statements in compiled output. */ + checkAssertions = false + /** Script output style. (OBF, PRETTY, DETAILED)*/ + style = "OBF" + /** Sets the optimization level used by the compiler. 0=none 9=maximum. */ + optimize = 9 + /** Fail compilation if any input file contains an error. */ + strict = true + /** Specifies Java source level. ("1.6", "1.7")*/ + sourceLevel = "11" + /** The number of local workers to use when compiling permutations. */ + localWorkers = 1 + /** Emit extra information allow chrome dev tools to display Java identifiers in many places instead of JavaScript functions. (NONE, ONLY_METHOD_NAME, ABBREVIATED, FULL)*/ +// methodNameDisplayMode = "NONE" + + /** Java args */ + maxHeapSize = "1024m" + minHeapSize = "512m" + } + } + } + + static void addGeneratedSources(Project project, GwtCompileTask gwtc) { + if (project.configurations.getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME).dependencies) { + (gwtc.src as ConfigurableFileCollection).from( + (project.tasks.getByName(JavaPlugin.COMPILE_JAVA_TASK_NAME) as JavaCompile).options.generatedSourceOutputDirectory + ) + } + project.configurations.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME).allDependencies.withType(ProjectDependency)*.dependencyProject*.each { + Project p -> addGeneratedSources(p, gwtc) + } + } + +} diff --git a/buildSrc/src/main/groovy/io.deephaven.repository-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.repository-conventions.gradle index 92fcd2771cc..1deccf352c0 100644 --- a/buildSrc/src/main/groovy/io.deephaven.repository-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.repository-conventions.gradle @@ -13,8 +13,4 @@ repositories { includeGroup 'org.apache.kafka' } } -// maven { -// url 'https://oss.sonatype.org/content/repositories/snapshots/' -// } - mavenLocal() } diff --git a/gradle/web-client.gradle b/gradle/web-client.gradle deleted file mode 100644 index 6f909db8d0c..00000000000 --- a/gradle/web-client.gradle +++ /dev/null @@ -1,8 +0,0 @@ -apply from: "$rootDir/gradle/web-common.gradle" - -// To perform production compile: gw gCo (./gradlew gwtCompile) -// To start the dev server: gw gCS (./gradlew gwtCodeServer) - -Classpaths.inheritGwt project, 'gwt-user', 'compileOnly' -Classpaths.inheritGwt project, 'gwt-user', 'testImplementation' -Classpaths.inheritGwt project, 'gwt-dev', 'testImplementation' diff --git a/gradle/web-common.gradle b/gradle/web-common.gradle deleted file mode 100644 index af8341ff820..00000000000 --- a/gradle/web-common.gradle +++ /dev/null @@ -1,20 +0,0 @@ -// basics of a java project; -apply plugin: 'java' - -// we are explicitly setting sourceSets to "standard defaults" -// since the rest of dh uses simple `src` folder names, -// and we use "project already configured themselves" -// to tell the root buildscript to leave these alone. -sourceSets { - main { - java.setSrcDirs (['src/main/java']) - resources.setSrcDirs (['src/main/resources']) - resources.setExcludes([]) - } - test { - java.setSrcDirs (['src/test/java']) - resources.setSrcDirs (['src/test/resources']) - resources.setExcludes([]) - } -} - diff --git a/open-api/lang-parser/lang-parser.gradle b/open-api/lang-parser/lang-parser.gradle index d785dc7c187..dc1b7bf805f 100644 --- a/open-api/lang-parser/lang-parser.gradle +++ b/open-api/lang-parser/lang-parser.gradle @@ -7,8 +7,6 @@ plugins { id 'io.deephaven.project.register' } -apply from: "$rootDir/gradle/web-common.gradle" - dependencies { implementation project(':Util') api project(':open-api-shared-fu') diff --git a/open-api/lang-tools/lang-tools.gradle b/open-api/lang-tools/lang-tools.gradle index 65745757d87..b91c8029f48 100644 --- a/open-api/lang-tools/lang-tools.gradle +++ b/open-api/lang-tools/lang-tools.gradle @@ -4,8 +4,6 @@ plugins { id 'java-library' } -apply from: "$rootDir/gradle/web-common.gradle" - Classpaths.inheritCommonsText(project, 'implementation') dependencies { diff --git a/open-api/shared-fu/shared-fu.gradle b/open-api/shared-fu/shared-fu.gradle index 143e4e15d74..6dbf79ed1cb 100644 --- a/open-api/shared-fu/shared-fu.gradle +++ b/open-api/shared-fu/shared-fu.gradle @@ -2,6 +2,4 @@ plugins { id 'io.deephaven.project.register' } -apply from: "$rootDir/gradle/web-common.gradle" - // Contains all general purpose utilities used across all open-api modules. diff --git a/web/client-api/client-api.gradle b/web/client-api/client-api.gradle index 028db31557d..ad7dac4b5ea 100644 --- a/web/client-api/client-api.gradle +++ b/web/client-api/client-api.gradle @@ -6,14 +6,9 @@ import io.deephaven.tools.docker.WaitForHealthyContainer plugins { id 'io.deephaven.project.register' id 'io.deephaven.deephaven-in-docker' - id 'gwt-compiler' } evaluationDependsOn(Docker.registryProject('selenium')) -evaluationDependsOn ':web-shared-beans' -evaluationDependsOn ':web-client-backplane' - -apply from: "$rootDir/gradle/web-client.gradle" configurations { js @@ -39,26 +34,12 @@ Classpaths.inheritElemental(project, 'elemental2-core', 'implementation') Classpaths.inheritElemental(project, 'elemental2-promise', 'implementation') Classpaths.inheritElemental(project, 'elemental2-dom', 'implementation') -gwt { - gwtVersion = Classpaths.GWT_VERSION - modules 'io.deephaven.web.DeephavenApi' - - src += files(project.files(project(':web-shared-beans').sourceSets.main.allSource.srcDirs)) - src += files(project.files(project(':web-client-backplane').sourceSets.main.allSource.srcDirs)) - src += files(project.files(project(':open-api-shared-fu').sourceSets.main.allSource.srcDirs)) - - maxHeapSize '1024m' - - jsInteropExports { - setGenerate true - } -// extraDir layout.buildDirectory.dir('gwt/extra') -} +GwtTools.gwtCompile project, 'io.deephaven.web.DeephavenApi', 'Create a jar of client JS API' def jsOutput = layout.buildDirectory.dir('js') def gwtOutput = tasks.register('gwtOutput', Sync) { includeEmptyDirs = false - from(tasks.getByName('compileGwt').outputs.files) { + from(tasks.getByName('gwtCompile').outputs.files) { // only copy the dhapi module, and don't give it a wrapper directory include 'dhapi/**' eachFile { it.path = 'jsapi/' + it.path.substring('dhapi/'.length()) } diff --git a/web/client-backplane/client-backplane.gradle b/web/client-backplane/client-backplane.gradle index 6a43d7c2124..0a9fcab9750 100644 --- a/web/client-backplane/client-backplane.gradle +++ b/web/client-backplane/client-backplane.gradle @@ -2,13 +2,8 @@ plugins { id 'io.deephaven.project.register' } -evaluationDependsOn ':proto' -evaluationDependsOn ':proto:proto-backplane-grpc' - -apply from: "$rootDir/gradle/web-common.gradle" - -//GwtTools.gwtLib project +GwtTools.gwtLib project Classpaths.inheritJsInterop(project, 'base', 'implementation') Classpaths.inheritJsInterop(project, 'jsinterop-annotations', 'compileOnly') Classpaths.inheritElemental(project, 'elemental2-core', 'implementation') -Classpaths.inheritElemental(project, 'elemental2-promise', 'implementation') \ No newline at end of file +Classpaths.inheritElemental(project, 'elemental2-promise', 'implementation') diff --git a/web/shared-beans/shared-beans.gradle b/web/shared-beans/shared-beans.gradle index 17b7319784b..8cbca1fba04 100644 --- a/web/shared-beans/shared-beans.gradle +++ b/web/shared-beans/shared-beans.gradle @@ -3,9 +3,7 @@ plugins { id 'java-library' } -apply from: "$rootDir/gradle/web-common.gradle" - -//GwtTools.gwtLib project +GwtTools.gwtLib project configurations { testImplementation.extendsFrom junit diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/data/Range.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/data/Range.java index dd27d94535d..16ef88a4e60 100644 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/data/Range.java +++ b/web/shared-beans/src/main/java/io/deephaven/web/shared/data/Range.java @@ -3,6 +3,7 @@ // package io.deephaven.web.shared.data; +import javax.annotation.Nonnull; import java.io.Serializable; /** @@ -44,7 +45,7 @@ void setLast(long last) { } @Override - public int compareTo(Range o) { + public int compareTo(@Nonnull Range o) { return Long.compare(first, o.first); } diff --git a/web/shared-beans/src/main/java/io/deephaven/web/shared/data/TableSubscriptionRequest.java b/web/shared-beans/src/main/java/io/deephaven/web/shared/data/TableSubscriptionRequest.java index eff667c2899..3dc940db123 100644 --- a/web/shared-beans/src/main/java/io/deephaven/web/shared/data/TableSubscriptionRequest.java +++ b/web/shared-beans/src/main/java/io/deephaven/web/shared/data/TableSubscriptionRequest.java @@ -3,6 +3,7 @@ // package io.deephaven.web.shared.data; +import javax.annotation.Nullable; import java.io.Serializable; import java.util.BitSet; @@ -34,7 +35,7 @@ public TableSubscriptionRequest() { } - public TableSubscriptionRequest(int subscriptionId, RangeSet rows, BitSet columns) { + public TableSubscriptionRequest(int subscriptionId, @Nullable RangeSet rows, BitSet columns) { this.subscriptionId = subscriptionId; this.rows = rows; this.columns = columns; From 7e16d95a65c385bf937e7b353113aa187a428c72 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 5 Jun 2024 16:46:38 -0500 Subject: [PATCH 8/9] Restore test dependency, and fix elemental changes in tests --- web/client-api/client-api.gradle | 1 + .../io/deephaven/web/client/api/AbstractAsyncGwtTestCase.java | 4 ++-- .../io/deephaven/web/client/api/TableManipulationTestGwt.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/web/client-api/client-api.gradle b/web/client-api/client-api.gradle index ad7dac4b5ea..1c480dc5b8f 100644 --- a/web/client-api/client-api.gradle +++ b/web/client-api/client-api.gradle @@ -33,6 +33,7 @@ dependencies { Classpaths.inheritElemental(project, 'elemental2-core', 'implementation') Classpaths.inheritElemental(project, 'elemental2-promise', 'implementation') Classpaths.inheritElemental(project, 'elemental2-dom', 'implementation') +Classpaths.inheritGwt(project, 'gwt-user', 'testImplementation') GwtTools.gwtCompile project, 'io.deephaven.web.DeephavenApi', 'Create a jar of client JS API' diff --git a/web/client-api/src/test/java/io/deephaven/web/client/api/AbstractAsyncGwtTestCase.java b/web/client-api/src/test/java/io/deephaven/web/client/api/AbstractAsyncGwtTestCase.java index 7b36f3b98a5..557f0ec2952 100644 --- a/web/client-api/src/test/java/io/deephaven/web/client/api/AbstractAsyncGwtTestCase.java +++ b/web/client-api/src/test/java/io/deephaven/web/client/api/AbstractAsyncGwtTestCase.java @@ -376,7 +376,7 @@ protected Promise assertNextViewportIs(JsTable table, Function r.get(a)); + return viewportData.getRows().map((r, index) -> r.get(a)); } protected Promise assertNextViewportIs(JsTable table, double... expected) { @@ -389,7 +389,7 @@ protected Promise assertNextViewportIs(JsTable table, double... expecte public static List filterColumns(JsTable table, JsPredicate filter) { List matches = new ArrayList<>(); - table.getColumns().forEach((c, i, arr) -> { + table.getColumns().forEach((c, i) -> { if (filter.test(c)) { matches.add(c); } diff --git a/web/client-api/src/test/java/io/deephaven/web/client/api/TableManipulationTestGwt.java b/web/client-api/src/test/java/io/deephaven/web/client/api/TableManipulationTestGwt.java index b0299cbc9ca..3cea8926e8e 100644 --- a/web/client-api/src/test/java/io/deephaven/web/client/api/TableManipulationTestGwt.java +++ b/web/client-api/src/test/java/io/deephaven/web/client/api/TableManipulationTestGwt.java @@ -505,7 +505,7 @@ public void testDateTimeInFilters() { table.setViewport(0, 2, null); return assertUpdateReceived(table, viewportData -> { - viewportData.getRows().forEach((row, index, all) -> { + viewportData.getRows().forEach((row, index) -> { dates.add(row.get(table.findColumn("Timestamp")).cast()); return null; }); From 35df8e56f3d3f0f9c300b74d335ca81ff3843c46 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Fri, 7 Jun 2024 11:13:33 -0500 Subject: [PATCH 9/9] Pass the expected gwt version into the replacement rules --- buildSrc/src/main/groovy/GwtTools.groovy | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/groovy/GwtTools.groovy b/buildSrc/src/main/groovy/GwtTools.groovy index dfed4edb5a4..c33b299c419 100644 --- a/buildSrc/src/main/groovy/GwtTools.groovy +++ b/buildSrc/src/main/groovy/GwtTools.groovy @@ -84,9 +84,12 @@ class GwtTools { gwt.jettyVersion = Classpaths.JETTY_VERSION p.configurations.all { Configuration c -> c.resolutionStrategy.dependencySubstitution { sub -> - sub.substitute(sub.module("com.google.gwt:gwt-codeserver")).using(sub.module('org.gwtproject:gwt-codeserver:2.11.0')) - sub.substitute(sub.module("com.google.gwt:gwt-user")).using(sub.module('org.gwtproject:gwt-user:2.11.0')) - sub.substitute(sub.module("com.google.gwt:gwt-dev")).using(sub.module('org.gwtproject:gwt-dev:2.11.0')) + sub.substitute(sub.module("com.google.gwt:gwt-codeserver")) + .using(sub.module("org.gwtproject:gwt-codeserver:${Classpaths.GWT_VERSION}")) + sub.substitute(sub.module("com.google.gwt:gwt-user")) + .using(sub.module("org.gwtproject:gwt-user:${Classpaths.GWT_VERSION}")) + sub.substitute(sub.module("com.google.gwt:gwt-dev")) + .using(sub.module("org.gwtproject:gwt-dev:${Classpaths.GWT_VERSION}")) } } if (compile) {