From 56a9d7eda8e43192020eaab9b8b5b067e10352a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 25 May 2017 12:10:16 +0200 Subject: Update user guide --- guide/index.html | 2 +- guide/relx.html | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/guide/index.html b/guide/index.html index 2752874..66c421c 100644 --- a/guide/index.html +++ b/guide/index.html @@ -33,7 +33,7 @@ div.navfooter{margin-bottom:1em}
-

Erlang.mk User Guide

Loïc Hoguin


Table of Contents

1. Installation
1.1. On Unix
1.2. On Windows
2. Getting started
2.1. Creating a folder for your project
2.2. Downloading Erlang.mk
2.3. Getting started with OTP applications
2.4. Getting started with OTP libraries
2.5. Getting started with OTP releases
2.6. Getting started from scratch
2.7. Using spaces instead of tabs
2.8. Using templates
2.9. Hiding Erlang.mk from git
2.10. Getting help
3. Overview
3.1. Building your project
3.2. Exploring the package index
3.3. Generating documentation
3.4. Running tests
3.5. Need more?
4. Updating Erlang.mk
4.1. Initial bootstrap
4.2. Updating
4.3. Customizing the build
5. Limitations
5.1. Erlang must be available
5.2. Spaces in path
5.3. Dependency tracking and modification times
I. Code
6. Building
6.1. How to build
6.2. What to build
6.3. Application resource file
6.4. Automatic application resource file values
6.5. File formats
6.6. Compilation options
6.7. Cold and hot builds
6.8. Dependency tracking
6.9. Generating Erlang source
6.10. Cleaning
7. Packages and dependencies
7.1. Searching packages
7.2. Adding dependencies to your project
7.3. How deps are fetched and built
7.4. Fetching and listing dependencies only
7.5. Ignoring unwanted dependencies
7.6. Dependencies directory
7.7. Many applications in one repository
7.8. Repositories with no application at the root level
7.9. Autopatch
7.10. Skipping deps
8. NIFs and port drivers
8.1. C source code location and Erlang environment
8.2. Using a custom Makefile
8.3. Using Erlang.mk directly
9. Releases
9.1. Setup
9.2. Configuration
9.3. Generating the release
9.4. Running the release
9.5. Upgrading a release
10. Self-extracting releases
10.1. Generating the self-extracting archive
10.2. Running the release
11. Escripts
11.1. Requirements
11.2. Generating an escript
11.3. Configuration
11.4. Extra files
11.5. Optimizing for size
12. Compatibility with other build tools
12.1. Rebar projects as Erlang.mk dependencies
12.2. Erlang.mk projects as Rebar dependencies
II. Documentation
13. AsciiDoc documentation
13.1. Requirements
13.2. Writing AsciiDoc documentation
13.3. Configuration
13.4. Usage
14. EDoc comments
14.1. Writing EDoc comments
14.2. Configuration
14.3. Usage
III. Tests
15. Erlang shell
15.1. Configuration
15.2. Usage
16. EUnit
16.1. Writing tests
16.2. Configuration
16.3. Usage
17. Common Test
17.1. Writing tests
17.2. Configuration
17.3. Usage
18. Code coverage
19. Continuous integration
20. Dialyzer
20.1. How it works
20.2. Configuration
20.3. Usage
21. Xref
IV. Third-party plugins
22. External plugins
22.1. Loading all plugins from a dependency
22.2. Loading one plugin from a dependency
22.3. Writing external plugins
22.4. Early-stage plugins
22.5. Loading plugins local to the application
23. List of plugins
23.1. efene.mk
23.2. elixir.mk
23.3. elvis.mk
23.4. geas
23.5. hexer.mk
23.6. hexpm.mk
23.7. jorel
23.8. lfe.mk
23.9. mix.mk
23.10. reload.mk
23.11. rust.mk
V. About Erlang.mk
24. Why Erlang.mk
24.1. Erlang.mk is fast
24.2. Erlang.mk gives you the full power of Unix
24.3. Erlang.mk is a text file
24.4. Erlang.mk can manage Erlang itself
24.5. Erlang.mk can do more than Erlang
24.6. Erlang.mk integrates nicely in Make and Automake projects
25. Short history
25.1. Before Erlang.mk
25.2. Lifetime of the project
26. Contributing
26.1. Priorities
26.2. Bugs
26.3. Code
26.4. Packages
26.5. Documentation
26.6. Feature requests
+

Erlang.mk User Guide

Loïc Hoguin


Table of Contents

