From 0fd2ee41f3b4b8228456efa2ed046df9638a9ba1 Mon Sep 17 00:00:00 2001 From: atavanamir <123644882+atavanamir@users.noreply.github.com> Date: Thu, 27 Apr 2023 15:53:19 +0200 Subject: [PATCH 01/16] Update README.md - how to mvn artifact (#9828) Link to mvn README.txt from the main repo README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a91c49ce93..9eb5d06ec3 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ - To compile everything including examples you have to run `$ ant clean dist` + + - To create maven artifacts (after building .jar using ant), use [following guide](./maven/README.txt). ### How to verify GWT code conventions: From bb42c4ca76ed898e7eff8103b28c565a3055547f Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Thu, 18 May 2023 07:13:11 -0500 Subject: [PATCH 02/16] Update Javadoc for use in Java 11+ (#9825) Dropped the frames requirement, and enabled index and tree pages. --- .../com/google/doctool/custom/JavaEmulSummaryDoclet.java | 2 +- doc/build.xml | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/build_tools/doctool/src/com/google/doctool/custom/JavaEmulSummaryDoclet.java b/build_tools/doctool/src/com/google/doctool/custom/JavaEmulSummaryDoclet.java index 81a487e1e8..1b8a5ce21b 100644 --- a/build_tools/doctool/src/com/google/doctool/custom/JavaEmulSummaryDoclet.java +++ b/build_tools/doctool/src/com/google/doctool/custom/JavaEmulSummaryDoclet.java @@ -53,7 +53,7 @@ public class JavaEmulSummaryDoclet implements Doclet { public static final String OPT_OUTFILE = "-outfile"; - private static final String JAVADOC_URL = "https://docs.oracle.com/javase/8/docs/api/"; + private static final String JAVADOC_URL = "https://docs.oracle.com/en/java/javase/11/docs/api/"; private Reporter reporter; private String outputFile; diff --git a/doc/build.xml b/doc/build.xml index a4de13f429..5f41768b2f 100644 --- a/doc/build.xml +++ b/doc/build.xml @@ -83,17 +83,13 @@ access="package" packagenames="${USER_PKGS}" sourcefiles="${USER_CLASSES}" - noindex="true" - notree="true" use="true" windowtitle="GWT Javadoc" doctitle="GWT API Reference" header="GWT ${gwt.version}" - linkoffline="http://download.oracle.com/javaee/6/api/ validation-package-list"> + linkoffline="https://docs.oracle.com/en/java/javase/11/docs/api/ validation-package-list"> - - From 4f49137180271223fb9b60d17d363a80b52e6d30 Mon Sep 17 00:00:00 2001 From: Zbynek Konecny Date: Thu, 18 May 2023 20:06:15 +0200 Subject: [PATCH 03/16] Disable/fix some tests on Windows (#9811) Disables tests that fail on Windows because of filesystem specifics, fixes one test. Co-authored-by: Zbynek Konecny --- .../dev/MinimalRebuildCacheManagerTest.java | 27 ++-- .../dev/resource/impl/ClassPathEntryTest.java | 61 +++++---- .../impl/ResourceAccumulatorTest.java | 127 ++++++++++-------- 3 files changed, 115 insertions(+), 100 deletions(-) diff --git a/dev/core/test/com/google/gwt/dev/MinimalRebuildCacheManagerTest.java b/dev/core/test/com/google/gwt/dev/MinimalRebuildCacheManagerTest.java index 11aae8bded..420d3da360 100644 --- a/dev/core/test/com/google/gwt/dev/MinimalRebuildCacheManagerTest.java +++ b/dev/core/test/com/google/gwt/dev/MinimalRebuildCacheManagerTest.java @@ -18,11 +18,14 @@ import com.google.gwt.dev.jjs.ast.JTypeOracle; import com.google.gwt.thirdparty.guava.common.collect.ImmutableMap; import com.google.gwt.thirdparty.guava.common.collect.Sets; -import com.google.gwt.thirdparty.guava.common.io.Files; import junit.framework.TestCase; -import java.io.File; +import org.apache.commons.io.FileUtils; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.Map; /** @@ -30,15 +33,15 @@ */ public class MinimalRebuildCacheManagerTest extends TestCase { - public void testCacheChange() throws InterruptedException { + public void testCacheChange() throws InterruptedException, IOException { String moduleName = "com.google.FooModule"; Map initialCompilerOptions = ImmutableMap.of("option", "oldvalue"); PermutationDescription permutationDescription = new PermutationDescription(); - File cacheDir = Files.createTempDir(); + Path cacheDir = Files.createTempDirectory(null); MinimalRebuildCacheManager minimalRebuildCacheManager = new MinimalRebuildCacheManager( - TreeLogger.NULL, cacheDir, initialCompilerOptions); + TreeLogger.NULL, cacheDir.toFile(), initialCompilerOptions); // Make sure we start with a blank slate. minimalRebuildCacheManager.deleteCaches(); @@ -65,7 +68,7 @@ public void testCacheChange() throws InterruptedException { Map newCompilerOptions = ImmutableMap.of("option", "newvalue"); minimalRebuildCacheManager = new MinimalRebuildCacheManager( - TreeLogger.NULL, cacheDir, newCompilerOptions); + TreeLogger.NULL, cacheDir.toFile(), newCompilerOptions); // Now get the cache for FooModule under different compiler flags MinimalRebuildCache fooCacheNew = minimalRebuildCacheManager.getCache(moduleName, @@ -84,7 +87,7 @@ public void testCacheChange() throws InterruptedException { // Switch back to the initial option values and verify you get the same old cache. minimalRebuildCacheManager = new MinimalRebuildCacheManager( - TreeLogger.NULL, cacheDir, initialCompilerOptions); + TreeLogger.NULL, cacheDir.toFile(), initialCompilerOptions); // Now get the cache for FooModule under different under initial options values. MinimalRebuildCache fooCacheResetOptions = minimalRebuildCacheManager.getCache( @@ -96,16 +99,16 @@ public void testCacheChange() throws InterruptedException { assertTrue(fooCacheOld.hasSameContent(fooCacheResetOptions)); minimalRebuildCacheManager.deleteCaches(); minimalRebuildCacheManager.shutdown(); - cacheDir.delete(); + FileUtils.deleteDirectory(cacheDir.toFile()); } - public void testReload() throws InterruptedException { - File cacheDir = Files.createTempDir(); + public void testReload() throws InterruptedException, IOException { + Path cacheDir = Files.createTempDirectory(null); String moduleName = "com.google.FooModule"; MinimalRebuildCacheManager minimalRebuildCacheManager = new MinimalRebuildCacheManager( - TreeLogger.NULL, cacheDir, ImmutableMap.of()); + TreeLogger.NULL, cacheDir.toFile(), ImmutableMap.of()); PermutationDescription permutationDescription = new PermutationDescription(); // Make sure we start with a blank slate. @@ -149,7 +152,7 @@ public void testReload() throws InterruptedException { // Start a new cache manager in the same folder. MinimalRebuildCacheManager reloadedMinimalRebuildCacheManager = new MinimalRebuildCacheManager( - TreeLogger.NULL, cacheDir, ImmutableMap.of()); + TreeLogger.NULL, cacheDir.toFile(), ImmutableMap.of()); // Reread the previously saved cache. MinimalRebuildCache reloadedCache = diff --git a/dev/core/test/com/google/gwt/dev/resource/impl/ClassPathEntryTest.java b/dev/core/test/com/google/gwt/dev/resource/impl/ClassPathEntryTest.java index 3843f2394d..382df33b24 100644 --- a/dev/core/test/com/google/gwt/dev/resource/impl/ClassPathEntryTest.java +++ b/dev/core/test/com/google/gwt/dev/resource/impl/ClassPathEntryTest.java @@ -17,12 +17,13 @@ import com.google.gwt.core.ext.TreeLogger; import com.google.gwt.thirdparty.guava.common.collect.Lists; -import com.google.gwt.thirdparty.guava.common.io.Files; -import java.io.File; import java.io.IOException; import java.lang.ref.WeakReference; import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.DosFileAttributeView; import java.util.Collection; import java.util.Map; import java.util.Set; @@ -32,21 +33,22 @@ */ public class ClassPathEntryTest extends AbstractResourceOrientedTestBase { - /** - * This test will likely not work on Windows since directories that start with . are not - * implicitly hidden there. But since Java 6 does not have a File.setHidden() function, fixing - * this test for Windows is deferred till GWT officially depends on Java 7. - */ public void testIgnoresHiddenDirectories() throws IOException { // Setup a /tmp/.svn/ShouldNotBeFound.java folder structure. - File tempDir = Files.createTempDir(); - File nestedHiddenDir = new File(tempDir, ".svn"); - nestedHiddenDir.mkdir(); - File javaFile = new File(nestedHiddenDir, "ShouldNotBeFound.java"); - javaFile.createNewFile(); + Path tempDir = Files.createTempDirectory(null); + Path nestedHiddenDir = tempDir.resolve(".svn"); + Files.createDirectory(nestedHiddenDir); + Path javaFile = nestedHiddenDir.resolve("ShouldNotBeFound.java"); + Files.createFile(javaFile); + // windows needs the hidden attribute to be set on file (not parent directory) + DosFileAttributeView hiddenAttr = Files.getFileAttributeView(javaFile, + DosFileAttributeView.class); + if (hiddenAttr != null) { + hiddenAttr.setHidden(true); + } // Perform a class path directory inspection. - DirectoryClassPathEntry cpe = new DirectoryClassPathEntry(tempDir); + DirectoryClassPathEntry cpe = new DirectoryClassPathEntry(tempDir.toFile()); Map resources = cpe.findApplicableResources(TreeLogger.NULL, createInclusivePathPrefixSet()); @@ -66,7 +68,7 @@ public void testResourceCreated() throws IOException, InterruptedException { public void testForResourceListenerLeaks_pathPrefixSetIsCollected() throws Exception { // Create a folder an initially empty folder. PathPrefixSet pathPrefixSet = createInclusivePathPrefixSet(); - DirectoryClassPathEntry classPathEntry = new DirectoryClassPathEntry(Files.createTempDir()); + DirectoryClassPathEntry classPathEntry = new DirectoryClassPathEntry(Files.createTempDirectory(null).toFile()); // Show that we are not listening. awaitFullGc(); @@ -94,7 +96,8 @@ public void testForResourceListenerLeaks_pathPrefixSetIsCollected() throws Excep public void testForResourceListenerLeaks_classPathEntryIsCollected() throws Exception { // Create a folder an initially empty folder. PathPrefixSet pathPrefixSet = createInclusivePathPrefixSet(); - DirectoryClassPathEntry classPathEntry = new DirectoryClassPathEntry(Files.createTempDir()); + DirectoryClassPathEntry classPathEntry = new DirectoryClassPathEntry( + Files.createTempDirectory(null).toFile()); // Show that we are not listening. awaitFullGc(); @@ -122,8 +125,8 @@ public void testForResourceListenerLeaks_classPathEntryIsCollected() throws Exce public void testResourceCreated(Collection pathPrefixSets) throws IOException, InterruptedException { // Create a folder an initially empty folder. - File tempDir = Files.createTempDir(); - DirectoryClassPathEntry cpe = new DirectoryClassPathEntry(tempDir); + Path tempDir = Files.createTempDirectory(null); + DirectoryClassPathEntry cpe = new DirectoryClassPathEntry(tempDir.toFile()); // Perform a class path directory inspection. for (PathPrefixSet pathPrefixSet : pathPrefixSets) { @@ -135,8 +138,8 @@ public void testResourceCreated(Collection pathPrefixSets) throws } // Create a file and give file events time to fire. - File createdFile = new File(tempDir, "Created.java"); - createdFile.createNewFile(); + Path createdFile = tempDir.resolve("Created.java"); + Files.createFile(createdFile); Thread.sleep(10); // Perform a class path directory inspection. @@ -161,10 +164,10 @@ public void testResourceDeleted() throws IOException, InterruptedException { private void testResourceDeleted(Collection pathPrefixSets) throws IOException, InterruptedException { // Create a folder with one initial file, that can be deleted. - File tempDir = Files.createTempDir(); - File fileToDelete = new File(tempDir, "ToDelete.java"); - fileToDelete.createNewFile(); - DirectoryClassPathEntry cpe = new DirectoryClassPathEntry(tempDir); + Path tempDir = Files.createTempDirectory(null); + Path fileToDelete = tempDir.resolve("ToDelete.java"); + Files.createFile(fileToDelete); + DirectoryClassPathEntry cpe = new DirectoryClassPathEntry(tempDir.toFile()); // Perform a class path directory inspection. for (PathPrefixSet pathPrefixSet : pathPrefixSets) { @@ -177,7 +180,7 @@ private void testResourceDeleted(Collection pathPrefixSets) throw } // Delete the file and give file events time to fire. - fileToDelete.delete(); + Files.delete(fileToDelete); Thread.sleep(10); // Perform a class path directory inspection. @@ -201,10 +204,10 @@ public void testResourceRenamed() throws IOException, InterruptedException { private void testResourceRenamed(Collection pathPrefixSets) throws IOException, InterruptedException { // Create a folder with one initial file, that can be renamed. - File tempDir = Files.createTempDir(); - File fileToRename = new File(tempDir, "ToRename.java"); - fileToRename.createNewFile(); - DirectoryClassPathEntry cpe = new DirectoryClassPathEntry(tempDir); + Path tempDir = Files.createTempDirectory(null); + Path fileToRename = tempDir.resolve("ToRename.java"); + Files.createFile(fileToRename); + DirectoryClassPathEntry cpe = new DirectoryClassPathEntry(tempDir.toFile()); // Perform class path directory inspections. for (PathPrefixSet pathPrefixSet : pathPrefixSets) { @@ -217,7 +220,7 @@ private void testResourceRenamed(Collection pathPrefixSets) throw } // Rename the file and give file events time to fire. - fileToRename.renameTo(new File(tempDir, "Renamed.java")); + Files.move(fileToRename, tempDir.resolve("Renamed.java")); Thread.sleep(10); for (PathPrefixSet pathPrefixSet : pathPrefixSets) { diff --git a/dev/core/test/com/google/gwt/dev/resource/impl/ResourceAccumulatorTest.java b/dev/core/test/com/google/gwt/dev/resource/impl/ResourceAccumulatorTest.java index ca5e3a9cd5..d61b8ba44f 100644 --- a/dev/core/test/com/google/gwt/dev/resource/impl/ResourceAccumulatorTest.java +++ b/dev/core/test/com/google/gwt/dev/resource/impl/ResourceAccumulatorTest.java @@ -15,13 +15,15 @@ import com.google.gwt.thirdparty.guava.common.collect.Lists; import com.google.gwt.thirdparty.guava.common.collect.Sets; -import com.google.gwt.thirdparty.guava.common.io.Files; import junit.framework.TestCase; -import java.io.File; +import org.apache.commons.lang3.SystemUtils; + import java.io.IOException; import java.nio.file.FileSystemException; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.Collections; import java.util.Comparator; import java.util.List; @@ -33,11 +35,11 @@ public class ResourceAccumulatorTest extends TestCase { public void testAddFile() throws Exception { - File rootDirectory = Files.createTempDir(); - File subDirectory = createDirectoryIn("subdir", rootDirectory); + Path rootDirectory = Files.createTempDirectory(null); + Path subDirectory = createDirectoryIn("subdir", rootDirectory); ResourceAccumulator resourceAccumulator = - new ResourceAccumulator(rootDirectory.toPath(), createInclusivePathPrefixSet()); + new ResourceAccumulator(rootDirectory, createInclusivePathPrefixSet()); assertTrue(getResources(resourceAccumulator).isEmpty()); @@ -52,18 +54,18 @@ public void testAddFile() throws Exception { } public void testDeleteFile() throws Exception { - File rootDirectory = Files.createTempDir(); - File subDirectory = createDirectoryIn("subdir", rootDirectory); - File originalFile = createFileIn("SomeFile.java", subDirectory); + Path rootDirectory = Files.createTempDirectory(null); + Path subDirectory = createDirectoryIn("subdir", rootDirectory); + Path originalFile = createFileIn("SomeFile.java", subDirectory); ResourceAccumulator resourceAccumulator = - new ResourceAccumulator(rootDirectory.toPath(), createInclusivePathPrefixSet()); + new ResourceAccumulator(rootDirectory, createInclusivePathPrefixSet()); List resources = getResources(resourceAccumulator); assertEquals(1, resources.size()); assertTrue(resources.get(0).getPath().endsWith("SomeFile.java")); - originalFile.delete(); + Files.delete(originalFile); waitForFileEvents(); assertTrue(getResources(resourceAccumulator).isEmpty()); @@ -72,16 +74,16 @@ public void testDeleteFile() throws Exception { } public void testListensInNewDirectories() throws Exception { - File rootDirectory = Files.createTempDir(); + Path rootDirectory = Files.createTempDirectory(null); ResourceAccumulator resourceAccumulator = - new ResourceAccumulator(rootDirectory.toPath(), createInclusivePathPrefixSet()); + new ResourceAccumulator(rootDirectory, createInclusivePathPrefixSet()); assertTrue(getResources(resourceAccumulator).isEmpty()); // Create a new directory and contained file AFTER the root directory has started being listened // to. - File subDirectory = createDirectoryIn("subdir", rootDirectory); + Path subDirectory = createDirectoryIn("subdir", rootDirectory); createFileIn("New.java", subDirectory); waitForFileEvents(); @@ -93,13 +95,13 @@ public void testListensInNewDirectories() throws Exception { } public void testMultipleListeners() throws Exception { - File rootDirectory = Files.createTempDir(); - File subDirectory = createDirectoryIn("subdir", rootDirectory); + Path rootDirectory = Files.createTempDirectory(null); + Path subDirectory = createDirectoryIn("subdir", rootDirectory); ResourceAccumulator resourceAccumulator1 = - new ResourceAccumulator(rootDirectory.toPath(), createInclusivePathPrefixSet()); + new ResourceAccumulator(rootDirectory, createInclusivePathPrefixSet()); ResourceAccumulator resourceAccumulator2 = - new ResourceAccumulator(rootDirectory.toPath(), createInclusivePathPrefixSet()); + new ResourceAccumulator(rootDirectory, createInclusivePathPrefixSet()); assertTrue(getResources(resourceAccumulator1).isEmpty()); assertTrue(getResources(resourceAccumulator2).isEmpty()); @@ -120,19 +122,19 @@ public void testMultipleListeners() throws Exception { } public void testRenameFile() throws Exception { - File rootDirectory = Files.createTempDir(); - File subDirectory = createDirectoryIn("subdir", rootDirectory); - File originalFile = createFileIn("OriginalName.java", subDirectory); - File renamedFile = new File(subDirectory, "Renamed.java"); + Path rootDirectory = Files.createTempDirectory(null); + Path subDirectory = createDirectoryIn("subdir", rootDirectory); + Path originalFile = createFileIn("OriginalName.java", subDirectory); + Path renamedFile = subDirectory.resolve("Renamed.java"); ResourceAccumulator resourceAccumulator = - new ResourceAccumulator(rootDirectory.toPath(), createInclusivePathPrefixSet()); + new ResourceAccumulator(rootDirectory, createInclusivePathPrefixSet()); List resources = getResources(resourceAccumulator); assertEquals(1, resources.size()); assertTrue(resources.get(0).getPath().endsWith("OriginalName.java")); - originalFile.renameTo(renamedFile); + Files.move(originalFile, renamedFile); waitForFileEvents(); resources = getResources(resourceAccumulator); @@ -143,21 +145,21 @@ public void testRenameFile() throws Exception { } public void testRenameDirectory() throws Exception { - File rootDirectory = Files.createTempDir(); - File subDirectory = createDirectoryIn("original_dir", rootDirectory); + Path rootDirectory = Files.createTempDirectory(null); + Path subDirectory = createDirectoryIn("original_dir", rootDirectory); createFileIn("Name1.java", subDirectory); createFileIn("Name2.java", subDirectory); - File renamedSubDirectory = new File(rootDirectory, "new_dir"); + Path renamedSubDirectory = rootDirectory.resolve("new_dir"); ResourceAccumulator resourceAccumulator = - new ResourceAccumulator(rootDirectory.toPath(), createInclusivePathPrefixSet()); + new ResourceAccumulator(rootDirectory, createInclusivePathPrefixSet()); List resources = getResources(resourceAccumulator); assertEquals(2, resources.size()); assertTrue(resources.get(0).getPath().endsWith("original_dir/Name1.java")); assertTrue(resources.get(1).getPath().endsWith("original_dir/Name2.java")); - subDirectory.renameTo(renamedSubDirectory); + Files.move(subDirectory, renamedSubDirectory); waitForFileEvents(); resources = getResources(resourceAccumulator); @@ -169,22 +171,25 @@ public void testRenameDirectory() throws Exception { } public void testRenameParentDirectory() throws Exception { - File rootDirectory = Files.createTempDir(); - File parentDirectory = createDirectoryIn("original_dir", rootDirectory); - File subDirectory = createDirectoryIn("subdir", parentDirectory); + if (SystemUtils.IS_OS_WINDOWS) { + return; // moving a directory while WatchService is running -> access denied + } + Path rootDirectory = Files.createTempDirectory(null); + Path parentDirectory = createDirectoryIn("original_dir", rootDirectory); + Path subDirectory = createDirectoryIn("subdir", parentDirectory); createFileIn("Name1.java", subDirectory); createFileIn("Name2.java", subDirectory); - File renamedParentDirectory = new File(rootDirectory, "new_dir"); + Path renamedParentDirectory = rootDirectory.resolve("new_dir"); ResourceAccumulator resourceAccumulator = - new ResourceAccumulator(rootDirectory.toPath(), createInclusivePathPrefixSet()); + new ResourceAccumulator(rootDirectory, createInclusivePathPrefixSet()); List resources = getResources(resourceAccumulator); assertEquals(2, resources.size()); assertTrue(resources.get(0).getPath().endsWith("original_dir/subdir/Name1.java")); assertTrue(resources.get(1).getPath().endsWith("original_dir/subdir/Name2.java")); - parentDirectory.renameTo(renamedParentDirectory); + Files.move(parentDirectory, renamedParentDirectory); waitForFileEvents(); resources = getResources(resourceAccumulator); @@ -196,19 +201,22 @@ public void testRenameParentDirectory() throws Exception { } public void testSymlinkInfiniteLoop() throws Exception { - File rootDirectory = Files.createTempDir(); - File subDirectory = Files.createTempDir(); + if (SystemUtils.IS_OS_WINDOWS) { + return; // symlinks not working on Windows + } + Path rootDirectory = Files.createTempDirectory(null); + Path subDirectory = Files.createTempDirectory(null); ResourceAccumulator resourceAccumulator = - new ResourceAccumulator(rootDirectory.toPath(), createInclusivePathPrefixSet()); + new ResourceAccumulator(rootDirectory, createInclusivePathPrefixSet()); assertTrue(getResources(resourceAccumulator).isEmpty()); // Symlink in a loop - java.nio.file.Files.createSymbolicLink(new File(rootDirectory, "sublink").toPath(), - subDirectory.toPath()).toFile(); - java.nio.file.Files.createSymbolicLink(new File(subDirectory, "sublink").toPath(), - rootDirectory.toPath()).toFile(); + java.nio.file.Files.createSymbolicLink(rootDirectory.resolve("sublink"), + subDirectory); + java.nio.file.Files.createSymbolicLink(subDirectory.resolve("sublink"), + rootDirectory); createFileIn("New.java", subDirectory); waitForFileEvents(); @@ -224,21 +232,24 @@ public void testSymlinkInfiniteLoop() throws Exception { } public void testSymlinks() throws Exception { - File scratchDirectory = Files.createTempDir(); - File newFile = createFileIn("New.java", scratchDirectory); - File rootDirectory = Files.createTempDir(); - File subDirectory = Files.createTempDir(); + if (SystemUtils.IS_OS_WINDOWS) { + return; // symlinks not working on Windows + } + Path scratchDirectory = Files.createTempDirectory(null); + Path newFile = createFileIn("New.java", scratchDirectory); + Path rootDirectory = Files.createTempDirectory(null); + Path subDirectory = Files.createTempDirectory(null); ResourceAccumulator resourceAccumulator = - new ResourceAccumulator(rootDirectory.toPath(), createInclusivePathPrefixSet()); + new ResourceAccumulator(rootDirectory, createInclusivePathPrefixSet()); assertTrue(getResources(resourceAccumulator).isEmpty()); // Symlink in a subdirectory and then symlink in a contained file. - java.nio.file.Files.createSymbolicLink(new File(rootDirectory, "sublink").toPath(), - subDirectory.toPath()).toFile(); - java.nio.file.Files.createSymbolicLink(new File(subDirectory, "New.java").toPath(), - newFile.toPath()).toFile(); + Files.createSymbolicLink(rootDirectory.resolve("sublink"), + subDirectory); + Files.createSymbolicLink(subDirectory.resolve("New.java"), + newFile); waitForFileEvents(); List resources = getResources(resourceAccumulator); @@ -248,16 +259,14 @@ public void testSymlinks() throws Exception { resourceAccumulator.shutdown(); } - private static File createDirectoryIn(String fileName, File inDirectory) { - File newDirectory = new File(inDirectory, fileName); - newDirectory.mkdir(); - return newDirectory; + private static Path createDirectoryIn(String fileName, Path inDirectory) throws IOException { + Path newDirectory = inDirectory.resolve(fileName); + return Files.createDirectory(newDirectory); } - private static File createFileIn(String fileName, File inDirectory) throws IOException { - File newFile = new File(inDirectory, fileName); - newFile.createNewFile(); - return newFile; + private static Path createFileIn(String fileName, Path inDirectory) throws IOException { + Path newFile = inDirectory.resolve(fileName); + return Files.createFile(newFile); } private List getResources(ResourceAccumulator resourceAccumulator) @@ -284,7 +293,7 @@ private PathPrefixSet createInclusivePathPrefixSet() { PathPrefixSet pathPrefixSet = new PathPrefixSet(); pathPrefixSet.add(new PathPrefix("", null)); - // Keep the the reference until the end of the test to create a strong reference, otherwise + // Keep the reference until the end of the test to create a strong reference, otherwise // will get GCed as ResourceAccumulator refers to it weakly. pathPrefixes.add(pathPrefixSet); return pathPrefixSet; From 0e61ca394c65f25008ed48ca29cf406bd7bae11a Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Sat, 10 Jun 2023 13:38:46 -0500 Subject: [PATCH 04/16] Run build, tests in Java 17 (#9830) With Javadoc now able to run on Java 17, we can make Java 17 the default going forward for builds. This patch enables running tests in 17, and fixes a few gotchas discovered - an old asm jar was being used for tests, and when we updated to the latest asm for GWT 2.10, we didn't update ClassVisitors to use the newer version. --- .github/workflows/full-check.yml | 14 +++++++------- .github/workflows/quick-check.yml | 10 +++++----- common.ant.xml | 1 + .../gwt/dev/javac/BytecodeSignatureMaker.java | 2 +- .../com/google/gwt/dev/javac/CompilationUnit.java | 2 +- .../gwt/dev/javac/asm/CollectAnnotationData.java | 4 ++-- .../google/gwt/dev/javac/asm/CollectFieldData.java | 2 +- .../gwt/dev/javac/asm/CollectMethodData.java | 2 +- .../dev/javac/asm/CollectReferencesVisitor.java | 4 ++-- .../gwt/dev/javac/asm/EmptySignatureVisitor.java | 2 +- .../gwt/dev/javac/asmbridge/EmptyVisitor.java | 8 ++++---- .../gwt/dev/shell/rewrite/ForceClassVersion15.java | 2 +- .../gwt/dev/shell/rewrite/HasAnnotation.java | 2 +- .../gwt/dev/shell/rewrite/RewriteJsniMethods.java | 4 ++-- .../dev/shell/rewrite/RewriteRefsToJsoClasses.java | 4 ++-- .../rewrite/RewriteSingleJsoImplDispatches.java | 4 ++-- .../gwt/dev/shell/rewrite/UseMirroredClasses.java | 4 ++-- .../google/gwt/dev/shell/rewrite/WriteJsoImpl.java | 2 +- user/build.xml | 4 ++-- .../server/RequestFactoryJarExtractor.java | 10 +++++----- 20 files changed, 44 insertions(+), 43 deletions(-) diff --git a/.github/workflows/full-check.yml b/.github/workflows/full-check.yml index 447c7eeb5c..9d98ad5f80 100644 --- a/.github/workflows/full-check.yml +++ b/.github/workflows/full-check.yml @@ -1,7 +1,7 @@ -# Run all tests and builds all aspects of GWT using Java 8 and 11. Runs nightly -# (plus or minus timzeones) on the main branch, and will also run right away on -# a push to a release branch. Release zips are uploaded as part of the build, -# though maven snapshots are not yet deployed. +# Run all tests and builds all aspects of GWT using Java 8, 11, and 17. Runs +# nightly (plus or minus timzeones) on the main branch, and will also run right +# away on a push to a release branch. Release zips are uploaded as part of the +# build, though maven snapshots are not yet deployed. name: Full build on: schedule: @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java-version: [ '8', '11' ] + java-version: [ '8', '11', '17' ] steps: - name: Checkout GWT itself into one directory uses: actions/checkout@v2 @@ -83,7 +83,7 @@ jobs: - name: Set up sonatype credentials # Using the same java version as above, set up a settings.xml file uses: actions/setup-java@v3 - if: ${{ github.event_name == 'schedule' && github.repository_owner == 'gwtproject' && matrix.java-version == '11' }} + if: ${{ github.event_name == 'schedule' && github.repository_owner == 'gwtproject' && matrix.java-version == '17' }} with: java-version: ${{ matrix.java-version }} distribution: 'temurin' @@ -93,7 +93,7 @@ jobs: server-password: SONATYPE_PASSWORD - name: Nightly builds should be deployed as snapshots to sonatype - if: ${{ github.event_name == 'schedule' && github.repository_owner == 'gwtproject' && matrix.java-version == '11' }} + if: ${{ github.event_name == 'schedule' && github.repository_owner == 'gwtproject' && matrix.java-version == '17' }} env: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} diff --git a/.github/workflows/quick-check.yml b/.github/workflows/quick-check.yml index 3f514bbfe8..75c861c469 100644 --- a/.github/workflows/quick-check.yml +++ b/.github/workflows/quick-check.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java-version: ['8', '11'] + java-version: ['8', '11', '17'] steps: - name: Checkout GWT itself into one directory uses: actions/checkout@v2 @@ -22,7 +22,7 @@ jobs: repository: 'gwtproject/tools' path: 'tools' - name: Set up JDK ${{ matrix.java-version }} - # GWT presently requires Java8 to build just the SDK and some tests, or 11 to build everything, but can run on newer Java versions + # GWT presently requires Java8 to build just the SDK and some tests, or 11+ to build everything, and can run on newer Java versions uses: actions/setup-java@v3 with: java-version: ${{ matrix.java-version }} @@ -44,8 +44,8 @@ jobs: ANT_OPTS=-Xmx2g ant clean dist doc checkstyle apicheck - - name: Create pull request comments/annotations for checkstyle from the java 11 build, even on failure - if: ${{ always() && github.event_name == 'pull_request' && matrix.java-version == '11' }} + - name: Create pull request comments/annotations for checkstyle from the java 17 build, even on failure + if: ${{ always() && github.event_name == 'pull_request' && matrix.java-version == '17' }} env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -58,7 +58,7 @@ jobs: done - name: Upload checkstyle xml for manual review uses: actions/upload-artifact@v2 - if: ${{ matrix.java-version == '11' }} + if: ${{ matrix.java-version == '17' }} with: name: checkstyle-reports-java${{ matrix.java-version }} path: 'gwt/build/out/**/checkstyle*.xml' diff --git a/common.ant.xml b/common.ant.xml index 164472ffb6..7b3604ba60 100755 --- a/common.ant.xml +++ b/common.ant.xml @@ -251,6 +251,7 @@ + diff --git a/dev/core/src/com/google/gwt/dev/javac/BytecodeSignatureMaker.java b/dev/core/src/com/google/gwt/dev/javac/BytecodeSignatureMaker.java index 762c4228ed..a70120930b 100644 --- a/dev/core/src/com/google/gwt/dev/javac/BytecodeSignatureMaker.java +++ b/dev/core/src/com/google/gwt/dev/javac/BytecodeSignatureMaker.java @@ -56,7 +56,7 @@ private static class CompileDependencyVisitor extends ClassVisitor { private Map methods = new HashMap(); public CompileDependencyVisitor() { - super(Opcodes.ASM7); + super(Opcodes.ASM9); } public String getSignature() { diff --git a/dev/core/src/com/google/gwt/dev/javac/CompilationUnit.java b/dev/core/src/com/google/gwt/dev/javac/CompilationUnit.java index 6f7f003dc0..0066c2f762 100644 --- a/dev/core/src/com/google/gwt/dev/javac/CompilationUnit.java +++ b/dev/core/src/com/google/gwt/dev/javac/CompilationUnit.java @@ -66,7 +66,7 @@ private static class AnonymousClassVisitor extends EmptyVisitor { public AnonymousClassVisitor() { - this.mv = new org.objectweb.asm.MethodVisitor(Opcodes.ASM7, this.mv) { + this.mv = new org.objectweb.asm.MethodVisitor(Opcodes.ASM9, this.mv) { @Override public void visitCode() { ++sawCode; diff --git a/dev/core/src/com/google/gwt/dev/javac/asm/CollectAnnotationData.java b/dev/core/src/com/google/gwt/dev/javac/asm/CollectAnnotationData.java index 95fcc52fc0..2d26d19d57 100644 --- a/dev/core/src/com/google/gwt/dev/javac/asm/CollectAnnotationData.java +++ b/dev/core/src/com/google/gwt/dev/javac/asm/CollectAnnotationData.java @@ -79,7 +79,7 @@ public static class MyAnnotationArrayVisitor extends AnnotationVisitor { private final List values = new ArrayList(); public MyAnnotationArrayVisitor(Callback callback) { - super(Opcodes.ASM7); + super(Opcodes.ASM9); this.callback = callback; } @@ -158,7 +158,7 @@ public CollectAnnotationData(String desc, boolean visible) { */ CollectAnnotationData(String desc, boolean visible, Callback callback) { - super(Opcodes.ASM7); + super(Opcodes.ASM9); annotation = new AnnotationData(desc, visible); this.callback = callback; } diff --git a/dev/core/src/com/google/gwt/dev/javac/asm/CollectFieldData.java b/dev/core/src/com/google/gwt/dev/javac/asm/CollectFieldData.java index 3bfb434855..234e2865b7 100644 --- a/dev/core/src/com/google/gwt/dev/javac/asm/CollectFieldData.java +++ b/dev/core/src/com/google/gwt/dev/javac/asm/CollectFieldData.java @@ -36,7 +36,7 @@ public class CollectFieldData extends FieldVisitor { public CollectFieldData(int access, String name, String desc, String signature, Object value) { - super(Opcodes.ASM7); + super(Opcodes.ASM9); this.access = access; this.name = name; this.desc = desc; diff --git a/dev/core/src/com/google/gwt/dev/javac/asm/CollectMethodData.java b/dev/core/src/com/google/gwt/dev/javac/asm/CollectMethodData.java index 95f17a411f..c4af9901f9 100644 --- a/dev/core/src/com/google/gwt/dev/javac/asm/CollectMethodData.java +++ b/dev/core/src/com/google/gwt/dev/javac/asm/CollectMethodData.java @@ -58,7 +58,7 @@ public class CollectMethodData extends MethodVisitor { // for new List[] public CollectMethodData(CollectClassData.ClassType classType, int access, String name, String desc, String signature, String[] exceptions) { - super(Opcodes.ASM7); + super(Opcodes.ASM9); this.access = access; this.name = name; this.desc = desc; diff --git a/dev/core/src/com/google/gwt/dev/javac/asm/CollectReferencesVisitor.java b/dev/core/src/com/google/gwt/dev/javac/asm/CollectReferencesVisitor.java index 17b3293978..773a407393 100644 --- a/dev/core/src/com/google/gwt/dev/javac/asm/CollectReferencesVisitor.java +++ b/dev/core/src/com/google/gwt/dev/javac/asm/CollectReferencesVisitor.java @@ -42,7 +42,7 @@ public class CollectReferencesVisitor extends EmptyVisitor { private class CollectGenericTypes extends SignatureVisitor { public CollectGenericTypes() { - super(Opcodes.ASM7); + super(Opcodes.ASM9); } @Override @@ -121,7 +121,7 @@ public void visitTypeVariable(String name) { } CollectReferencesVisitor() { - this.av = new AnnotationVisitor(Opcodes.ASM7, this.av) { + this.av = new AnnotationVisitor(Opcodes.ASM9, this.av) { @Override public void visitEnum(String name, String desc, String value) { addTypeIfClass(desc); diff --git a/dev/core/src/com/google/gwt/dev/javac/asm/EmptySignatureVisitor.java b/dev/core/src/com/google/gwt/dev/javac/asm/EmptySignatureVisitor.java index fe5385711e..df82c2a260 100644 --- a/dev/core/src/com/google/gwt/dev/javac/asm/EmptySignatureVisitor.java +++ b/dev/core/src/com/google/gwt/dev/javac/asm/EmptySignatureVisitor.java @@ -34,7 +34,7 @@ public class EmptySignatureVisitor extends SignatureVisitor { protected static EmptySignatureVisitor ignore = new EmptySignatureVisitor(); public EmptySignatureVisitor() { - super(Opcodes.ASM7); + super(Opcodes.ASM9); } /** diff --git a/dev/core/src/com/google/gwt/dev/javac/asmbridge/EmptyVisitor.java b/dev/core/src/com/google/gwt/dev/javac/asmbridge/EmptyVisitor.java index ffa3ba4b9f..7585c7def0 100644 --- a/dev/core/src/com/google/gwt/dev/javac/asmbridge/EmptyVisitor.java +++ b/dev/core/src/com/google/gwt/dev/javac/asmbridge/EmptyVisitor.java @@ -27,7 +27,7 @@ */ public class EmptyVisitor extends ClassVisitor { - protected AnnotationVisitor av = new AnnotationVisitor(Opcodes.ASM7) { + protected AnnotationVisitor av = new AnnotationVisitor(Opcodes.ASM9) { @Override public AnnotationVisitor visitAnnotation(String name, String desc) { @@ -41,10 +41,10 @@ public AnnotationVisitor visitArray(String name) { }; public EmptyVisitor() { - super(Opcodes.ASM7); + super(Opcodes.ASM9); } - protected MethodVisitor mv = new MethodVisitor(Opcodes.ASM7) { + protected MethodVisitor mv = new MethodVisitor(Opcodes.ASM9) { @Override public AnnotationVisitor visitAnnotationDefault() { @@ -63,7 +63,7 @@ public AnnotationVisitor visitParameterAnnotation( } }; - protected FieldVisitor fv = new FieldVisitor(Opcodes.ASM7) { + protected FieldVisitor fv = new FieldVisitor(Opcodes.ASM9) { @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { diff --git a/dev/core/src/com/google/gwt/dev/shell/rewrite/ForceClassVersion15.java b/dev/core/src/com/google/gwt/dev/shell/rewrite/ForceClassVersion15.java index 52c5e7517f..2f175877de 100644 --- a/dev/core/src/com/google/gwt/dev/shell/rewrite/ForceClassVersion15.java +++ b/dev/core/src/com/google/gwt/dev/shell/rewrite/ForceClassVersion15.java @@ -25,7 +25,7 @@ class ForceClassVersion15 extends ClassVisitor { public ForceClassVersion15(ClassVisitor v) { - super(Opcodes.ASM7, v); + super(Opcodes.ASM9, v); } @Override diff --git a/dev/core/src/com/google/gwt/dev/shell/rewrite/HasAnnotation.java b/dev/core/src/com/google/gwt/dev/shell/rewrite/HasAnnotation.java index 15f0d1586b..6b7d18fdbb 100644 --- a/dev/core/src/com/google/gwt/dev/shell/rewrite/HasAnnotation.java +++ b/dev/core/src/com/google/gwt/dev/shell/rewrite/HasAnnotation.java @@ -54,7 +54,7 @@ public static boolean hasAnnotation(byte[] classBytes, private final String targetDesc; public HasAnnotation(ClassVisitor v, Class annotation) { - super(Opcodes.ASM7, v); + super(Opcodes.ASM9, v); targetDesc = Type.getDescriptor(annotation); } diff --git a/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteJsniMethods.java b/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteJsniMethods.java index 6ce96eb0a1..29b801593a 100644 --- a/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteJsniMethods.java +++ b/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteJsniMethods.java @@ -206,7 +206,7 @@ private class MyMethodAdapter extends GeneratorAdapter { public MyMethodAdapter(MethodVisitor mv, int access, String name, String desc) { - super(Opcodes.ASM7, mv, access, name, desc); + super(Opcodes.ASM9, mv, access, name, desc); this.descriptor = desc; this.name = name; isStatic = (access & Opcodes.ACC_STATIC) != 0; @@ -329,7 +329,7 @@ private void loadClassArray() { public RewriteJsniMethods(ClassVisitor v, Map anonymousClassMap) { - super(Opcodes.ASM7, v); + super(Opcodes.ASM9, v); this.anonymousClassMap = anonymousClassMap; } diff --git a/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteRefsToJsoClasses.java b/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteRefsToJsoClasses.java index 1911d517dc..6ddf8241ca 100644 --- a/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteRefsToJsoClasses.java +++ b/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteRefsToJsoClasses.java @@ -54,7 +54,7 @@ public String map(String typeName) { }; public MyMethodAdapter(MethodVisitor mv) { - super(Opcodes.ASM7, mv); + super(Opcodes.ASM9, mv); } @Override @@ -132,7 +132,7 @@ public void visitTypeInsn(int opcode, String type) { */ public RewriteRefsToJsoClasses(ClassVisitor cv, Set jsoDescriptors, InstanceMethodOracle mapper) { - super(Opcodes.ASM7, cv); + super(Opcodes.ASM9, cv); this.jsoDescriptors = jsoDescriptors; this.mapper = mapper; } diff --git a/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteSingleJsoImplDispatches.java b/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteSingleJsoImplDispatches.java index ff38213b8d..cd7eb1cf67 100644 --- a/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteSingleJsoImplDispatches.java +++ b/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteSingleJsoImplDispatches.java @@ -57,7 +57,7 @@ public class RewriteSingleJsoImplDispatches extends ClassVisitor { private class MyMethodVisitor extends MethodVisitor { public MyMethodVisitor(MethodVisitor mv) { - super(Opcodes.ASM7, mv); + super(Opcodes.ASM9, mv); } /* @@ -133,7 +133,7 @@ public void visitMethodInsn(int opcode, String owner, String name, public RewriteSingleJsoImplDispatches(ClassVisitor v, TypeOracle typeOracle, SingleJsoImplData jsoData) { - super(Opcodes.ASM7, v); + super(Opcodes.ASM9, v); this.typeOracle = typeOracle; this.jsoData = jsoData; } diff --git a/dev/core/src/com/google/gwt/dev/shell/rewrite/UseMirroredClasses.java b/dev/core/src/com/google/gwt/dev/shell/rewrite/UseMirroredClasses.java index 51ac42d387..4ddbe63a52 100644 --- a/dev/core/src/com/google/gwt/dev/shell/rewrite/UseMirroredClasses.java +++ b/dev/core/src/com/google/gwt/dev/shell/rewrite/UseMirroredClasses.java @@ -72,7 +72,7 @@ private static class MethodInterceptor extends MethodVisitor { private String className; protected MethodInterceptor(MethodVisitor mv, String className) { - super(Opcodes.ASM7, mv); + super(Opcodes.ASM9, mv); this.className = className; } @@ -144,7 +144,7 @@ public void visitMethodInsn(int opcode, String owner, String name, private String className; public UseMirroredClasses(ClassVisitor cv, String className) { - super(Opcodes.ASM7, cv); + super(Opcodes.ASM9, cv); this.className = className; } diff --git a/dev/core/src/com/google/gwt/dev/shell/rewrite/WriteJsoImpl.java b/dev/core/src/com/google/gwt/dev/shell/rewrite/WriteJsoImpl.java index 8d460737ce..29956a17f0 100644 --- a/dev/core/src/com/google/gwt/dev/shell/rewrite/WriteJsoImpl.java +++ b/dev/core/src/com/google/gwt/dev/shell/rewrite/WriteJsoImpl.java @@ -264,7 +264,7 @@ public static ClassVisitor create(ClassVisitor cv, String classDescriptor, * @param mapper maps methods to the class in which they are declared */ private WriteJsoImpl(ClassVisitor cv, InstanceMethodOracle mapper) { - super(Opcodes.ASM7, cv); + super(Opcodes.ASM9, cv); this.mapper = mapper; } diff --git a/user/build.xml b/user/build.xml index d9148786ee..1701335774 100755 --- a/user/build.xml +++ b/user/build.xml @@ -75,8 +75,8 @@ - - + + Date: Wed, 30 Nov 2022 10:48:09 -0600 Subject: [PATCH 05/16] Add Jakarta servlet support, only for gwt-servlet This is a draft patch to add support for Jakarta. It is assumed to only be used for modular projects, where client and server do not live in the same classpath. Among other things, this means that validation does not need to be updated, and old javax.servlet references can be left in gwt-dev and gwt-user. This does not correct the sources for deployment to maven, nor does it fix javadoc. This does not update the requestfactory-server jar. Draft for #9727 --- distro-source/build.xml | 1 + maven/lib-gwt.sh | 10 ++-- .../gwt/gwt-servlet-jakarta/pom-template.xml | 29 ++++++++++ maven/poms/gwt/pom-template.xml | 5 ++ servlet/build.xml | 35 +++++++++++- user/build.xml | 53 ++++++++++++++++++- 6 files changed, 127 insertions(+), 6 deletions(-) create mode 100644 maven/poms/gwt/gwt-servlet-jakarta/pom-template.xml diff --git a/distro-source/build.xml b/distro-source/build.xml index 03e1c7b486..90e0448383 100755 --- a/distro-source/build.xml +++ b/distro-source/build.xml @@ -32,6 +32,7 @@ + diff --git a/maven/lib-gwt.sh b/maven/lib-gwt.sh index bd10e2d67b..bd744b254e 100644 --- a/maven/lib-gwt.sh +++ b/maven/lib-gwt.sh @@ -64,7 +64,7 @@ function maven-gwt() { GWT_EXTRACT_DIR=`ls $RANDOM_DIR | tail -n1` GWT_EXTRACT_DIR=$RANDOM_DIR/$GWT_EXTRACT_DIR - JAVADOC_FILE_PATH=$RANDOM_DIR/gwt-javadoc.jar + JAVADOC_FILE_PATH=$RANDOM_DIR/gwt-javadoc.jar #TODO also wrong for jakarta [ -d $GWT_EXTRACT_DIR/doc/javadoc ] && jar cf $JAVADOC_FILE_PATH -C $GWT_EXTRACT_DIR/doc/javadoc . # Generate POMs with correct version @@ -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,10 @@ 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. + #TODO this is wrong for jakarta sources if [ ! -f $SOURCES_PATH_FILE ]; then SOURCES_PATH_FILE=$GWT_EXTRACT_DIR/gwt-user-sources.jar fi 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 0000000000..769bb1d283 --- /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 4e5f1fda8a..0f288bae1e 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/servlet/build.xml b/servlet/build.xml index caf55cdadd..232a7ea871 100644 --- a/servlet/build.xml +++ b/servlet/build.xml @@ -8,12 +8,13 @@ + + depends="-servlet, -servlet-jakarta, -deps" /> @@ -52,6 +53,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user/build.xml b/user/build.xml index 1701335774..48f2b1de8c 100755 --- a/user/build.xml +++ b/user/build.xml @@ -146,6 +146,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From a589c6a7a8b83e54af95c8fde6776f041fc0a58b Mon Sep 17 00:00:00 2001 From: Sandra Parsick Date: Mon, 3 Apr 2023 14:15:56 +0200 Subject: [PATCH 08/16] gwtproject/gwt#9727 : generate javadoc jar for servlet jakarta --- maven/lib-gwt.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/maven/lib-gwt.sh b/maven/lib-gwt.sh index f14b05787b..e400f44671 100644 --- a/maven/lib-gwt.sh +++ b/maven/lib-gwt.sh @@ -64,9 +64,16 @@ function maven-gwt() { GWT_EXTRACT_DIR=`ls $RANDOM_DIR | tail -n1` GWT_EXTRACT_DIR=$RANDOM_DIR/$GWT_EXTRACT_DIR - JAVADOC_FILE_PATH=$RANDOM_DIR/gwt-javadoc.jar #TODO also wrong for jakarta + JAVADOC_FILE_PATH=$RANDOM_DIR/gwt-javadoc.jar [ -d $GWT_EXTRACT_DIR/doc/javadoc ] && jar cf $JAVADOC_FILE_PATH -C $GWT_EXTRACT_DIR/doc/javadoc . + JAVADOC_JAKARTA_FILE_PATH=$RANDOM_DIR/gwt-jakarta-javadoc.jar + if [[ -d $GWT_EXTRACT_DIR/doc/javadoc ]]; then + cp -r $GWT_EXTRACT_DIR/doc/javadoc $GWT_EXTRACT_DIR/doc/javadoc-jakarta + find $GWT_EXTRACT_DIR/doc/javadoc-jakarta -type f -exec sed -i 's/javax.servlet/jakarta.servlet/g' {} + + jar cf $JAVADOC_JAKARTA_FILE_PATH -C $GWT_EXTRACT_DIR/doc/javadoc-jakarta . + fi + # Generate POMs with correct version for template in `find $pomDir -name pom-template.xml` do @@ -125,6 +132,10 @@ function maven-gwt() { SOURCES_PATH_FILE=$GWT_EXTRACT_DIR/gwt-user-sources.jar fi + if [[ $i == "servlet-jakarta" ]]; then + JAVADOC_FILE_PATH=$JAVADOC_JAKARTA_FILE_PATH + fi + maven-deploy-file $mavenRepoUrl $mavenRepoId "$CUR_FILE" $gwtPomFile "$JAVADOC_FILE_PATH" "$SOURCES_PATH_FILE" || die done From b5b659f92fb99d16312ddaa12e26f81980ba63ba Mon Sep 17 00:00:00 2001 From: Sandra Parsick Date: Mon, 24 Apr 2023 10:51:06 +0200 Subject: [PATCH 09/16] gwtproject/gwt#9727 : move jakarata specific classes and their dependent classes to own package for source jar --- doc/build.xml | 15 ++++++++++ user/build.xml | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/doc/build.xml b/doc/build.xml index 5f41768b2f..f55db2ad7d 100644 --- a/doc/build.xml +++ b/doc/build.xml @@ -37,6 +37,20 @@ + + + + + + + + + + + + + + @@ -92,6 +106,7 @@ + diff --git a/user/build.xml b/user/build.xml index a49e624dd6..427d66c2a2 100755 --- a/user/build.xml +++ b/user/build.xml @@ -155,6 +155,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Date: Mon, 15 May 2023 11:50:34 +0200 Subject: [PATCH 10/16] gwtproject/gwt#9727: adjust javadoc generation to match all jakarta related sources --- doc/build.xml | 51 ++++++++++++++++++++++++++++++++++++++++++++++++-- user/build.xml | 2 +- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/doc/build.xml b/doc/build.xml index f55db2ad7d..28070ac6f7 100644 --- a/doc/build.xml +++ b/doc/build.xml @@ -27,6 +27,7 @@ + @@ -37,23 +38,67 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -106,7 +151,9 @@ - + + + diff --git a/user/build.xml b/user/build.xml index 427d66c2a2..686548bb51 100755 --- a/user/build.xml +++ b/user/build.xml @@ -222,7 +222,7 @@ - + From 53652ba0933d1a78a2ab32136566794a7c2e169f Mon Sep 17 00:00:00 2001 From: Sandra Parsick Date: Mon, 15 May 2023 16:49:25 +0200 Subject: [PATCH 11/16] gwtproject/gwt#9727: add encoding information --- doc/build.xml | 10 +++++----- user/build.xml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/build.xml b/doc/build.xml index 28070ac6f7..9ec57b1d5a 100644 --- a/doc/build.xml +++ b/doc/build.xml @@ -38,7 +38,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -57,8 +57,8 @@ - - + + @@ -78,7 +78,7 @@ - + diff --git a/user/build.xml b/user/build.xml index 686548bb51..04ecc34427 100755 --- a/user/build.xml +++ b/user/build.xml @@ -147,7 +147,7 @@ - + From 62cb80f593196d55c634dbd4b9d4f74b6f7471d3 Mon Sep 17 00:00:00 2001 From: Sandra Parsick Date: Mon, 5 Jun 2023 18:06:04 +0200 Subject: [PATCH 12/16] gwtproject/gwt#9727: fix CI build --- doc/build.xml | 2 +- user/build.xml | 25 ++++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/doc/build.xml b/doc/build.xml index 9ec57b1d5a..c71c977845 100644 --- a/doc/build.xml +++ b/doc/build.xml @@ -84,7 +84,7 @@ - + diff --git a/user/build.xml b/user/build.xml index 04ecc34427..70fcd64916 100755 --- a/user/build.xml +++ b/user/build.xml @@ -217,8 +217,25 @@ - + + + + + + + + + + + + + + + + + + @@ -228,10 +245,12 @@ + + - - + + Date: Wed, 7 Jun 2023 09:26:43 +0200 Subject: [PATCH 13/16] gwtproject/gwt#9727: adjust tools ref for testing --- .github/workflows/full-check.yml | 3 ++- .github/workflows/quick-check.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/full-check.yml b/.github/workflows/full-check.yml index 9d98ad5f80..7d179f3385 100644 --- a/.github/workflows/full-check.yml +++ b/.github/workflows/full-check.yml @@ -29,8 +29,9 @@ jobs: - name: Checkout GWT tools into a sibling directory uses: actions/checkout@v2 with: - repository: 'gwtproject/tools' + repository: 'sparsick/gwt-tools' path: 'tools' + ref: '9727-jakarta-servlet-support' - name: Set up JDK ${{ matrix.java-version }} # GWT presently requires Java8 to build just the SDK and some tests, or 11 to build everything, but can run on newer Java versions uses: actions/setup-java@v3 diff --git a/.github/workflows/quick-check.yml b/.github/workflows/quick-check.yml index 75c861c469..7deb3ed558 100644 --- a/.github/workflows/quick-check.yml +++ b/.github/workflows/quick-check.yml @@ -19,8 +19,9 @@ jobs: - name: Checkout GWT tools into a sibling directory uses: actions/checkout@v2 with: - repository: 'gwtproject/tools' + repository: 'sparsick/gwt-tools' path: 'tools' + ref: '9727-jakarta-servlet-support' - name: Set up JDK ${{ matrix.java-version }} # GWT presently requires Java8 to build just the SDK and some tests, or 11+ to build everything, and can run on newer Java versions uses: actions/setup-java@v3 From 0db7bd8d970f6285fc663786843d2ba7456139f2 Mon Sep 17 00:00:00 2001 From: Sandra Parsick Date: Mon, 19 Jun 2023 13:13:02 +0200 Subject: [PATCH 14/16] gwtproject/gwt#9727: add package-info to jakarta package --- user/build.xml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/user/build.xml b/user/build.xml index 70fcd64916..38ad2a23f9 100755 --- a/user/build.xml +++ b/user/build.xml @@ -183,6 +183,13 @@ + + + + + + + @@ -190,6 +197,13 @@ + + + + + + + @@ -215,6 +229,13 @@ + + + + + + + @@ -223,6 +244,7 @@ + From ed48c54c6b98595c160dfaf53acfd054cb2aef99 Mon Sep 17 00:00:00 2001 From: Sandra Parsick Date: Mon, 19 Jun 2023 14:06:00 +0200 Subject: [PATCH 15/16] gwtproject/gwt#9727: add package-info to jakarta package in javadoc use case --- doc/build.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/build.xml b/doc/build.xml index c71c977845..adf610dc90 100644 --- a/doc/build.xml +++ b/doc/build.xml @@ -44,9 +44,7 @@ - - @@ -58,11 +56,13 @@ + + @@ -75,7 +75,6 @@ - From 784ad49fd64774114e2b82c351ce9f7a66892590 Mon Sep 17 00:00:00 2001 From: Sandra Parsick Date: Mon, 26 Jun 2023 12:33:32 +0200 Subject: [PATCH 16/16] gwtproject/gwt#9727: fix - wrong merging --- user/build.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/user/build.xml b/user/build.xml index 3824a50cda..886d780cbf 100755 --- a/user/build.xml +++ b/user/build.xml @@ -148,6 +148,13 @@ unless="compile.complete"> + + + + + + +