Giter Site home page Giter Site logo

dockdockbuild's Introduction

DockDockBuild: Docker Based Makefile Support for IntelliJ-Based IDEs

DockDockBuild is an open source plugin for IntelliJ that dockerizes your makefile compilation.

logo Build Status codecov GitHub release IntelliJ plugin

When compiling a target in a makefile, this plugin builds a docker container and runs the compilation in that container. The container shares the host's code root path by using Docker's volume mapping, making the compiled code available and persistent.

DockDockBuild allows developers to compile their project on an immutable, uniform environment, without dedicated installations on their machine - just Docker.

This plugin fully supports GNU Make syntax, and provides:

  • Syntax highlighting
  • Run configurations
  • Gutter marks & context actions to run targets
  • and more

Based on https://plugins.jetbrains.com/plugin/9333-makefile-support

Prerequisites

  1. Docker - see installation instructions for Mac, Windows and Ubuntu.

    Please note that in some cases, it is recommended that Mac and Windows users install Docker Toolbox rather than Docker Desktop, as the latter might cause compatibility issues with Hyper-V - read more here.

  2. IntelliJ 2020.02 and above - if you have an older version, download the latest one here. It is recommended to uninstall the old version silently, so that you don't lose your old configuration.

Installation

From the IntelliJ Plugin Marketplace

In Settings, click on Plugins. You will find DockDockBuild in the Marketplace tab. Click on Install.

You may be required to restart your IDE following the installation.

From zip

In your IntelliJ Settings screen, click on Plugins. Click on Settings and select Install Plugin From Disk:

Install plugin from zip

Select the zip file, and then click on Install.

You may be required to restart your IDE following the installation.

Configuration

Plugin Configuration

Since DockDockBuild builds a docker container and runs the make command on it, you need to define the paths to your Docker executable, code root and Maven cache, for example:

Docker Desktop for Mac: plugin_config

Set the Path to Docker executable to be the location of the docker.exe file on your machine.

Set the Path to code root to be the location of your project's source code root folder.

Set the Path to Maven cache as the location of your .m2 folder.

Optionally: Set the Advanced docker settings with additional settings for the docker run command (mount additional volumes, etc.).

Run Configuration

DockDockBuild's run configuration is where you can select which Makefile and Dockerfile are used for building your project, as well as define environment variables.

When compiling a specific target from your Makefile, a default Run Configuration is set and used instantly by DockDockBuild, based on the location of the Makefile and the target being compiled.

You may also define multiple run configurations manually, and select which one to use each time you compile a target.

run config.jpg

  • Name your configuration.
  • Select the local Dockerfile or Docker image you would like to use.
  • Select the Makefile you would like to run.
  • Specify the target to be built.
  • [OPTIONAL] Select a script to be run on the container before the make command, that sets environment variables, runs installations etc.

Additional Configuration for Docker-Toolbox Users

Here

Usage

There are multiple ways to build your project using DockDockBuild:

  1. Select a run configuration from the drop-down list and click on the "play" button. select_run_config.png
  2. Go to your Makefile, and click on the "play" button next to the relevant target.

Development

The plugin is built using Gradle and uses gradle-intellij-plugin to integrate with IntelliJ Platform.

First, make sure gradle is using java 8, and not any other version.

To build a plugin run

$ ./gradlew buildPlugin

Plugin zip file will be created in build/distributions

To build & test the plugin in IDE run ./gradlew runIdea

Grammar modifications

The plugin uses Grammar-Kit to generate parser and lexer. Please install Grammar-Kit plugin and refer to the documentation if you want to modify grammar.

To regenerate a parser, open Makefile.bnf and press Ctrl+Shift+G (Cmd+Shift+G on Mac) To regenerate a lexer, open Makefile.flex and press Ctrl+Shift+G (Cmd+Shift+G on Mac)

Please make sure to add test to MakefileParserTest.kt for any parser modifications.

Contribution

We welcome contributions from everyone. Please refer to the documentation here for more info.

dockdockbuild's People

Contributors

hilag avatar dotbg avatar wejrox avatar piyalibanerj avatar salilbc avatar dratler avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.