1. Installation
1.1. On Unix
1.2. On Windows
2. Getting started
2.1. Creating a folder for your project
2.2. Downloading Erlang.mk
2.3. Getting started with OTP applications
2.4. Getting started with OTP libraries
2.5. Getting started with OTP releases
2.6. Getting started from scratch
2.7. Using spaces instead of tabs
2.8. Using templates
2.9. Hiding Erlang.mk from git
2.10. Getting help
3. Overview
3.1. Building your project
3.2. Exploring the package index
3.3. Generating documentation
3.4. Running tests
3.5. Need more?
4. Updating Erlang.mk
4.1. Initial bootstrap
4.2. Updating
4.3. Customizing the build
5. Limitations
5.1. Erlang must be available
5.2. Spaces in path
5.3. Dependency tracking and modification times
I. Code
6. Building
6.1. How to build
6.2. What to build
6.3. Application resource file
6.4. Automatic application resource file values
6.5. File formats
6.6. Compilation options
6.7. Cold and hot builds
6.8. Dependency tracking
6.9. Generating Erlang source
6.10. Cleaning
7. Packages and dependencies
7.1. Searching packages
7.2. Adding dependencies to your project
7.3. How deps are fetched and built
7.4. Fetching and listing dependencies only
7.5. Ignoring unwanted dependencies
7.6. Dependencies directory
7.7. Many applications in one repository
7.8. Repositories with no application at the root level
7.9. Autopatch
7.10. Skipping deps
8. NIFs and port drivers
8.1. C source code location and Erlang environment
8.2. Using a custom Makefile
8.3. Using Erlang.mk directly
9. Releases
9.1. Setup
9.2. Configuration
9.3. Generating the release
9.4. Running the release
9.5. Upgrading a release
9.6. Getting Relx semver value
10. Self-extracting releases
10.1. Generating the self-extracting archive
10.2. Running the release
11. Escripts
11.1. Requirements
11.2. Generating an escript
11.3. Configuration
11.4. Extra files
11.5. Optimizing for size
12. Compatibility with other build tools
12.1. Rebar projects as Erlang.mk dependencies
12.2. Erlang.mk projects as Rebar dependencies
II. Documentation
13. AsciiDoc documentation
13.1. Requirements
13.2. Writing AsciiDoc documentation
13.3. Configuration
13.4. Usage
14. EDoc comments
14.1. Writing EDoc comments
14.2. Configuration
14.3. Usage
III. Tests
15. Erlang shell
15.1. Configuration
15.2. Usage
16. EUnit
16.1. Writing tests
16.2. Configuration
16.3. Usage
17. Common Test
17.1. Writing tests
17.2. Configuration
17.3. Usage
18. Code coverage
19. Continuous integration
20. Dialyzer
20.1. How it works
20.2. Configuration
20.3. Usage
21. Xref
IV. Third-party plugins
22. External plugins
22.1. Loading all plugins from a dependency
22.2. Loading one plugin from a dependency
22.3. Writing external plugins
22.4. Early-stage plugins
22.5. Loading plugins local to the application
23. List of plugins
23.1. efene.mk
23.2. elixir.mk
23.3. elvis.mk
23.4. geas
23.5. hexer.mk
23.6. hexpm.mk
23.7. jorel
23.8. lfe.mk
23.9. mix.mk
23.10. reload.mk
23.11. rust.mk
V. About Erlang.mk
24. Why Erlang.mk
24.1. Erlang.mk is fast
24.2. Erlang.mk gives you the full power of Unix
24.3. Erlang.mk is a text file
24.4. Erlang.mk can manage Erlang itself
24.5. Erlang.mk can do more than Erlang
24.6. Erlang.mk integrates nicely in Make and Automake projects
25. Short history
25.1. Before Erlang.mk
25.2. Lifetime of the project
26. Contributing
26.1. Priorities
26.2. Bugs
26.3. Code
26.4. Packages
26.5. Documentation
26.6. Feature requests
diff --git a/guide/relx.html b/guide/relx.html index f210d5d..1f008a9 100644 --- a/guide/relx.html +++ b/guide/relx.html @@ -67,7 +67,30 @@ release will be example.

Once all this is don release upgrade:

$ make relup

This will create an archive at the root directory of the release, $RELX_OUTPUT_DIR/example/example-2.tar.gz.

Move the archive to the correct location on the running node. From the release’s root directory:

$ mkdir releases/2/
-$ mv path/to/example-2.tar.gz releases/2/

Finally, upgrade the release:

$ bin/example_release upgrade "2/example_release"

Or on Windows:

$ bin/example_release.cmd upgrade "2/example_release"

Your release was upgraded!

+$ mv path/to/example-2.tar.gz releases/2/

Finally, upgrade the release:

$ bin/example_release upgrade "2/example_release"

Or on Windows:

$ bin/example_release.cmd upgrade "2/example_release"

Your release was upgraded!

9.6. Getting Relx semver value

There is a workaround to get the semver value which is +generated by Relx based on VCS history.

Create a file rel/version with only one line inside:

{{ release_version }}

Add/Update the overlay section of your relx.config:

{overlay, [
+    {template, "rel/version", "version"}
+]}.

When you run mare rel it creates the file $(RELX_OUTPUT_DIR)/example/version +which contains the version value generated by Relx.

$ cat _rel/app/release
+1.0.0+build.11.ref5612aa0

In your Makefile you can use this simple snippet to get the version, +but please keep in mind that this should depend on the rel target:

$(shell cat $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/version)

For example:

include erlang.mk
+
+APP_VERSION = $(shell cat $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/version)
+myrecipe: all
+        echo APP_VERSION = $(APP_VERSION)

Would output:

$ make myrecipe
+...
+===> Starting relx build process ...
+===> Resolving OTP Applications from directories:
+          /home/username/example/apps
+          /home/username/example/deps
+          /usr/lib/erlang/lib
+          /home/username/example/_rel
+===> Resolved example-0.3.10+build.11.ref5612aa0
+===> Including Erts from /usr/lib/erlang
+===> release successfully created!
+===> tarball /home/username/example/_rel/example/example-0.3.10+build.11.ref5612aa0.tar.gz successfully created!
+echo APP_VERSION = 0.3.10+build.11.ref5612aa0
+APP_VERSION = 0.3.10+build.11.ref5612aa0
-- cgit v1.2.3