From 35f5dbb878484752d799f830094674b6c762760e Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Wed, 18 Dec 2024 11:29:13 -0600 Subject: [PATCH] Build the site when something is pushed to main, or on PRs (#9) There is room for improvement here, this is meant to be a first draft before we start merging other cleanup, to validate those merges. Fixes #7 --- .github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ README.md | 33 ++++++++++++++++++++------------- pom.xml | 11 ++++++++--- src/main/module.gwt.xml | 7 +++---- 4 files changed, 59 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..319bc38 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build gwt-site-webapp +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + cache: 'maven' + + - name: Compile the webapp to JS + run: mvn --batch-mode --no-transfer-progress -e verify + + - name: Rename generated directory + # Fixes issue where artifact zip contains top level directory due to wildcard expansion + run: mv target/gwt-site-webapp-*/ target/gwt-site-webapp + - name: Upload the generated JS + uses: actions/upload-artifact@v3 + with: + name: 'gwt-site-webapp' + path: target/gwt-site-webapp/ diff --git a/README.md b/README.md index 3aa637e..71b8c23 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,35 @@ # 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. +This project includes the client code of the GWT site. It does not include the +site content which is in the gwt-site project nor the utilities to create and +deploy with samples and plugin releases. ## Requirements - [Apache Maven](http://maven.apache.org) 3.0 or greater, and JDK 7+ in order to run. +[Apache Maven](http://maven.apache.org) 3.8 or greater, and JDK 11+ in order to run. -- Before building the project you may need **gwt-site** packaged file. - Go to the `gwt-site` folder and run: +To build the project, invoke the following command: + + $ mvn verify + +This only tests and builds the JS to enhance the site content. To build the contents +first, you need to build the gwt-site project. + +1. Check out the [gwt-site](https://github.com/gwtproject/gwt-site) project. +2. Build the gwt-site project: $ cd [...]/gwt-site $ mvn install -- To **build** and check the app, run +3. Build the gwt-site-webapp project, with the -Pfull-site profile: $ cd [...]/gwt-site-webapp - $ mvn verify -P full-site + $ mvn verify -Pfull-site - 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. +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) or +[http.server](https://docs.python.org/3/library/http.server.html)). +Notice that an http server 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 +Building will run the **tests**, but to explicitly run them you can use the test target $ mvn test diff --git a/pom.xml b/pom.xml index 747c5b2..0e3be26 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ yyyy-MM-dd UTF-8 - 2.11.0 + 2.12.1 4.13.2 @@ -81,6 +81,11 @@ -saveSource + true true @@ -103,7 +108,7 @@ copy-resources - ${project.build.directory}/${project.artifactId}-${project.version}/ + ${project.build.directory}/${project.build.finalName}/ @@ -175,7 +180,7 @@ ${project.build.directory}/www/ - ${project.build.directory}/${project.artifactId}-${project.version}/ + ${project.build.directory}/${project.build.finalName}/ diff --git a/src/main/module.gwt.xml b/src/main/module.gwt.xml index c14dc41..f458278 100644 --- a/src/main/module.gwt.xml +++ b/src/main/module.gwt.xml @@ -2,11 +2,10 @@ - + - - + +