This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
forked from revelc/formatter-maven-plugin
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from velo/groovy
Prepare for groovy support
- Loading branch information
Showing
43 changed files
with
737 additions
and
183 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-SymbolicName: formatter-api | ||
Bundle-Version: 1.9.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Require-Bundle: org.junit;bundle-version="4.12.0", | ||
com.google.guava;bundle-version="21.0.0" | ||
Export-Package: com.marvinformatics.formatter |
File renamed without changes.
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
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
File renamed without changes.
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,59 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2010 Marvin Herman Froeder (marvin@marvinformatics.com) | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.marvinformatics.formatter</groupId> | ||
<artifactId>formatters</artifactId> | ||
<version>1.9.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>groovy-formatter-test</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<repositories> | ||
<repository> | ||
<id>greclipse</id> | ||
<url>http://dist.springsource.org/snapshot/GRECLIPSE/e4.7/</url> | ||
<layout>p2</layout> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.marvinformatics.formatter</groupId> | ||
<artifactId>formatter-api</artifactId> | ||
<version>1.9.0-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.marvinformatics.formatter</groupId> | ||
<artifactId>groovy-formatter</artifactId> | ||
<version>1.9.0-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
45 changes: 45 additions & 0 deletions
45
...ormatter-test/src/test/java/com/marvinformatics/formatter/groovy/GroovyFormatterTest.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,45 @@ | ||
/** | ||
* Copyright (C) 2010 Marvin Herman Froeder (marvin@marvinformatics.com) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.marvinformatics.formatter.groovy; | ||
|
||
import java.util.Map; | ||
|
||
import com.marvinformatics.formatter.AbstractFormatterTest; | ||
import com.marvinformatics.formatter.ConfigurationSource; | ||
import com.marvinformatics.formatter.Formatter; | ||
import com.marvinformatics.formatter.groovy.GroovyFormatter; | ||
|
||
/** | ||
* @author marvin.froeder | ||
*/ | ||
public class GroovyFormatterTest extends AbstractFormatterTest { | ||
|
||
@Override | ||
public Formatter createFormatter(Map<String, String> options, ConfigurationSource configurationSource) { | ||
return new GroovyFormatter(options); | ||
} | ||
|
||
@Override | ||
public void tuneDefaultConfigs(Map<String, String> options) { | ||
options.put("groovy.formatter.remove.unnecessary.semicolons", "false"); | ||
} | ||
|
||
@Override | ||
public String fileUnderTest() { | ||
return "AnyClass.groovy"; | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
formatters/groovy-formatter-test/src/test/resources/sample/AnyClass.groovy
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,37 @@ | ||
/** | ||
* Copyright (C) 2010 Marvin Herman Froeder (marvin@marvinformatics.com) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/** | ||
* Class description | ||
*/ | ||
class Foo | ||
{ | ||
String foo | ||
|
||
/* Method */ | ||
def callBar() | ||
{ | ||
new Bar().bar(foo) } | ||
|
||
/** Inner class */ | ||
class Bar | ||
{ | ||
|
||
def bar(foo) | ||
{ | ||
println "${foo}Bar" }}} | ||
|
||
def foo = new Foo(foo: 'Foo') | ||
foo.callBar() |
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,15 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-SymbolicName: groovy-formatter | ||
Bundle-Version: 1.9.0.qualifier | ||
Require-Bundle: formatter-api, | ||
org.codehaus.groovy.eclipse.core;bundle-version="[2.9.0,10.0.0)", | ||
org.codehaus.groovy.eclipse.refactoring;bundle-version="[2.9.0,10.0.0)", | ||
org.eclipse.jdt.groovy.core, | ||
org.eclipse.text, | ||
org.eclipse.jface.text, | ||
org.eclipse.jdt.core, | ||
org.codehaus.groovy, | ||
org.codehaus.groovy.eclipse | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Export-Package: com.marvinformatics.formatter.groovy |
File renamed without changes.
Oops, something went wrong.