GithubHelp home page GithubHelp logo

intellijideasettingsupdater's Introduction

Intellij Idea Settings Updater

A python script that modifies the maven import settings in IntelliJ IDEA's workspace.xml

It ensures that the following Maven Import preferences are set:

  <component name="MavenImportPreferences">
    <option name="importingSettings">
      <MavenImportingSettings>
        <option name="downloadDocsAutomatically" value="true" />
        <option name="downloadSourcesAutomatically" value="true" />
        <option name="importAutomatically" value="true" />
      </MavenImportingSettings>
    </option>
  </component>

If the element exists previously, it is updated. However, if it previously contains any other options than importAutomatically, the script doesn't modify the file.

Usage? just run

python updater.py --help

Usage examples

You have two IDEA projects in a directory called IdeaProjects. They have the following workspace.xml settings files:

~/IdeaProjects/importAutomatically/.idea/workspace.xml
~/IdeaProjects/no_maven_settings/.idea/workspace.xml

To update the maven import settings for these projects, run the following command:

python updater.py -d ~/IdeaProjects

Or you can manually tell which files to update:

python updater.py ~/IdeaProjects/importAutomatically/.idea/workspace.xml ~/IdeaProjects/no_maven_settings/.idea/workspace.\
xml

Safety

A backup is always created before modifying the original file (workspace.xml-bak). In case you need to revert the changes..

Future work

  • Making the script generic so that other settings changes can be requested with a simple syntax
    • for example:
python updater.py --set-value component[@name='MavenImportPreferences']/option[@name='importingSettings']/MavenImportingSe\
ttings/option/[@name='downloadDocsAutomatically']/value=true
  • or for example a specialized feature for setting options, something like this:
python updater.py --set-option MavenImportPreferences/importingSettings/MavenImportingSettings/option/downloadDocsAutomati\
cally=true
  • Improving the unit test & script structure
  • Change tests like if not maven to future-proof, for example this:
python updater.py:93: FutureWarning: The behavior of this method will change in future versions.  Use specific 'len(elem)'\
or 'elem is not None' test instead.
  if not maven:

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.