Skip to content

Initial version with Antora #1

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

Draft
wants to merge 1 commit 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 'Build'

on:
push:
workflow_dispatch:

concurrency:
group: github-pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'gradle'
- name: Build docs
id: build
run: ./gradlew antora
- name: Include static files
shell: bash
run: cp -r .well-known build/site/
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: build/site/

deploy:
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-24.04
needs: build
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Gradle
.gradle
build
build/asciidoc/*

# Ignore Gradle GUI config
gradle-app.setting

# NodeJS
node_modules/

# Antora UI
ui/public/

# Eclipse
.classpath
.settings/
.project
bin/

# IntelliJ
*.iml
*.ipr
*.iws
*.uml
.idea/
*/out/*

# Misc
*.log
*.graphml
coverage.db*
out
.metadata
*.svg.cache
*.pdf
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# AssertJ Doc Website

This project generates and packages the AssertJ documentation website.

This project is based on [Antora](https://antora.org).

As AssertJ is composed of multiple modules, each one host his own documentation source files ( in asciidoc ) and this project is responsible for the aggregation and packaging

## Build documentation

Building AssertJ documentation is done by the all-in-one command :

```
./gradlew antora
```

The site is produced in folder `build/site` and you can preview it with any static webserver ( like `python -m SimpleHTTPServer 8000` )

## UI development

This section offers a basic tutorial to teach you how to preview it locally, and bundle it for use with Antora.
A more comprehensive tutorial can be found in the documentation at [docs.antora.org](https://docs.antora.org/).

### Preview the UI

The AssertJ Antora UI sub project is configured to preview offline.
The files in the `preview-src/` folder provide the sample content that allow you to see the UI in action.
In this folder, you'll primarily find pages written in AsciiDoc.
These pages provide a representative sample and kitchen sink of content from the real site.

To build the UI and preview it in a local web server, run the `preview` command:

```
./gradlew previewUI
```

You'll see a URL listed in the output of this command:

```
[12:00:00] Starting server...
[12:00:00] Server started http://localhost:5252
[12:00:00] Running server
```

Navigate to this URL to preview the site locally.

While this command is running, any changes you make to the source files will be instantly reflected in the browser.
This works by monitoring the project for changes, running the `preview:build` task if a change is detected, and sending the updates to the browser.

Press `Ctrl`+`C` to stop the preview server and end the continuous build.

### Package for Use with Antora

```
./gradlew buildUI
```
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

51 changes: 51 additions & 0 deletions antora-playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
site:
title: AssertJ - fluent assertions java library
start_page: assertj::index.adoc
url: /assertj-doc

content:
sources:
- url: .
start_path: docs
branches: HEAD
- url: https://github.com/assertj/assertj-core.git
start_paths:
- assertj-core/src/main/docs
- assertj-guava/src/main/docs
tags: [
'assertj-build-@({3..9}).@({27}).@({3..99})',
'assertj-build-@({3..9}).@({28..99}).+({0..9})'
]
branches: [docs-*.*.*]
version:
assertj-build-(*.*.*): $1
docs-(*): $1
- url: https://github.com/assertj/assertj-db.git
start_path: src/main/docs
tags: [
'assertj-db-@({3..9}).!0.+({1..9})'
]
branches: [docs-*.*.*]
version:
assertj-db-(*.*.*): $1
docs-(*): $1

ui:
bundle:
url: ./ui/build/ui-bundle.zip

asciidoc:
extensions:
- '@asciidoctor/tabs'
- '@springio/asciidoctor-extensions'
attributes:
stackoverflow-url: https://stackoverflow.com/questions/tagged/assertj
assertj-examples-repo: https://github.com/assertj/assertj-examples
assertj-javadoc-root: https://www.javadoc.io/doc/org.assertj
fold: none
page-pagination: '@'

antora:
extensions:
- '@antora/lunr-extension'
- '@antora/collector-extension'
37 changes: 37 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import com.github.gradle.node.npm.task.NpmTask

plugins {
id("org.antora") version "1.0.0"
}

node {
version.set("22.13.0")
}

tasks.named("antora") {
dependsOn("buildUI")
}

tasks.register<NpmTask>("installUI") {
workingDir.set(projectDir.resolve("ui"))
npmCommand.set(listOf("install"))
inputs.file("ui/package.json")
inputs.file("ui/package-lock.json")
outputs.dir("ui/node_modules")
}

tasks.register<NpmTask>("buildUI") {
dependsOn("installUI")
workingDir.set(projectDir.resolve("ui"))
npmCommand.set(listOf("run", "build"))
inputs.file("ui/gulpfile.js")
inputs.dir("ui/src")
inputs.dir("ui/gulp.d")
outputs.dir("ui/build")
}

tasks.register<NpmTask>("previewUI") {
dependsOn("installUI")
workingDir.set(projectDir.resolve("ui"))
npmCommand.set(listOf("run", "start"))
}
3 changes: 3 additions & 0 deletions docs/antora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: assertj
title: Home
version: ~
30 changes: 30 additions & 0 deletions docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
:page-layout: home
:!sectids:
= AssertJ

[.centered]
[.grid]
== Fluent assertions for java

[.column3]
=== Rich and easy to use

AssertJ provides a rich set of assertions, truly helpful error messages, improves test code readability and is designed to be super easy to use within your favorite IDE.
Get started right away with the one minute starting guide, have a look at some of AssertJ great features or stay up to date with the latest releases.
If you are convinced by AssertJ, you can automatically convert your JUnit assertions to AssertJ.

[.column3]
=== Extensible

You can easily write assertions for your own classes, which will make your test assertions reflect the domain and is a way to use the ubiquitous language in your tests !
We provide an assertion generator to quickly create assertions for your domain model classes.

[.column3]
=== Community driven

AssertJ only exists to help the dev community. We listen to users ideas to provide the most useful assertions.
AssertJ is a fork of the great Fest Assert library which is not maintained anymore.
AssertJ will remain open and free forever.

[.centered]
== AssertJ provides assertions for popular libraries
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading