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

Simplify build, support Java 11, cleanup readme #11

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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

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.
189 changes: 97 additions & 92 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<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>
Expand All @@ -20,7 +20,6 @@
<!-- 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 @@ -37,27 +36,22 @@
<groupId>com.google.gwt</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>
</dependency>
<dependency>
<groupId>com.google.gwt</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>com.google.gwt</groupId>
<artifactId>gwt-codeserver</artifactId>
<version>${gwt.version}</version>
</dependency>
</dependencies>

<build>
Expand All @@ -68,17 +62,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 +73,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 +126,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.

Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public void f(Element e) {
if (shouldEnhanceLink(link)) {
// No need to make complicated things for computing
// the absolute path: anchor.pathname is the way
link.attr("href", link.prop("pathname"));
link.attr("href", link.<Object>prop("pathname"));
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
<!-- Could not determine the version of your GWT SDK; using the module DTD from GWT 1.6.4. You may want to change this. -->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
<module rename-to="gwtproject">
<inherits name="com.google.gwt.user.User" />
<inherits name="com.google.gwt.user.User" />
<inherits name="com.google.gwt.query.Query"/>

<source path="client" />
<entry-point
class="com.google.gwt.site.webapp.client.GWTProjectEntryPoint" />
<entry-point
class="com.google.gwt.site.webapp.client.GWTProjectEntryPoint" />
<add-linker name="xsiframe"/>
<set-property name="compiler.useSourceMaps" value="true"/>
<!-- change to localhost for development -->
<set-configuration-property name="includeSourceMapUrl"
value="http://www.gwtproject.org/src/__HASH___sourceMap__FRAGMENT__.json"/>
<set-configuration-property name="includeSourceMapUrl"
value="https://www.gwtproject.org/src/__HASH___sourceMap__FRAGMENT__.json"/>

<set-configuration-property name="installCode" value="false"/>
<!-- remove after fix to issue 8630 lands -->
Expand Down