forked from m2e-code-quality/m2e-code-quality
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/1.0.0.201608091842'
- Loading branch information
Showing
52 changed files
with
1,553 additions
and
1,131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,16 @@ These Eclipse plugins are built with the Tycho Maven plugin. The | |
marriage of OSGi, Eclipse, and Maven is imperfect. In particular, it | ||
rarely works to run a build that does not start with 'clean'. | ||
|
||
See docs/release.md for information about how all of this is released. | ||
This project has Oomph, and you can set up an Eclipse development workspace of it in one click by: | ||
|
||
1. Downloading the Eclipse Installer from https://www.eclipse.org/downloads/ and starting it. | ||
2. On the initial page, click on the *Switch to advanced mode* button in the top right. | ||
3. On the *Product* page, select *Eclipse for RCP and RAP Developers*. | ||
4. On the *Projects* page, collapse the *Eclipse Projects* to scroll down to the *Github Projects* and select *m2e-code-quality*. | ||
5. Choose your preferred installation settings on the *Variables* page. | ||
6. Finish the wizard and watch how your development environment is being assembled, courtesy of Oomph. | ||
|
||
See [doc/release.md](doc/release.md) for information about how all of this is released. | ||
|
||
Activity here is 'coordinated' on a mailing list: | ||
`[email protected]`. | ||
|
19 changes: 19 additions & 0 deletions
19
...test/src/main/java/com/basistech/m2e/code/quality/checkstyle/test/CheckstyleUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.basistech.m2e.code.quality.checkstyle.test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
|
||
import com.basistech.m2e.code.quality.checkstyle.CheckstyleUtil; | ||
|
||
public class CheckstyleUtilTest { | ||
|
||
@Test | ||
public void testAntToCheckstyleConversion() throws Exception { | ||
assertEquals(".*\\.java", CheckstyleUtil | ||
.convertAntStylePatternToCheckstylePattern("**\\/*.java")); | ||
assertEquals(".*\\.properties", CheckstyleUtil | ||
.convertAntStylePatternToCheckstylePattern("**/*.properties")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...ty.checkstyle/src/main/java/com/basistech/m2e/code/quality/checkstyle/CheckstyleUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.basistech.m2e.code.quality.checkstyle; | ||
|
||
import java.io.File; | ||
|
||
import com.google.common.base.Preconditions; | ||
|
||
public final class CheckstyleUtil { | ||
|
||
private CheckstyleUtil() { | ||
} | ||
|
||
/** | ||
* Helper to convert the maven-checkstyle-plugin includes/excludes pattern | ||
* to eclipse checkstyle plugin pattern. | ||
* | ||
* @param pattern | ||
* the maven-checkstyle-plugin pattern. | ||
* @return the converted checkstyle eclipse pattern. | ||
*/ | ||
public static String convertAntStylePatternToCheckstylePattern( | ||
final String pattern) { | ||
Preconditions.checkNotNull(pattern, "pattern cannot be null"); | ||
Preconditions.checkArgument(!pattern.isEmpty(), | ||
"pattern cannot be empty"); | ||
|
||
String sanitizedPattern = pattern.replace( | ||
File.separatorChar == '/' ? '\\' : '/', File.separatorChar); | ||
final String dupeSeperatorChar = File.separator + File.separator; | ||
while (sanitizedPattern.contains(dupeSeperatorChar)) { | ||
sanitizedPattern = | ||
sanitizedPattern.replace(dupeSeperatorChar, File.separator); | ||
} | ||
|
||
final StringBuilder sb = new StringBuilder(); | ||
for (int i = 0; i < sanitizedPattern.length(); ++i) { | ||
final char curChar = sanitizedPattern.charAt(i); | ||
char nextChar = '\0'; | ||
char nextNextChar = '\0'; | ||
if (i + 1 < sanitizedPattern.length()) { | ||
nextChar = sanitizedPattern.charAt(i + 1); | ||
} | ||
if (i + 2 < sanitizedPattern.length()) { | ||
nextNextChar = sanitizedPattern.charAt(i + 2); | ||
} | ||
|
||
if (curChar == '*' && nextChar == '*' | ||
&& nextNextChar == File.separatorChar) { | ||
sb.append(".*"); | ||
++i; | ||
++i; | ||
} else if (curChar == '*') { | ||
sb.append(".*"); | ||
} else if (curChar == '.') { | ||
sb.append("\\."); | ||
} else { | ||
sb.append(curChar); | ||
} | ||
} | ||
String result = sb.toString(); | ||
if (result.endsWith(File.separator)) { | ||
result += ".*"; | ||
} | ||
|
||
// cleanup the resulting regex pattern | ||
while (result.contains(".*.*")) { | ||
result = result.replace(".*.*", ".*"); | ||
} | ||
|
||
return result; | ||
} | ||
|
||
} |
115 changes: 0 additions & 115 deletions
115
...c/main/java/com/basistech/m2e/code/quality/checkstyle/EclipseCheckstyleConfigManager.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.