All Projects → ashald → Envfile

ashald / Envfile

Licence: mit
EnvFile 3.0 is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Envfile

Jetbrains Helper
Jetbrains helper
Stars: ✭ 33 (-88.74%)
Mutual labels:  jetbrains, idea, pycharm
Nord Jetbrains
An arctic, north-bluish clean and elegant JetBrains IDE UI and editor color theme.
Stars: ✭ 293 (+0%)
Mutual labels:  jetbrains, idea, plugin
Multihighlight
Jetbrains IDE plugin: highlight identifiers with custom colors 🖌💡
Stars: ✭ 65 (-77.82%)
Mutual labels:  jetbrains, idea, plugin
Runconfigurationasaction
Provides a way to use IntelliJ run configurations as buttons
Stars: ✭ 17 (-94.2%)
Mutual labels:  jetbrains, pycharm, plugin
Poetry Pycharm Plugin
A PyCharm plugin for poetry
Stars: ✭ 113 (-61.43%)
Mutual labels:  jetbrains, pycharm, plugin
Intellij Csv Validator
CSV validator, highlighter and formatter plugin for JetBrains Intellij IDEA, PyCharm, WebStorm, ...
Stars: ✭ 198 (-32.42%)
Mutual labels:  jetbrains, pycharm
Resharper Fsharp
F# support in JetBrains Rider
Stars: ✭ 216 (-26.28%)
Mutual labels:  jetbrains, plugin
JetBrains-scheme
JetBrains主题,更完美的高亮。支持 IntelliJ IDEA、phpstorm、goland、webstorm
Stars: ✭ 25 (-91.47%)
Mutual labels:  jetbrains, idea
JetBrainsRunner
A Krunner Plugin which allows you to open your recent projects
Stars: ✭ 31 (-89.42%)
Mutual labels:  jetbrains, pycharm
Pydantic Pycharm Plugin
PyCharm plugin for pydantic. This plugin provides autocompletion, inspection, type-checking, inserting unfilled argument, and more.
Stars: ✭ 116 (-60.41%)
Mutual labels:  jetbrains, pycharm
jetbrains-utility
Remove/Backup – settings & cli for macOS (OS X) – DataGrip, AppCode, CLion, Gogland, IntelliJ, PhpStorm, PyCharm, Rider, RubyMine, WebStorm
Stars: ✭ 62 (-78.84%)
Mutual labels:  jetbrains, pycharm
interstellar
Dark editor theme for JetBrains IDEs
Stars: ✭ 26 (-91.13%)
Mutual labels:  jetbrains, pycharm
Intellij Platform Solarized
Solarized UI and editor themes for IntelliJ IDEA, CLion, Rider, PyCharm, RubyMine, PhpStorm, WebStorm, Android Studio, DataGrip and GoLand
Stars: ✭ 148 (-49.49%)
Mutual labels:  jetbrains, pycharm
Tabnine Intellij
Jetbrains IDEs client for TabNine. Compatible with all IntelliJ-based IDEs. https://plugins.jetbrains.com/plugin/12798-tabnine
Stars: ✭ 140 (-52.22%)
Mutual labels:  jetbrains, pycharm
KV4Jetbrains
Syntax highlighting and auto-completion for Kivy/KivyMD .kv files in PyCharm/Intellij IDEA
Stars: ✭ 93 (-68.26%)
Mutual labels:  jetbrains, pycharm
Resharper Angularjs
ReSharper plugin for AngularJS support
Stars: ✭ 135 (-53.92%)
Mutual labels:  jetbrains, plugin
intellij-autohotkey
AutoHotkey plugin for the Jetbrain's IntelliJ platform
Stars: ✭ 30 (-89.76%)
Mutual labels:  jetbrains, pycharm
Quicklib
Quick development library (AutoMapper, LinQ, IOC Dependency Injection, MemoryCache, Scheduled tasks, Config, Serializers, etc) with crossplatform support for Delphi/Firemonkey (Windows,Linux,OSX/IOS/Android) and freepascal (Windows/Linux).
Stars: ✭ 274 (-6.48%)
Mutual labels:  json, yaml
aw-watcher-jetbrains
This extension allows the open source tracking tool ActivityWatch to keep track of the projects and coding languages you use in jetbrains IDEs.
Stars: ✭ 36 (-87.71%)
Mutual labels:  jetbrains, idea
Dyff
/ˈdʏf/ - diff tool for YAML files, and sometimes JSON
Stars: ✭ 277 (-5.46%)
Mutual labels:  json, yaml

