Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some bugs and updated version #31

Merged
merged 5 commits into from
Mar 10, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Introduction
-----------

This is an [IntelliJ IDEA] plugin for [Sonar]. There was a plugin called [SONAR IDE], but it's development for [IntelliJ IDEA] has been discontinued with IntelliJ 9. Therefore I decided to write [my own plugin] as a learning experience while using the existing plugin as inspiration.
This is the unofficial [IntelliJ IDEA] plugin for [Sonar]. There was a plugin called [SONAR IDE], but it's development for [IntelliJ IDEA] has been discontinued with IntelliJ 9. Therefore I decided to write [my own plugin] which experienced multiple contributions from the IDEA community on Github.

[IntelliJ IDEA]: http://www.jetbrains.com/idea/
[Sonar]: http://www.sonarsource.org/
Expand All @@ -18,24 +18,25 @@ You can install the plugin through the official JetBrains repo. You can also man
Building the plugin
------------------

I am building the plugin locally using IntelliJ 12.0.4 (Build 123.169). To build it locally on your machine, modify idea.version and idea.build in pom.xml to match your local install. Unfortunately, I'm unable to find any versions of OpenAPI in Maven past 7.0.3. You'll have to install the various Intellij jars located in the lib folder of your IntelliJ install into your local Maven repository via:
To build the plugin on your machine you need to have at least a downloaded copy of IntelliJ 12.0.4 (Build 123.169).
The plugin depends on multiple jars of IntelliJ IDEA but as these are not available via Maven Central, you'll have to
install the various Intellij jars located in the lib folder of your IntelliJ install into your local Maven repository.

mvn install:install-file -Dfile=<path-to-file> -DgroupId=com.intellij -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=jar
For your convienience we created a bash script which will do exactly this for you
```
$ cd sonar-intellij-plugin/
$ ./install-intellij-libs.sh 12.0.4 <path to IntelliJ 12.0.4>
```

Alternatively, you can run the install-intellij-libs.sh script that [simonbrandhof] created.

./install-intellij-libs.sh <path to IntelliJ 12.0.4>

You'll also need to install a custom version of [ideauidesigner-maven-plugin]. See that readme for installation instructions.
To run the maven build you'll also need to install an updated version of [ideauidesigner-maven-plugin]. See that readme for installation instructions.
[ideauidesigner-maven-plugin]: https://github.com/gshakhn/ideauidesigner-maven-plugin

After you install all the jars this plugin needs into your local repo, just run

mvn package

The resulting zip file will be located in the target folder.

[simonbrandhof]: https://github.com/simonbrandhof
[ideauidesigner-maven-plugin]: https://github.com/gshakhn/ideauidesigner-maven-plugin

Using the plugin
------------------
Expand All @@ -62,6 +63,9 @@ Version 1.0.6-SNAPSHOT
- Fix Open in Browser if host doesn't have http:// (see [#23](https://github.com/gshakhn/sonar-intellij-plugin/issues/23) and [#26](https://github.com/gshakhn/sonar-intellij-plugin/pull/26))
- Add URL to plugin.xml so website shows up in JetBrains repository. (see [#21](https://github.com/gshakhn/sonar-intellij-plugin/issues/21))
- Change text in Project Configuration UI so it's more intuitive. (see [#24](https://github.com/gshakhn/sonar-intellij-plugin/issues/24))
- Fixed "Running the build with IDEA 12.1 jars fails tests" [#27](https://github.com/gshakhn/sonar-intellij-plugin/issues/27)
- Fixed "NullPointerException if project isn't in Sonar" [#30](https://github.com/gshakhn/sonar-intellij-plugin/issues/30)
- Fixed "Code Formatting" [#28](https://github.com/gshakhn/sonar-intellij-plugin/issues/28)

Version 1.0.5
- Fix NPE if looking at file that isn't analyzed by sonar. (see [#17](https://github.com/gshakhn/sonar-intellij-plugin/issues/17))
Expand Down
22 changes: 14 additions & 8 deletions install-intellij-libs.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/sh
# This script will install all files in IntelliJ IDEA's lib/ folder to the local maven .m2 repository. This way we can use them during the build
#
# Usage:
# ./install-intellij-libs.sh 12.0.4 /Users/ahe/Applications/IntelliJ-IDEA-12.app/

INTELLIJ_HOME=$1
IDEA_VERSION=$1
INTELLIJ_HOME=$2

if [ -z "$INTELLIJ_HOME" ]
then
echo "Please provide the path to Intellij home directory. For example: install-intellij-libs.sh /Applications/Nika-IU-111.228.app"
echo "Please provide the version and path to the IntelliJ home directory. For example: ./install-intellij-libs.sh 12.0.4 /Users/ahe/Applications/IntelliJ-IDEA-12.app/"
exit 1
fi

Expand All @@ -16,9 +21,10 @@ fi

echo 'Installing Intellij artifacts to Maven local repository'
echo "Intellij home: $INTELLIJ_HOME"

mvn install:install-file -Dfile="$INTELLIJ_HOME/lib/openapi.jar" -DgroupId=com.intellij -DartifactId=openapi -Dversion=12.0.4 -Dpackaging=jar
mvn install:install-file -Dfile="$INTELLIJ_HOME/lib/util.jar" -DgroupId=com.intellij -DartifactId=util -Dversion=12.0.4 -Dpackaging=jar
mvn install:install-file -Dfile="$INTELLIJ_HOME/lib/extensions.jar" -DgroupId=com.intellij -DartifactId=extensions -Dversion=12.0.4 -Dpackaging=jar
mvn install:install-file -Dfile="$INTELLIJ_HOME/lib/annotations.jar" -DgroupId=com.intellij -DartifactId=annotations -Dversion=12.0.4 -Dpackaging=jar
mvn install:install-file -Dfile="$INTELLIJ_HOME/lib/forms_rt.jar" -DgroupId=com.intellij -DartifactId=forms_rt -Dversion=12.0.4 -Dpackaging=jar
for i in `ls -1 ${INTELLIJ_HOME}/lib/*.jar`
do
FOLDERS=(${i//\// })
FILE_POS=${#FOLDERS[@]}
JAR_FILE=${FOLDERS[${FILE_POS}-1]%.jar}
mvn install:install-file -Dfile="$INTELLIJ_HOME/lib/${JAR_FILE}.jar" -DgroupId=com.intellij -DartifactId=${JAR_FILE} -Dversion=${IDEA_VERSION} -Dpackaging=jar
done
Loading