Giter Site home page Giter Site logo

lukish1 / intellij-pants-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pantsbuild/intellij-pants-plugin

0.0 0.0 0.0 21.38 MB

IntelliJ Plug-in for Pants Build

License: Apache License 2.0

Python 2.52% Java 93.77% Shell 2.30% HTML 0.06% Scala 1.35%

intellij-pants-plugin's Introduction

intellij-pants-plugin

  • The intellij-pants-plugin supports importing, compiling and testing Pants projects.
  • Scala and Java projects are fully supported. Python projects are supported on a best effort basis.
  • As of 12/2/2016, latest version of the plugin supports IntelliJ IDEA 2016.3 and up for both Community Edition and Ultimate Edition.
  • As of 12/2/2016, the plugin supports 1.1.x, 1.2.x, and current master of Pants.

User documentation

Installing the Plugin

Please use Plugins tab: (Main menu: Settings | Plugins) to install the plugin. Find Pants Support plugin. Install and Restart IntelliJ.

Minimum set of plugins is required to enable Pants Support features

  • Gradle
  • Groovy
  • Java Bytecode Decompiler
  • JUnit
  • Python Community Edition (if you are importing python projects)
  • Scala

Importing an entire project directory

  • Use Main menu: File -> New -> Project From Existing Sources
  • Select project directory Import project from directory
  • Choose "Pants" on the next screen
  • Make sure the check box "All Targets in the directory" is enabled and proceed with the wizard

Importing targets from a BUILD File

  • Use Main menu: File -> New -> Project From Existing Sources
  • Select a Build File from within the project Import project from BUILD file
  • Check the targets you want to Import and proceed with the wizard. (Please wait for the targets to show up) Choose Targets

Importing targets from a script

  • Use Main menu: File -> New -> Project From Existing Sources
  • Select an executable that will use export goal to produce a desirable project structure. See an integration test as an example.

Importing multiple BUILD files/directories

  • Import the first directory/BUILD file
  • Use File -> New -> Module From Existing Sources to import next directories/BUILD files

Once you import the project using above steps, you will see the "Project View" with multiple modules configured.

Invoking Pants within IntelliJ

The plugin can invoke any Pants commands via Pants Tasks.

  • To configure a Pants Task simply create a new Pants Run Configuration Creating of a new Pants Run Configuration
  • Choose a target to run a task for Choosing a target Configured target
  • Fill the rest of options for the task. Note there is a task for each Pants goal. Configure Pants Task
  • Run the Task Configured Pants Task
  • To debug a task simply press Debug button next to Run button.
  • Note: you can create a task for any goal Bundle Task

Predefined Pants Tasks for test targets

The plugin can also generate test configurations.

For example if a test class is opened then with a right click it's easy to create a task to run and debug Run Configuration Producer Preconfigured Run Configuration

With a right click in Project View it's easy to create a test task to run all tests for a target Run Configuration Producer

Compilation

  • Pants' compile goal (Default) The plugin will use pants compile <list of targets> to compile your project once a Make or PantsCompile command is invoked. Compilation via compile goal

Compilation options can be configured in Preferences -> Build, Execution, Deployment -> Compiler -> Pants: Compilation Options

Plugin Features.

  • Project File Tree View. The plugin configures modules per pants build target. Due to multiple modules, the default "Project View" is not very user friendly. The Plugin provides a custom view "Project Files Tree View". This view adheres to your repository file hierarchy. You can switch to this view as follows: Project Files Tree View "Project Files Tree View" also provides an ability to filter out files that weren't loaded during project generation. Show Only Loaded Files
  • Project Regeneration using IntelliJ Action. If you add a dependency to your project, you can re-resolve project using IntelliJ Action in background. Use Main Menu: Help -> Find Action or Short hand Cmd+Shift+A and select Action "Refresh all External Projects" Remember to check "Include non-menu actions" Refresh Project
  • Running tests within IntelliJ You can right click on tests and run tests.

Report Bugs

If you encounter a bug, please check for existing issues or file a new one on the project page.

intellij-pants-plugin's People

Contributors

wisechengyi avatar fkorotkov avatar anicelyjohnson avatar tejal29 avatar baroquebobcat avatar ebubae avatar peiyuwang avatar backuitist avatar cosmicexplorer avatar illicitonion avatar dotordogh avatar jsirois avatar areitz avatar blorente avatar ericzundel avatar jcoveney avatar kwlzn avatar mrkb80 avatar rushanny 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.