EnvFile

Description

Env File is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.

Supported Formats

All formats assume that both keys and values are strings.

Supported Platforms

Expand to see supported run configuration types. Italic means that run configuration is only available in paid version of the product.

PyCharm
  • App Engine server
  • Behave
  • Django server
  • Django tests
  • Lettuce
  • Pyramid server
  • Python
  • Python docs
    • Docutils task
    • Sphinx task
  • Python test
    • Unittests
    • Doctests
    • Nosetests
    • py.test
    • Attests
  • Tox
IDEA
  • Application
  • Arquillian JUnit
  • Arquillian TestNG
  • CloudBees Server
  • Cucumber Java
  • Gradle (requires "Enable Experimental Integrations")
  • GWT Configuration
  • Geronimo Server
    • Local
    • Remote
  • GlassFish Server
    • Local
    • Remote
  • Google AppEngine Dev Server
  • Grails
  • JAR Application
  • JBoss Server
    • Local
    • Remote
  • JSR45 Compatible Server
    • Local
    • Remote
  • Jetty Server
    • Local
    • Remote
  • JUnit
  • Kotlin
  • Kotlin script
  • Resin
    • Local
    • Remote
  • Spring Boot
  • Spring dmServer
    • Spring dmServer (Local)
    • Spring dmServer (Remote)
  • TestNG
  • TomEE Server
    • Local
    • Remote
  • TomCat Server
    • Local
    • Remote
  • WebLogic Server
    • Local
    • Remote
  • WebSphere Server
    • Local
    • Remote
RubyMine
  • Capistrano
  • Cucumber
  • Gem Command
  • IRB Console
  • RSpec
  • Rack
  • Rails
  • Rake
  • Ruby
  • Spork DRb
  • Test::Unit/Shoulda/Minitest
  • Zeus Server
GoLand
  • Go App Engine
  • Go Build
  • Go Test
Cursive (>=1.8.2)
  • Local Clojure REPL
  • Clojure Application
  • Leiningen

Installation

  • Using IDE built-in plugin system:

    • Preferences > Plugins > Browse repositories... > Search for "Env File" > Install Plugin
  • Manually:

    • Download the latest release and install it manually using Preferences > Plugins > Install plugin from disk...

Restart IDE.

Usage

  1. Add new Run/Debug configuration: + Add new configuration > ...
  2. Switch to EnvFile tab
  3. Select Enable EnvFile checkbox
  4. Select Substitute Environment Variables checkbox (if needed)
  5. Select Process JetBrains path macro references checkbox (if needed)
  6. Select Ignore missing files checkbox (if needed)
  7. Select Enable experimental integrations checkbox (if needed)
  8. Click on + to add a file
  9. Adjust order as needed
  10. Even variables defined within run configuration can be processed, ordered and substituted

Read from file

Caveats

Hidden files

Hidden files (starting with a dot) are not displayed in Finder on macOS by default. To toggle hidden files in the Open dialog, press COMMAND + SHIFT + .. Alternatively, one can either tweak macOS to show hidden files or select any file using standard Finder dialog and then manually edit path by double-clicking on the entry in the table.

Experimental Integrations

