Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new release artifact for jakarta.servlet support #9845

Merged
merged 37 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
aa27cbc
Add Jakarta servlet support, only for gwt-servlet
niloc132 Nov 30, 2022
cf522ad
Suggested dependency cleanup
niloc132 Nov 30, 2022
40fb94c
Merge remote-tracking branch 'github/main' into 9727-jakarta-servlet-…
niloc132 Apr 19, 2023
21156bc
Add Jakarta servlet support, only for gwt-servlet
niloc132 Nov 30, 2022
d41c753
Suggested dependency cleanup
niloc132 Nov 30, 2022
1dcd329
gwtproject/gwt#9727 : generate source jar for servlet jakarta
sparsick Apr 3, 2023
a589c6a
gwtproject/gwt#9727 : generate javadoc jar for servlet jakarta
sparsick Apr 3, 2023
b5b659f
gwtproject/gwt#9727 : move jakarata specific classes and their depend…
sparsick Apr 24, 2023
caf36fe
gwtproject/gwt#9727: adjust javadoc generation to match all jakarta r…
sparsick May 15, 2023
53652ba
gwtproject/gwt#9727: add encoding information
sparsick May 15, 2023
62cb80f
gwtproject/gwt#9727: fix CI build
sparsick Jun 5, 2023
10c9e92
gwtproject/gwt#9727: adjust tools ref for testing
sparsick Jun 7, 2023
0db7bd8
gwtproject/gwt#9727: add package-info to jakarta package
sparsick Jun 19, 2023
ed48c54
gwtproject/gwt#9727: add package-info to jakarta package in javadoc u…
sparsick Jun 19, 2023
da6e94b
Merge branch '9727-jakarta-servlet-support' into 9727-jakarta-servlet…
sparsick Jun 19, 2023
82dc435
gwtproject/gwt#9727 : move jakarata specific classes and their depend…
sparsick Apr 24, 2023
ae6b956
gwtproject/gwt#9727: adjust javadoc generation to match all jakarta r…
sparsick May 15, 2023
a1bc4e0
gwtproject/gwt#9727: adjust tools ref for testing
sparsick Jun 7, 2023
27bf438
Reduce files that are moved, rewritten
niloc132 Jun 14, 2023
3d07693
Reuse the same sources generated for gwt-user when making javadoc
niloc132 Jun 14, 2023
48f4481
Split copied sources into "doesn't need changes" and "just for jakarta"
niloc132 Jun 15, 2023
8536d59
Cut another dependency on RPC
niloc132 Jun 15, 2023
a83167e
Generate a copy of the RPC AdvancedExample
niloc132 Jun 15, 2023
784ad49
gwtproject/gwt#9727: fix - wrong merging
sparsick Jun 26, 2023
d7f7f4b
Fix GwtServletBase
niloc132 Jul 16, 2023
195c749
Merge remote-tracking branch 'sparsick/9727-jakarta-servlet-support' …
niloc132 Jul 16, 2023
25665e0
Remove no-longer-correct note about javadoc being broken
niloc132 Jul 16, 2023
9835498
Use the same javadoc for all maven jars, and pack modified sources in
niloc132 Jul 17, 2023
7df339b
Draft of requestfactory-server jakarta variant
niloc132 Sep 27, 2023
25c2daf
Added package-info for new generated types, removed rf-log handler
niloc132 Sep 27, 2023
50ce8ff
Merge branch 'main' into 9727-jakarta-servlet-support
niloc132 Sep 27, 2023
5feafe4
Self-review of docs
niloc132 Sep 28, 2023
d0ec92b
Revert CI changes to use tools fork
niloc132 Nov 14, 2023
29dc223
Merge branch 'main' into 9727-jakarta-servlet-support
niloc132 Nov 14, 2023
2925e34
Fix checkstyle warning in javadoc
niloc132 Nov 15, 2023
f0eafec
Merge branch 'main' into 9727-jakarta-servlet-support
niloc132 Dec 6, 2023
50043a4
Fix extra chars in javadoc line
niloc132 Dec 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions distro-source/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<zipfileset file="${gwt.build.lib}/gwt-dev.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-user.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-servlet.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-servlet-jakarta.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-codeserver.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-servlet-deps.jar" prefix="${project.distname}" />
<zipfileset file="${gwt.build.lib}/gwt-api-checker.jar" prefix="${project.distname}" />
Expand Down
21 changes: 20 additions & 1 deletion doc/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<pathelement location="${gwt.root}/user/super" />
<pathelement location="${gwt.root}/dev/core/src" />
<pathelement location="${gwt.root}/dev/core/super" />
<pathelement location="${project.build}/../user/jakarta-src" />
<pathelement location="${project.build}/jakarta-src" />
</path>

