Skip to content

Commit

Permalink
Merge pull request #6 from uzzu/release-1.1.0
Browse files Browse the repository at this point in the history
Release 1.1.0
  • Loading branch information
uzzu authored Apr 21, 2020
2 parents fdd7004 + b5c4a67 commit 2f1e751
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.1.0] - 2020-04-21

### Added

- `(Map<String, String>) env.allVariables` to get all environment variables includes variables specified in `.env` files. [#5](https://github.com/uzzu/dotenv-gradle/pull/5)

## [1.0.2] - 2020-02-12

### Fixed
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Don't need to apply this plugin to subprojects.

### Create `.env` in the root directory of your gradle project


For example:

```dosini
Expand All @@ -42,7 +41,15 @@ println(env.BAZ.orElse("default baz")) // => baz

If a `.env.template` file exists, this plugin refer it to create a environemnt variable properties in the `env` extension.

[See more examples](/examples/basic)
### Others
- All APIs of `env` extension consider `.env` file.
- If the same variable name value is defined in both the `.env` file and the system environment variable, the system environment variable takes precedence.
- `(Boolean) env.isPresent(name: String)` : Indicates an environment variable with specified name is present.
- `(String) env.fetch(name: String)` : Returns an environment variable.
- `(String) env.fetch(name: String, defaultValue: String)` : Returns an environment variable, or specified default value if environment variable was not set.
- `(String?) env.fetchOrNull(name: String)` : Returns an environment variable, or null if environment variable was not set.
- `(Map<String, String) env.allVariables` : Returns all environment variables.
- [See more examples](/examples/basic)

## License

Expand Down
2 changes: 1 addition & 1 deletion examples/basic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
base
id("co.uzzu.dotenv.gradle") version "1.0.2"
id("co.uzzu.dotenv.gradle") version "1.1.0"
}

println(env.FOO.orElse("default_foo"))
Expand Down
2 changes: 1 addition & 1 deletion plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ tasks {
object Artifact {
val groupId = "co.uzzu.dotenv"
val artifactId = "gradle"
val version = "1.0.2"
val version = "1.1.0"
}

group = Artifact.groupId
Expand Down

0 comments on commit 2f1e751

Please sign in to comment.