Skip to content

Commit

Permalink
[CI-skip] Update documentation of the build process
Browse files Browse the repository at this point in the history
  • Loading branch information
LinqLover committed Apr 16, 2021
1 parent 4a12204 commit 4ad7dca
Showing 1 changed file with 56 additions and 13 deletions.
69 changes: 56 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Squeak by Example [![Build Status](https://travis-ci.com/hpi-swa-lab/SqueakByExample-english.svg?branch=master)](https://travis-ci.com/hpi-swa-lab/SqueakByExample-english)
# Squeak by Example

[![📕 Make Book](https://github.com/hpi-swa-lab/SqueakByExample-english/actions/workflows/build.yml/badge.svg)](https://github.com/hpi-swa-lab/SqueakByExample-english/actions/workflows/build.yml)

This is the LaTeX source repository of the _Squeak by Example_ book.

See the issues in the [Github repository](https://github.com/hpi-swa-lab/SqueakByExample-english) for the status of tasks for SBE.

---

# File structure
# Repository structure

The main file is SBE.tex. Chapters are in subdirectories.
You can latex either the entire book, or each individual chapter.
Expand All @@ -30,26 +32,67 @@ to verify that you have added all the dependent files (e.g., figures).

## Build process

The PDF of the book is built via Travis CI on each commit, which includes the execution of SBEtests and the generation of screenshots that are described by a figure script. Two PDFs are created, one for the latest Squeak release and one for the current Trunk version.
The PDF of the book is built via GitHub Actions on each commit, which includes the execution of internal tests, the check of TEX-inlined `@TEST` assertions, and the generation of screenshots that are described by figure scripts.
Two PDFs are created, one for the latest Squeak release and one for the current Trunk version.

The usual workflow to **add a scripted screenshot to the book** is as follows:

1. Open the relevant tex file and insert the following snipped before the `\figure` definition:

```tex
\begin{ExecuteSmalltalkScript}
SBESqueakPicture writeTo: './figures/<name>.png' using: [:helper |
self shouldBeImplemented
]
\end{ExecuteSmalltalkScript}
\begin{figure}
\centering
\includegraphics[scale=0.65]{<name>}
\caption{<caption>.\label{fig:<name>}}
\end{figure}
```

2. Insert figure name, caption, and script generation logic in the template above.
Browse the repository to find existing examples.

**Tip:** You can also use `SBEDebuggingScreenshotRecorder` instead of `SBEFigureBuilder` for testing your screenshot script right in the image (the file won't be saved on disk in this case).

3. Test your script by doing `SBEFigureBuilder buildAllTexFigures` (maybe you need to set `#resourceDirectory` before) or `SBEFigureBuilder buildFiguresWith: FSPath * 'your' / 'path'`.

4. Build the PDF using the Makefile to make sure your screenshot looks well.

5. Commit! 🚀 The PDF will automatically build on the CI now ...

6. If the build process has completed, you can watch the results [in the Actions tab of the GitHub repository](https://github.com/hpi-swa-lab/SqueakByExample-english/actions?query=branch%3Amaster) by opening the latest successful build and scrolling down to the artifacts.

**To build the PDF manually,** do the following:

The usual workflow to codify a screenshot is documented [here](https://github.com/hpi-swa-lab/SqueakByExample-english/issues/21#issue-516598115). If the build process completed, you can watch the results [here](https://drive.google.com/drive/folders/1tNIvN-9Vx8djNZYfSYuqhjheb-EgJuTc).
To build the PDF manually, do the following:
### I. Installation

1. Get a support Squeak image (any release since 5.3 or the latest Trunk image)
2. Open the Git Browser and clone this repository

2. Open the Git Browser and clone this repository. Install missing dependencies as specified in the baseline if necessary.

3. Make sure to set the resource directory to the path of your working copy:
```smalltalk
SBEFigureBuilder resourceDirectory: FileDirectory default asFSReference / 'path' / 'to' / 'workingCopy'.
```

```smalltalk
SBEFigureBuilder resourceDirectory: FileDirectory default asFSReference / 'path' / 'to' / 'workingCopy'.
```

4. Install any Linux distribution.

### II. Building

1. Do it:
```smalltalk
SBEFigureBuilder buildAllTexFigures.
```

```smalltalk
SBEFigureBuilder buildAllTexFigures.
```

2. From the shell, run "make" in the working copy.

For more insights into the build process, have a look at the `Makefile` and the `.travis.yml`.
For more insights into the build process, have a look at the [`Makefile`](/Makefile) and the [`.github/worfklows/build.yml`](.github/workflows/build.yml).

## Printing

Expand Down

0 comments on commit 4ad7dca

Please sign in to comment.