Skip to content

Running EcoAndroid in Batch Mode

anasofiagribeiro edited this page Nov 20, 2020 · 8 revisions

EcoAndroid was designed as an IntelliJ plugin to be used on individual projects. However, it can also be used to analyse many projects at once. This page describes how it can be run in batch mode.

Run inspection from the command line

idea.bat inspect <project> <inspection-profile> <output> [<options>]

<project>: path to the project folder
<inspection-profile>: project profile, in xml format
<output>: path to the folder where the inspection profiles should be saved

-changes: Run inspections only on local uncommitted changes.
-d: Specify the full path to the subdirectory if you don't want to inspect the whole project.
-format: Specify the format of the output file with inspection results: xml (default), json, or plain.
-v: Set the verbosity level of the output:
          -v0 is the default low verbosity.
          -v1 is medium verbosity.
          -v2 is maximum verbosity.

Note: If you wish to know more about this, check the documentation.

Testing EcoAndroid from the command line

If you wish to test the plugin EcoAndroid from the command line, follow these steps:
          1. Clone the repository
          2. In the folder where your project is, run the command: inspect.sh EcoAndroid/ EcoAndroid/.idea/inspectionProfiles/MyProfile.xml EcoAndroid/inspectionResults/ -v2
          3. Look the xml inspection files in EcoAndroid/inspectionResults/

Note1: this commands are specified for Mac users, check the documentation above for information about the commands for the other operating systems.
Note2: if your project does not have .idea/inspectionProfiles/MyProfile.xml, you can install the plugin and retrieve the inspection profile from IntelliJ. If you wish to know more, check this documentation. To install the plugin, run gradle buildPlugin and the a jar will be created in build/libs. Install it manually in the IntelliJ.

Evaluation Script Python

A python script is located under the folder scripts/ entitled evaluationScript.py that was used in the evaluation of this plugin. In order for you to use it, you may need to change:

  • variable data: it's an excel file that holds the name of the application and the GitHub link.
  • variable workbook: it's an excel file to hold the number of problems found the inspection

The script creates an excel file, entitled evaluationStats, that saves the number of refactorings for the inspections performed by the Ecoandroid plugin.

Clone this wiki locally