<path id="USER_CLASS_PATH">
Expand All @@ -27,6 +29,7 @@
<pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA.jar" />
<pathelement location="${gwt.tools.lib}/javax/validation/validation-api-1.0.0.GA-sources.jar" />
<pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
<pathelement location="${gwt.tools.lib}/jakarta-servlet/jakarta.servlet-api-5.0.0/jakarta.servlet-api-5.0.0.jar" />
</path>

<path id="DOC_PATH">
Expand All @@ -35,11 +38,27 @@
<path refid="USER_SOURCE_PATH" />
</path>

<!-- Make an extra copy of this example just for javadocs, so that it can be modified to use jakarta, and the rewriting of the RPC class can point at it -->
<target name="jakartaJavadocSources">
<copy file="${gwt.root}/user/javadoc/com/google/gwt/examples/rpc/server/AdvancedExample.java" todir="${project.build}/jakarta-src/com/google/gwt/examples/rpc/server/jakarta/" encoding="${javac.encoding}">
<filterchain>
<tokenfilter>
<replacestring from="package com.google.gwt.examples.rpc.server" to="package com.google.gwt.examples.rpc.server.jakarta"/>
<replacestring from="com.google.gwt.user.server.rpc.RPC" to="com.google.gwt.user.server.rpc.jakarta.RPC"/>
<replacestring from="javax.servlet" to="jakarta.servlet"/>
</tokenfilter>
</filterchain>
</copy>
</target>

<!-- Rebuild the javadoc if a source file is newer than the index-->
<target name="javadoc">
<target name="javadoc" depends="jakartaJavadocSources">
<outofdate>
<sourcefiles>
<fileset file="./src/gwt-user.html" />
<fileset dir="${project.build}/../user/jakarta-src">
<include name="**/*.java" />
</fileset>
<fileset dir="${gwt.root}/user/src">
<include name="**/*.java" />
</fileset>
Expand Down
9 changes: 5 additions & 4 deletions maven/lib-gwt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand All @@ -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 \
Expand Down
29 changes: 29 additions & 0 deletions maven/poms/gwt/gwt-servlet-jakarta/pom-template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.gwtproject</groupId>
<artifactId>gwt</artifactId>
<version>${gwtVersion}</version>
</parent>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-servlet-jakarta</artifactId>
<packaging>jar</packaging>
<version>${gwtVersion}</version>
<dependencies>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<!-- needed by RequestFactory -->
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<!-- Used for source-mapping in stacktrace deobfuscation for logging -->
<optional>true</optional>
</dependency>
</dependencies>
</project>
5 changes: 5 additions & 0 deletions maven/poms/gwt/pom-template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
<artifactId>gwt-servlet</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-servlet-jakarta</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.gwtproject.web.bindery</groupId>
<artifactId>requestfactory</artifactId>
Expand Down
27 changes: 27 additions & 0 deletions maven/poms/requestfactory/server-jakarta/pom-template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.gwtproject.web.bindery</groupId>
<artifactId>requestfactory</artifactId>
<version>${gwtVersion}</version>
</parent>
<groupId>org.gwtproject.web.bindery</groupId>
<artifactId>requestfactory-server-jakarta</artifactId>
<packaging>jar</packaging>
<version>${gwtVersion}</version>
<dependencies>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<!-- Used for source-mapping in stacktrace deobfuscation for logging -->
<optional>true</optional>
</dependency>
</dependencies>
</project>
27 changes: 23 additions & 4 deletions requestfactory/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,24 @@
<!-- Build a jar file containing a subset of requestfactory -->
<macrodef name="requestfactory-jar">
<!--
"target" should be one of {client,server,all}[(+|-)src] or test[-src].
"target" should be one of {client,server,all,apt}[(+|-)src] or test[-src].
-src includes .java files only, +src includes .java and .class files
-->
<attribute name="target" default="client"/>
<!--
"main" defaults to the javax.servlet extractor type, but should be set to
the jakarta variant to correctly package jakarta server .class and .java
files.
-->
<attribute name="main" default="com.google.web.bindery.requestfactory.server.RequestFactoryJarExtractor" />
<sequential>
<java failonerror="true" fork="true"
classname="com.google.web.bindery.requestfactory.server.RequestFactoryJarExtractor">
<java failonerror="true" fork="true" classname="@{main}">
<classpath>
<fileset dir="${gwt.build.lib}" includes="gwt-user.jar,gwt-dev.jar" />
<pathelement location="${gwt.tools.lib}/jakarta-servlet/jakarta.servlet-api-5.0.0/jakarta.servlet-api-5.0.0.jar" />
<pathelement location="${gwt.tools.lib}/junit/junit-4.8.2.jar" />
<pathelement path="${gwt.build.out}/user/bin" />
<pathelement path="${gwt.build.out}/user/bin-jakarta" />
<pathelement path="${gwt.build.out}/dev/bin-test" />
<pathelement path="${gwt.build.out}/user/bin-test" />
</classpath>
Expand Down Expand Up @@ -81,6 +88,18 @@
<requestfactory-jar target="server+src"/>
</target>