Not all run configurations available in IDEA-based IDEs are implemented similarly. Some of them differ significantly. In certain cases (so far, only Gradle has been confirmed) the implementation exposes interfaces to integrate the EnvFile UI but doesn't provide interfaces for it to actually make its work. Luckily, it was possible to make few assumptions about IDEA's internal implementation and make it work. Such integration is very fragile and it's not immediately clear if it will affect any existing integrations and when it will break. For that reason there is a special option to Enable Experimental Integrations that can be enabled when desired and should prevent other integrations from breaking.

Examples

.env

# This line is ignored since it's a comment
SECRET_KEY=hip-hip-env-files
VERSION=1.0

or

# This line is ignored since it's a comment
SECRET_KEY hip-hip-env-files
VERSION 1.0

JSON

{
    # JSON doesn't have comments but since JSON is subset of YAML
    # We parse it with YAML parser and therefore have comments
    # And even trialling commas in objects :)
    "SECRET_KEY": "hip-hip-env-files",
    "VERSION": "1.0", # All non-string literals should be enclosed in quotes; btw this is ignored too
}

YAML

# This line is ignored since it's a comment
SECRET_KEY: hip-hip-env-files
VERSION: "1.0" # All non-string literals should be enclosed in quotes; btw this is ignored too

Bash (workaround)

There was a number of requests to support extracting environment variables from bash scripts like:

export SECRET_KEY="hip-hip-env-files"
export VERSION="1.0"

The feasible way to do that is yet to be discovered (if any at all) so the plugin does not support that at the moment. On the other hand there is a simple workaround that can be used for the time being. The example bash script from above can be split into an .env file and a generic script that can be used to set environment variables on a command line:

.env

SECRET_KEY="hip-hip-env-files"
VERSION="1.0"

set-env.sh

while read -r line; do export $line; done < .env

usage

$ . set-env.sh
$ echo $VERSION
1.0

Variable Expansion

EnvFile also supports environment variable substitution. It's optional and disabled by default. Implementation is based on StringSubstitutor so it's the best reference for how it works.

Examples

Syntax is derived from Bash but is way more primitive:

A=${FOO}            # A=""        <- unknown variables replaced by empty strings
B=${FOO:-default}   # B="default" <- default values can be set as in Bash
C=${B}              # C="default" <- it's possible to refer to other variables that were previously evaluated
D=$${C}             # D="$${C}"   <- double dollar serves as an escape character
E=$C                $ E="$C"      <- curly brackets are required

Precedence

Environment variables are evaluated in the order they are defined in files. Files are evaluated in the order defined in EnvFile UI. Environment variables defined in run configuration can be ordered relatively to files. Order between environment variables defined in run configuration is not defined.

It is possible to refer to any environment variables that were evaluated previously - within same file or from other sources.

Path Macro Substitution

EnvFile can substitute JetBrains path macro references such as $PROJECT_DIR$ etc. It's optional and disabled by default. For details - see "Working with $PROJECT_DIR$ in plugin configuration options".

Further Development

  • Add more formats (upon requests)
  • Add support for other JetBrains products/plugins (upon requests)
  • Add more tests (¯\_(ツ)_/¯)

Building

EnvFile uses Gradle for building.

$ ./gradlew clean test build
  
  BUILD SUCCESSFUL in 22s
  59 actionable tasks: 59 executed
  
$ ls -1 build/distributions
  Env File-2.1.1-SNAPSHOT.zip

In order to open plugin's project in IDE one should generate skeleton and then open it and import Gradle project:

$ ./gradlew setup
  
  BUILD SUCCESSFUL in 1s
  3 actionable tasks: 3 executed

This generates a very basic .idea project definition that is sufficient enough to ensure that IDEA would recognize this as a plugin after Gradle import.

Feedback

Any feedback, bug reports and feature requests are highly appreciated!

Feel free to create an issue, contact me using Github or just drop me an email to the address specified in plugin.xml/idea-plugin/[email protected].

License

Copyright (c) 2017 Borys Pierov. See the LICENSE file for license rights and limitations (MIT).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].