Skip to content

Commit

Permalink
Update the Groovy plug-in to 3.0.0-alpha-4
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Dec 31, 2018
1 parent aa2f15d commit 0ff4899
Show file tree
Hide file tree
Showing 162 changed files with 5,070 additions and 6,714 deletions.
2 changes: 1 addition & 1 deletion Site-org.codehaus.groovy.eclipse/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<category name="org.codehaus.groovy.compilers"/>
</feature>

<feature id="org.codehaus.groovy26.feature" url="features/org.codehaus.groovy26.feature_3.2.0.qualifier.jar" version="3.3.0.qualifier">
<feature id="org.codehaus.groovy30.feature" url="features/org.codehaus.groovy30.feature_3.2.0.qualifier.jar" version="3.3.0.qualifier">
<category name="org.codehaus.groovy.compilers"/>
</feature>

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeFalse;

import java.io.File;
import java.util.Arrays;
Expand Down Expand Up @@ -1684,7 +1685,7 @@ public void testAnnotationCollectorMultiProject() throws Exception {

fullBuild();
expectingNoProblems();
if (!isAtLeastGroovy(25) || isAtLeastGroovy(26)) {
if (!isAtLeastGroovy(25)) {
expectingCompiledClasses("com.demo.MyAnnotation", "com.demo.Widget");
} else {
expectingCompiledClasses("com.demo.MyAnnotation", "com.demo.MyAnnotation$CollectorHelper", "com.demo.Widget");
Expand Down Expand Up @@ -1725,7 +1726,7 @@ public void testAnnotationCollectorIncremental() throws Exception {

incrementalBuild(paths[0]);
expectingNoProblems();
if (!isAtLeastGroovy(25) || isAtLeastGroovy(26)) {
if (!isAtLeastGroovy(25)) {
expectingCompiledClasses("Book", "Length", "NotNull", "ISBN");
} else {
expectingCompiledClasses("Book", "Length", "NotNull", "ISBN", "ISBN$CollectorHelper");
Expand Down Expand Up @@ -1825,27 +1826,28 @@ public void testClosureIncremental() throws Exception {
executeClass(paths[0], "Launch", "12345678", "");
}

/** Verify the processing in ASTTransformationCollectorCodeVisitor - to check it finds everything it expects. */
@Test
public void testSpock_GRE558() throws Exception {
assumeFalse(isAtLeastGroovy(30)); // TODO: Remove when spock-core supports Groovy 3

IPath[] paths = createSimpleProject("Project", true);
env.addJar(paths[0], "lib/spock-core-1.1-groovy-2.4.jar");
env.addJar(paths[0], "lib/spock-core-1.2-groovy-2.4.jar");
env.addEntry(paths[0], JavaCore.newContainerEntry(new Path("org.eclipse.jdt.junit.JUNIT_CONTAINER/4")));

env.addGroovyClass(paths[1], "", "MyTest",
"import org.junit.runner.RunWith\n" +
"import spock.lang.Specification \n" +
"\n" +
"class MyTest extends Specification {\n" +
"//deleting extends Specification is sufficient to remove all 3 errors,\n" +
"//necessary to remove model.SpecMetadata\n" +
"\n" +
"def aField; //delete line to remove the model.FieldMetadata error.\n" +
"import spock.lang.Specification\n" +
"\n" +
"def noSuchLuck() { expect: //delete line to remove model.FeatureMetadata error. \n" +
" println hello }\n" +
"public static void main(String[] argv) { print 'success';}\n" +
"}");
"final class MyTest extends Specification {\n" +
" def aField\n" +
" def aMethod() {\n" +
" expect:\n" +
" println 'hello'\n" +
" }\n" +
" static void main(String[] argv) {\n" +
" print 'success'\n" +
" }\n" +
"}\n");

incrementalBuild(paths[0]);
expectingNoProblems();
Expand All @@ -1860,8 +1862,10 @@ public void testSpock_GRE558() throws Exception {
*/
@Test
public void testSpock_GRE605_1() throws Exception {
assumeFalse(isAtLeastGroovy(30)); // TODO: Remove when spock-core supports Groovy 3

IPath[] paths = createSimpleProject("Project", true);
env.addJar(paths[0], "lib/spock-core-1.1-groovy-2.4.jar");
env.addJar(paths[0], "lib/spock-core-1.2-groovy-2.4.jar");
env.addEntry(paths[0], JavaCore.newContainerEntry(new Path("org.eclipse.jdt.junit.JUNIT_CONTAINER/4")));

env.addGroovyClass(paths[1], "", "FoobarSpec",
Expand Down Expand Up @@ -1924,8 +1928,10 @@ public void testSpock_GRE605_1() throws Exception {
*/
@Test
public void testSpock_GRE605_2() throws Exception {
assumeFalse(isAtLeastGroovy(30)); // TODO: Remove when spock-core supports Groovy 3

IPath[] paths = createSimpleProject("Project", true);
env.addJar(paths[0], "lib/spock-core-1.1-groovy-2.4.jar");
env.addJar(paths[0], "lib/spock-core-1.2-groovy-2.4.jar");
env.addEntry(paths[0], JavaCore.newContainerEntry(new Path("org.eclipse.jdt.junit.JUNIT_CONTAINER/4")));

env.addGroovyClass(paths[1], "", "FoobarSpec",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected String[] getDefaultClassPaths() {
System.arraycopy(cps, 0, newcps, 0, cps.length);

String[] ivyVersions = {"2.5.0", "2.4.0"};
String[] groovyVersions = {"2.6.0-indy", "2.5.5-indy", "2.4.16"};
String[] groovyVersions = {"3.0.0-indy", "2.5.5-indy", "2.4.16"};
try {
URL groovyJar = null;
for (String groovyVer : groovyVersions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public enum SpecifiedVersion {
_24(2, 4, "24"),
_25(2, 5, "25"),
_26(2, 6, "26"),
_30(3, 0, "30"),
DONT_CARE(0, 0, "-1"),
UNSPECIFIED(0, 0, "0");

Expand Down Expand Up @@ -106,6 +107,11 @@ public static SpecifiedVersion parseVersion(String jarName) {
return _26;
}
break;
case 3:
switch (minor) {
case 0:
return _30;
}
}
} catch (NumberFormatException e) {
// can ignore just return unspecified
Expand Down Expand Up @@ -152,6 +158,9 @@ public static SpecifiedVersion findVersionFromString(String compilerLevel) {
if ("26".equals(compilerLevel) || "2.6".equals(compilerLevel)) {
return _26;
}
if ("30".equals(compilerLevel) || "3.0".equals(compilerLevel)) {
return _30;
}
if ("0".equals(compilerLevel)) {
return UNSPECIFIED;
}
Expand All @@ -160,7 +169,7 @@ public static SpecifiedVersion findVersionFromString(String compilerLevel) {
}

System.out.println("Invalid Groovy compiler level specified: " + compilerLevel + "\n" +
"Must be one of 16, 1.6, 17, 1.7, 18, 1.8, 19, 1.9, 20, 2.0, 21, 2.1, 22, 2.2, 23, 2.3, 24, 2.4, 25, 2.5, 26 or 2.6");
"Must be one of 16, 1.6, 17, 1.7, 18, 1.8, 19, 1.9, 20, 2.0, 21, 2.1, 22, 2.2, 23, 2.3, 24, 2.4, 25, 2.5, 26, 2.6, 30 or 3.0");

return UNSPECIFIED;
}
Expand Down Expand Up @@ -194,6 +203,11 @@ public static SpecifiedVersion findVersion(Version ver) {
case 6:
return _26;
}
case 3:
switch (ver.getMinor()) {
case 0:
return _30;
}
}
return UNSPECIFIED;
}
Expand Down
111 changes: 0 additions & 111 deletions base/org.codehaus.groovy26/META-INF/MANIFEST.MF

This file was deleted.

3 changes: 0 additions & 3 deletions base/org.codehaus.groovy26/VERSION

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 0ff4899

Please sign in to comment.