diff --git a/build_tools/doctool/src/com/google/doctool/custom/FindPackages.java b/build_tools/doctool/src/com/google/doctool/custom/FindPackages.java index fb00872b4a5..54404a8960d 100644 --- a/build_tools/doctool/src/com/google/doctool/custom/FindPackages.java +++ b/build_tools/doctool/src/com/google/doctool/custom/FindPackages.java @@ -85,7 +85,7 @@ public class FindPackages { */ private static final String[] SOURCE_DIRS = { "user/src", "user/javadoc", "user/super", "dev/core/src", - "dev/core/super"}; + "dev/core/super", "build/out/user/jakarta-src"}; /** * Individual user classes to include, even if the rest of their packages diff --git a/distro-source/build.xml b/distro-source/build.xml index 03e1c7b4867..90e0448383c 100755 --- a/distro-source/build.xml +++ b/distro-source/build.xml @@ -32,6 +32,7 @@ + diff --git a/doc/build.xml b/doc/build.xml index 10050f29e37..97c85ef8e47 100644 --- a/doc/build.xml +++ b/doc/build.xml @@ -18,6 +18,8 @@ + + @@ -27,6 +29,7 @@ + @@ -35,11 +38,27 @@ + + + + + + + + + + + + + - + + + + diff --git a/maven/lib-gwt.sh b/maven/lib-gwt.sh index bd10e2d67b6..bb8ac49f7e4 100644 --- a/maven/lib-gwt.sh +++ b/maven/lib-gwt.sh @@ -76,7 +76,7 @@ function maven-gwt() { popd > /dev/null done - gwtLibs='dev user servlet codeserver' + gwtLibs='dev user servlet servlet-jakarta codeserver' echo "Removing bundled third-parties from gwt-dev" zip -q $GWT_EXTRACT_DIR/gwt-dev.jar --copy --out $GWT_EXTRACT_DIR/gwt-dev-trimmed.jar \ @@ -118,8 +118,9 @@ function maven-gwt() { # If there are no sources, use gwt-user sources. # This is a bit hacky but Sonatype requires a # source jar for Central, and lack of sources - # should only happen for gwt-servlet which is - # basically a subset of gwt-user. + # should only happen for gwt-servlet and + # gwt-servlet-jakarta, which are basically a + # subset of gwt-user. if [ ! -f $SOURCES_PATH_FILE ]; then SOURCES_PATH_FILE=$GWT_EXTRACT_DIR/gwt-user-sources.jar fi @@ -130,7 +131,7 @@ function maven-gwt() { # Deploy RequestFactory jars maven-deploy-file $mavenRepoUrl $mavenRepoId $pomDir/requestfactory/pom.xml $pomDir/requestfactory/pom.xml || die - for i in client server apt + for i in client server apt server-jakarta do maven-deploy-file $mavenRepoUrl $mavenRepoId $GWT_EXTRACT_DIR/requestfactory-${i}.jar $pomDir/requestfactory/${i}/pom.xml \ $JAVADOC_FILE_PATH $GWT_EXTRACT_DIR/requestfactory-${i}-src.jar \ diff --git a/maven/poms/gwt/gwt-servlet-jakarta/pom-template.xml b/maven/poms/gwt/gwt-servlet-jakarta/pom-template.xml new file mode 100644 index 00000000000..769bb1d2834 --- /dev/null +++ b/maven/poms/gwt/gwt-servlet-jakarta/pom-template.xml @@ -0,0 +1,29 @@ + + + 4.0.0 + + org.gwtproject + gwt + ${gwtVersion} + + org.gwtproject + gwt-servlet-jakarta + jar + ${gwtVersion} + + + javax.validation + validation-api + + true + + + com.google.code.gson + gson + + true + + + diff --git a/maven/poms/gwt/pom-template.xml b/maven/poms/gwt/pom-template.xml index 4e5f1fda8a2..0f288bae1e9 100644 --- a/maven/poms/gwt/pom-template.xml +++ b/maven/poms/gwt/pom-template.xml @@ -66,6 +66,11 @@ gwt-servlet ${project.version} + + org.gwtproject + gwt-servlet-jakarta + ${project.version} + org.gwtproject.web.bindery requestfactory diff --git a/maven/poms/requestfactory/server-jakarta/pom-template.xml b/maven/poms/requestfactory/server-jakarta/pom-template.xml new file mode 100644 index 00000000000..3c2db06e31f --- /dev/null +++ b/maven/poms/requestfactory/server-jakarta/pom-template.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + org.gwtproject.web.bindery + requestfactory + ${gwtVersion} + + org.gwtproject.web.bindery + requestfactory-server-jakarta + jar + ${gwtVersion} + + + javax.validation + validation-api + + + com.google.code.gson + gson + + true + + + diff --git a/requestfactory/build.xml b/requestfactory/build.xml index 334a7278715..c835c86da4e 100755 --- a/requestfactory/build.xml +++ b/requestfactory/build.xml @@ -21,17 +21,24 @@ + + - + + + @@ -81,6 +88,18 @@ + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user/build.xml b/user/build.xml index 3153cc893cb..1f43783a4c0 100755 --- a/user/build.xml +++ b/user/build.xml @@ -119,9 +119,7 @@ "> - - @@ -144,6 +142,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user/src/com/google/gwt/core/server/jakarta/package-info.java b/user/src/com/google/gwt/core/server/jakarta/package-info.java new file mode 100644 index 00000000000..63a3e2ea255 --- /dev/null +++ b/user/src/com/google/gwt/core/server/jakarta/package-info.java @@ -0,0 +1,23 @@ +/* + * Copyright 2023 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +/** + * Jakarta-specific package for server-only classes. To use these types, be sure + * to use the {@code gwt-servlet-jakarta.jar}. + * + * @since GWT 2.11 + */ +package com.google.gwt.core.server.jakarta; diff --git a/user/src/com/google/gwt/logging/server/jakarta/package-info.java b/user/src/com/google/gwt/logging/server/jakarta/package-info.java new file mode 100644 index 00000000000..de28fe4c010 --- /dev/null +++ b/user/src/com/google/gwt/logging/server/jakarta/package-info.java @@ -0,0 +1,23 @@ +/* + * Copyright 2023 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +/** + * Jakarta-specific package for server-only classes. To use these types, be sure + * to use the {@code gwt-servlet-jakarta.jar}. + * + * @since GWT 2.11 + */ +package com.google.gwt.logging.server.jakarta; diff --git a/user/src/com/google/gwt/user/server/jakarta/package-info.java b/user/src/com/google/gwt/user/server/jakarta/package-info.java new file mode 100644 index 00000000000..31f287e739e --- /dev/null +++ b/user/src/com/google/gwt/user/server/jakarta/package-info.java @@ -0,0 +1,23 @@ +/* + * Copyright 2023 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +/** + * Jakarta-specific package for server-only classes. To use these types, be sure + * to use the {@code gwt-servlet-jakarta.jar}. + * + * @since GWT 2.11 + */ +package com.google.gwt.user.server.jakarta; diff --git a/user/src/com/google/gwt/user/server/rpc/jakarta/package-info.java b/user/src/com/google/gwt/user/server/rpc/jakarta/package-info.java new file mode 100644 index 00000000000..d02d7bc1952 --- /dev/null +++ b/user/src/com/google/gwt/user/server/rpc/jakarta/package-info.java @@ -0,0 +1,23 @@ +/* + * Copyright 2023 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +/** + * Jakarta-specific package for server-only classes. To use these types, be sure + * to use the {@code gwt-servlet-jakarta.jar}. + * + * @since GWT 2.11 + */ +package com.google.gwt.user.server.rpc.jakarta; diff --git a/user/src/com/google/web/bindery/requestfactory/gwt/client/RequestFactoryLogHandler.java b/user/src/com/google/web/bindery/requestfactory/gwt/client/RequestFactoryLogHandler.java index 32f55253a62..f5a64e7f9cb 100644 --- a/user/src/com/google/web/bindery/requestfactory/gwt/client/RequestFactoryLogHandler.java +++ b/user/src/com/google/web/bindery/requestfactory/gwt/client/RequestFactoryLogHandler.java @@ -27,6 +27,10 @@ /** * A Handler that does remote logging for applications using RequestFactory. + *

To use this in a project with {@code jakarta.servlet}, a copy will need to be made, + * referencing {@link com.google.web.bindery.requestfactory.shared.jakarta.LoggingRequest + * com.google.web.bindery.requestfactory.shared.jakarta.LoggingRequest} instead of the non-jakarta + * LoggingFactory that this was originally written for.

*/ public class RequestFactoryLogHandler extends RemoteLogHandlerBase { diff --git a/user/src/com/google/web/bindery/requestfactory/server/Logging.java b/user/src/com/google/web/bindery/requestfactory/server/Logging.java index c2aea9583cf..eb407916ba2 100644 --- a/user/src/com/google/web/bindery/requestfactory/server/Logging.java +++ b/user/src/com/google/web/bindery/requestfactory/server/Logging.java @@ -25,8 +25,13 @@ /** * Server-side object that handles log messages sent by - * {@link com.google.web.bindery.requestfactory.gwt.client.RequestFactoryLogHandler} - * . + * {@link com.google.web.bindery.requestfactory.gwt.client.RequestFactoryLogHandler}. + *

To use this in {@code jakarta.servlet} projects, be sure to reference + * {@link com.google.web.bindery.requestfactory.shared.jakarta.LoggingRequest + * com.google.web.bindery.requestfactory.shared.jakarta.LoggingRequest} instead + * of the non-jakarta version, and making a copy of {@code RequestFactoryLogHandler} + * that uses it. + *

*/ public class Logging { @@ -36,7 +41,7 @@ public class Logging { * Logs a message. * * @param logRecordJson a json serialized LogRecord, as provided by - * {@link com.google.gwt.logging.client.JsonLogRecordClientUtil#logRecordAsJsonObject(LogRecord)} + * {@link com.google.gwt.logging.client.JsonLogRecordClientUtil#logRecordAsJson(java.util.logging.LogRecord)} * @throws RemoteLoggingException if logging fails */ public static void logMessage(String logRecordJson) throws RemoteLoggingException { diff --git a/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryJarExtractor.java b/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryJarExtractor.java index 1b09125086c..c7628acdc1f 100644 --- a/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryJarExtractor.java +++ b/user/src/com/google/web/bindery/requestfactory/server/RequestFactoryJarExtractor.java @@ -806,6 +806,7 @@ public String toString() { SEEDS.put("apt", aptClasses); SEEDS.put("client", Collections.unmodifiableList(clientClasses)); SEEDS.put("server", Collections.unmodifiableList(serverClasses)); + SEEDS.put("server-jakarta", Collections.unmodifiableList(serverClasses)); Set> all = new LinkedHashSet>(); for (List> value : SEEDS.values()) { @@ -1052,6 +1053,7 @@ private Type processType(String sourceType, Type type) { assert type.getInternalName().charAt(0) != 'L'; if (type.getInternalName().startsWith("java/") || type.getInternalName().startsWith("javax/") || + type.getInternalName().startsWith("jakarta/") || type.getInternalName().startsWith("com/google/gson/")) { return toReturn; } diff --git a/user/src/com/google/web/bindery/requestfactory/server/jakarta/package-info.java b/user/src/com/google/web/bindery/requestfactory/server/jakarta/package-info.java new file mode 100644 index 00000000000..4275d00f8b7 --- /dev/null +++ b/user/src/com/google/web/bindery/requestfactory/server/jakarta/package-info.java @@ -0,0 +1,24 @@ +/* + * Copyright 2023 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +/** + * Jakarta-specific package for server-only classes. To use these types, be sure + * to use the {@code gwt-servlet-jakarta.jar}, or + * {@code requestfactory-server-jakarta.jar}. + * + * @since GWT 2.11 + */ +package com.google.web.bindery.requestfactory.server.jakarta; diff --git a/user/src/com/google/web/bindery/requestfactory/shared/jakarta/package-info.java b/user/src/com/google/web/bindery/requestfactory/shared/jakarta/package-info.java new file mode 100644 index 00000000000..8620dfc7814 --- /dev/null +++ b/user/src/com/google/web/bindery/requestfactory/shared/jakarta/package-info.java @@ -0,0 +1,24 @@ +/* + * Copyright 2023 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +/** + * Jakarta-specific package for server-only classes. To use these types, be sure + * to use the {@code gwt-servlet-jakarta.jar}, or + * {@code requestfactory-server-jakarta.jar}. + * + * @since GWT 2.11 + */ +package com.google.web.bindery.requestfactory.shared.jakarta;