<target name="requestfactory-server-jakarta" description="Build RequestFactory server jar for jakarta.servlet">
<requestfactory-jar target="server-jakarta" main="com.google.web.bindery.requestfactory.server.jakarta.RequestFactoryJarExtractor"/>
</target>

<target name="requestfactory-server-jakarta-src" description="Build RequestFactory server source jar for jakarta.servlet">
<requestfactory-jar target="server-jakarta-src" main="com.google.web.bindery.requestfactory.server.jakarta.RequestFactoryJarExtractor"/>
</target>

<target name="requestfactory-server-jakarta+src" description="Build RequestFactory server source/class jar for jakarta.servlet">
<requestfactory-jar target="server-jakarta+src" main="com.google.web.bindery.requestfactory.server.jakarta.RequestFactoryJarExtractor"/>
</target>

<!-- This target requires classes from ../build/{dev,user}/bin-test -->
<target name="requestfactory-test"
unless="test.requestfactory.disable"
Expand All @@ -93,7 +112,7 @@
<target name="clientjars" depends="requestfactory-apt,requestfactory-apt-src,requestfactory-client,requestfactory-client-src,requestfactory-client+src" description="Build requestfactory client jars" />

<!-- Build all server jars -->
<target name="serverjars" depends="requestfactory-server,requestfactory-server-src,requestfactory-server+src" description="Build requestfactory server jars" />
<target name="serverjars" depends="requestfactory-server,requestfactory-server-src,requestfactory-server+src,requestfactory-server-jakarta,requestfactory-server-jakarta-src,requestfactory-server-jakarta+src" description="Build requestfactory server jars" />

<!-- Default target, build client and server jars.
Assumes the 'user' target has been built in the trunk directory
Expand Down
35 changes: 33 additions & 2 deletions servlet/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<property.ensure name="gwt.user.build" location="${gwt.build.out}/user" />
<property.ensure name="gwt.dev.bin" location="${gwt.dev.build}/bin" />
<property.ensure name="gwt.user.bin" location="${gwt.user.build}/bin" />

<property.ensure name="gwt.user-jakarta.bin" location="${gwt.user.build}/bin-jakarta" />
<property name="project.lib.deps"
location="${gwt.build.lib}/gwt-${ant.project.name}-deps.jar" />

<target name="build" description="Packages this project into a jar"
depends="-servlet, -deps" />
depends="-servlet, -servlet-jakarta, -deps" />

<target name="clean" description="Cleans this project's intermediate and output files">
<delete file="${project.lib}" />
Expand Down Expand Up @@ -52,6 +52,37 @@
<!-- additional dependencies (used by scripts). -->
</gwt.jar>
</target>
<target name="-servlet-jakarta" description="Packages this project into a jar for use with modern jakarta apis">
<mkdir dir="${gwt.build.lib}" />
<gwt.jar destfile="${gwt.build.lib}/gwt-servlet-jakarta.jar">
<!-- Rebased dependencies go in gwt-servlet too -->
<zipfileset src="${gwt.tools.lib}/guava/guava-19.0/guava-19.0-rebased.jar" />
<zipfileset src="${gwt.tools.lib}/jscomp/20160315/sourcemap-rebased.jar" />
<zipfileset src="${gwt.tools.lib}/json/android-sdk-19.1/json-android-rebased.jar" />
<zipfileset src="${gwt.tools.lib}/streamhtmlparser/streamhtmlparser-jsilver-r10/streamhtmlparser-jsilver-r10-1.5-rebased.jar" />
<zipfileset src="${gwt.tools.lib}/protobuf/protobuf-2.5.0/protobuf-java-rebased-2.5.0.jar" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if #9785 lands, this will need the same change.

<fileset dir="${gwt.dev.bin}">
<include name="com/google/gwt/dev/asm/**" />
<include name="com/google/gwt/dev/util/Name*.class" />
<include name="com/google/gwt/dev/util/StringKey.class" />
<include name="com/google/gwt/util/tools/shared/**" />
<include name="com/google/gwt/core/shared/**" />
</fileset>
<fileset dir="${gwt.user-jakarta.bin}">
<exclude name="**/rebind/**" />
<exclude name="**/tools/**" />
<exclude name="**/super/**" />
<exclude name="com/google/gwt/json/**" />
<exclude name="com/google/gwt/junit/*" />
<exclude name="com/google/gwt/junit/client/GWTTestCase.*" />
<exclude name="com/google/gwt/junit/remote/**" />
<exclude name="com/google/gwt/junit/server/**" />
<exclude name="com/google/gwt/benchmarks/*" />
<exclude name="**/*.gwtar" />
</fileset>
<!-- additional dependencies (used by scripts). -->
</gwt.jar>
</target>

<target name="-deps" description="Packages this project's dependencies into a jar">
<mkdir dir="${gwt.build.lib}" />
Expand Down
Loading
Loading