Skip to content

Commit

Permalink
Replace GWTQuery with Elemental2 (#13)
Browse files Browse the repository at this point in the history
As discussed in Gitter, GWTQuery breaks navigation when certain Chrome
extensions are active. This should also reduce the code size a bit.

Closes #11 -- all the changes are included here to make Elemental work.

Most functionality stays the same, page title for hompage changed,
which makes this conflicted with #1.

Fixes #5
Fixes #4
  • Loading branch information
zbynek authored Oct 27, 2024
1 parent 6929744 commit 2707076
Show file tree
Hide file tree
Showing 8 changed files with 431 additions and 439 deletions.
39 changes: 13 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

- **gwt-site-webapp**.
# gwt-site-webapp
This project includes the server an client code of the GWT site
It does not include the site content which is in the gwt-site project
nor the utilities for uploading the documentation to GAE Servers which
are in the gwt-site-uploader project.

- **Requirements**
## Requirements
[Apache Maven](http://maven.apache.org) 3.0 or greater, and JDK 7+ in order to run.

- Before building the project you may need **gwt-site** packaged file.
Expand All @@ -17,36 +16,24 @@
- To **build** and check the app, run

$ cd [...]/gwt-site-webapp
$ mvn package
$ mvn verify -P full-site

Now you can point your browser to the `target/www` folder or you can serve
Now you can point your browser to the `target/www` folder, or you can serve
its content with any web-server (i.e [serve](https://www.npmjs.com/package/serve)).
Notice that the second way is needed if you want to test site navigation via Ajax.

- Building will run the **tests**, but to explicitly run them you can use the test target

$ mvn test

- **Develop and Deploy**. This app is thought to be run in GAE servers, so it comes with all dependencies for it.

* To start the app using the [App Engine Maven Plugin](http://code.google.com/p/appengine-maven-plugin/) included in this project, just run the command:

$ mvn appengine:devserver

* You might upload the gwt stuff to the local developer server, just open another terminal,
go to the `gwt-site-uploader` folder project and run:

$ cd [...]/gwt-site-uploader
$ sh upload.sh localhost

* If you wanted to deploy to production, you might change the `<application>` section in the
`src/main/webapp/WEB-INF/appengine-web.xml` to point to the appropriate GAE instance and
then deploy to Google servers running:

$ mvn appengine:update -DgaeAccount=your_google_account

* For further information about GAE, consult the [Java App Engine](https://developers.google.com/appengine/docs/java/overview) documentation.
# Develop and Deploy

To see all the available goals for the App Engine plugin, run
Note that as configured, sourcemaps will not work locally - they must be deployed to gwtproject.org
because the generated JS will attempt to load them from an absolute URL.

$ mvn help:describe -Dplugin=appengine
* The `target/gwt-site-webapp-<version>.war` file (and the `target/gwt-site-webapp-<version>`
directory) contains the generated JavaScript and sourcemaps, and can be deployed along with the
generated site content.
* The `target/www` directory contains the generated JavaScript, sourcemaps (and Java sources),
and the generated HTML from gwt-site itself, and is suitable for deployment directly to a
server.
204 changes: 104 additions & 100 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@
<groupId>com.google.gwt.site.webapp</groupId>
<artifactId>gwt-site-webapp</artifactId>
<version>2.0-SNAPSHOT</version>
<packaging>war</packaging>
<packaging>gwt-app</packaging>

<properties>
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<gwt.version>2.7.0</gwt.version>
<gwtquery.version>1.4.2</gwtquery.version>
<gwt.version>2.11.0</gwt.version>

<junit.version>4.11</junit.version>
<junit.version>4.13.2</junit.version>

<!-- plugin -->
<surefire-plugin.version>2.17</surefire-plugin.version>
<compiler-plugin.version>3.1</compiler-plugin.version>
<war-plugin.version>2.4</war-plugin.version>
</properties>

<dependencies>
Expand All @@ -34,30 +32,25 @@

<!-- UI dependencies -->
<dependency>
<groupId>com.google.gwt</groupId>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.googlecode.gwtquery</groupId>
<artifactId>gwtquery</artifactId>
<version>${gwtquery.version}</version>
<scope>provided</scope>
<groupId>com.google.elemental2</groupId>
<artifactId>elemental2-dom</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt.site</groupId>
<artifactId>gwt-site</artifactId>
<version>${project.version}</version>
<type>zip</type>
<classifier>generated-site</classifier>
</dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-codeserver</artifactId>
<version>${gwt.version}</version>
</dependency>
</dependencies>

<build>
Expand All @@ -68,17 +61,6 @@
</testResources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<excludes>
<exclude>**/*GwtTest.java</exclude>
</excludes>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -90,90 +72,51 @@
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${war-plugin.version}</version>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0.1</version>
<extensions>true</extensions>
<configuration>
<!-- <archiveClasses>true</archiveClasses> -->
<webResources>
<!-- copy GWT source code to website for debugging -->
<resource>
<directory>${basedir}/target/extra/gwtproject/src</directory>
<targetPath>src</targetPath>
</resource>
<!-- copy sourcemaps to website for debugging -->
<resource>
<directory>${basedir}/target/extra/gwtproject/symbolMaps</directory>
<includes>
<include>*.json</include>
</includes>
<targetPath>src</targetPath>
</resource>
</webResources>
<moduleName>com.google.gwt.site.webapp.GWTProject</moduleName>
<compilerArgs>
<arg>-saveSource</arg>
</compilerArgs>
<draftCompile>true</draftCompile>
<style>PRETTY</style>
<failOnError>true</failOnError>
<launcherDir>${project.build.directory}/www</launcherDir>
<extra>${project.build.directory}/extra</extra>
<includes>
<include>**/*Test.java</include>
</includes>
<enableAssertions>false</enableAssertions>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwt.version}</version>
<executions>
<execution>
<configuration>
<testTimeOut>180</testTimeOut>
<includes>**/*GwtTest.java</includes>
<mode>htmlunit</mode>
<gen>gen</gen>
<extraJvmArgs>-Xss1024k -Xmx512M -XX:MaxPermSize=512m</extraJvmArgs>
<saveSource>true</saveSource>
<module>com.google.gwt.site.webapp.GWTProject</module>
<!--
Draft and pretty mode are turned on so that beginners can try out debugging
in their browser with no setup.
Please don't disable this; code size is less important.
-->
<draftCompile>true</draftCompile>
<style>PRETTY</style>
</configuration>
<goals>
<goal>compile</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.google.gwt.site</includeGroupIds>
<includeArtifactIds>gwt-site</includeArtifactIds>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>${project.build.directory}/www/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<!-- Copy results necessary for sourcemaps to work to the packaging output -->
<id>copy-sourcemap-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/www/gwtproject/</outputDirectory>
<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/</outputDirectory>
<resources>
<!-- copy GWT source code to website for debugging -->
<resource>
<directory>${project.build.directory}/extra/gwtproject/src</directory>
<targetPath>src</targetPath>
</resource>
<!-- copy sourcemaps to website for debugging -->
<resource>
<directory>${project.build.directory}/${project.artifactId}-${project.version}/gwtproject/</directory>
<directory>${project.build.directory}/extra/gwtproject/symbolMaps</directory>
<includes>
<include>*.json</include>
</includes>
<targetPath>src</targetPath>
</resource>
</resources>
</configuration>
Expand All @@ -182,4 +125,65 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!--
Generates a full working site for testing, by unpacking the
markdown along with this project's own output.
-->
<id>full-site</id>
<dependencies>
<dependency>
<groupId>com.google.gwt.site</groupId>
<artifactId>gwt-site</artifactId>
<version>${project.version}</version>
<type>zip</type>
<classifier>generated-site</classifier>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>com.google.gwt.site</includeGroupIds>
<includeArtifactIds>gwt-site</includeArtifactIds>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>${project.build.directory}/www/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<!-- Along with the dependency:unpack-dependencies, this generates a complete site to test with -->
<id>copy-www-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/www/</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/${project.artifactId}-${project.version}/</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

This file was deleted.

Loading

0 comments on commit 2707076

Please sign in to comment.