Flyte Documentation 0.0.2 Help

Getting Started

Recommended Tools:

Installation

Add the Flyte repository and Twilight dependency to your build tool of choice.

repositories { maven("https://repo.flyte.gg/releases") } dependencies { implementation("gg.flyte:twilight:1.1.7") }
repositories { maven { url "https://repo.flyte.gg/releases" } } dependencies { implementation("gg.flyte:twilight:1.1.7") }
<repositories> <!-- ... --> <repository> <id>flyte-repository-release</id> <name>Flyte Repository</name> <url>https://repo.flyte.gg/releases</url> </repository> </repositories> <dependencies> <!-- ... --> <dependency> <groupId>gg.flyte</groupId> <artifactId>twilight</artifactId> <version>1.1.7</version> </dependency> </dependencies>

Configuration

Certain features require configuration, which can be done via the Twilight class. To setup a Twilight class instance, you can use the twilight function shown below:

// This will use all default configurations val twilight = twilight(this) // This will use default configurations, unless specified val twilight = twilight(this) { env { useDifferentEnvironments = true devEnvFileName = ".env.dev" prodEnvFileName = ".env.prod" } }

The above are default env settings, though the values can be changed.

If you useDifferentEnvironments, you'll need a .env file which contains the following:

ENVIRONMENT=DEV # or PROD

This file determines whether to use your dev .env or your prod .env.

If you do not use this different environments feature, then it will just use the .env (or whatever you specify the name as with prodEnvFileName)

Throughout your project you can use Environment.get("VARIABLE") to retrieve a value from your environment variables.

Other features that can be configured in the Twilight class builder will have their own sections later in the README.

Libraries

Twilight is bundled with some useful libraries, some include:

Last modified: 21 February 2024