GithubHelp home page GithubHelp logo

gerrytan / idea-settings Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexandrecarlton/idea-settings

0.0 1.0 0.0 1.08 MB

Generates .idea & .iml files without the need to launch IntelliJ IDEA with a display server.

License: GNU General Public License v3.0

Shell 0.48% Kotlin 71.94% Starlark 27.58%

idea-settings's Introduction

IDEA Settings

CircleCI

An application that can be used to generate both .idea and *.iml files for use by IntelliJ IDEA from a .IDEA-settings.yml file in a given project.

Motivation

When importing a project, IntelliJ IDEA will create a number of *.iml files and an .idea folder containing metadata about the project. On large projects, this will consume a non-trivial amount of time. If we can pre-compute these files, developers can instead download and extract them and commence developing more quickly.

Furthermore, taking the time to set up a project can be costly and error prone. Instead, we can store the configuration in a single file that all developers can use to generate their settings, ensuring a standardised environment.

What can be configured?

See the example .IDEA-settings.yml which provides an example of all possible settings that can currently be configured.

Generating IDEA files

This project uses the Bazel build tool to both build and run this project. Please follow the installation instructions to obtain it.

To generate IDEA files for a given project, run the following from this checkout:

bazel run //:apply-idea-settings <project-directory>

By default, this will run with the Community edition of IDEA. To run the application with IDEA Ultimate:

bazel run --define product=ultimate //:apply-idea-settings <project-directory>

Development

Exposing configuration

The .IDEA-settings.yml configuration file is designed to mimic the Settings / Preferences Dialog. The link provided will allow developers using the Community Edition of IDEA to expose configuration that is exclusive to the Ultimate edition.

Discovering configuration

Locating the classes that control IDEA configuration can be tricky, especially in the Ultimate edition of IntelliJ IDEA (as the source is not available). A process to locate the relevant classes is as follows:

  1. Configure the setting to be exposed in a sample project.
  2. Discover the file modified as a result of this (perhaps by grepping .idea).
  3. zipgrep the component/filename in the relevant plugin jar.

Configuring IDEA configuration/system paths

By default, //:apply-idea-settings will create random temporary directories for its configuration and system paths, which are cleaned up on exit. To force it to use a fixed directory (to drop in useful configuration prior to importing the project), one can set the following variables:

  • IDEA_CONFIG_PATH
  • IDEA_SYSTEM_PATH

If set, the corresponding directories will not be cleaned up for inspection.

Inspecting logs

While warning logs are displayed when running //:apply-idea-settings, this is not enough to diagnose issues. IDEA will log all useful information to log/idea.log in its system path. If IDEA_SYSTEM_PATH is set, one can use:

tail -f ${IDEA_SYSTEM_PATH}/log/idea.log

Otherwise, the following may be handy:

tail -f /tmp/*/log/idea.log

Troubleshooting

error: supertypes of the following classes cannot be resolved.

Occasionally a compile error will reveal itself of the above form - add the following library to ensure it continues compiling:

Class Dependency
AbstractBaseJavaLocalInspection @idea-IC//:plugins/java/lib/java-api
AreaInstance @idea-IC//:lib/extensions
CommonProgramRunConfigurationParameters @idea-IC//:lib/platform-impl
ConfigurationWithAlternativeJre @idea-IC//:plugins/java/lib/java-api
ConfigurationWithCommandLineShortener @idea-IC//:lib/platform-impl
InputRedirectAware @idea-IC//:lib/platform-impl
LocalInspectionTool @idea-IC//:lib/platform-api
PersistentStateComponent @idea-IC//:lib/platform-api
UserDataHolder @idea-IC//:lib/util
UserDataHolderBase @idea-IC//:lib/util

Updating dependencies

This projects uses rules_jvm_external. To update a Maven dependency, modify the maven_install entry in WORKSPACE and run:

bazel run @unpinned_maven//:pin

idea-settings's People

Contributors

alexandrecarlton avatar

Watchers

 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.