From f1c9909bd4e7560cc908e257a94e612ed3970f8c Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Mon, 3 Sep 2018 22:46:22 +0200 Subject: Add Angular IDE support in installer, fixes #1830 --- doc/changelog.markdown | 3 +- .../eclipse/AngularIDELocationProvider.java | 44 +++++++++++++++++++++ .../eclipse/StandardProductDescriptor.java | 15 ++++++- src/installer/lombok/installer/eclipse/angular.png | Bin 0 -> 1012 bytes 4 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 src/installer/lombok/installer/eclipse/AngularIDELocationProvider.java create mode 100644 src/installer/lombok/installer/eclipse/angular.png diff --git a/doc/changelog.markdown b/doc/changelog.markdown index a294d6a1..ad39475f 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -6,6 +6,8 @@ Lombok Changelog * BUGFIX: When using lombok to compile modularized (`module-info.java`-style) code, if the module name has dots in it, it wouldn't work. [Issue #1808](https://github.com/rzwitserloot/lombok/issues/1808) * BUGFIX: Errors about lombok not reading a module providing `org.mapstruct.ap.spi` when trying to use lombok in jigsaw-mode on JDK 11. [Issue #1806](https://github.com/rzwitserloot/lombok/issues/1806) * BUGFIX: Fix NetBeans compile on save. [Issue #1770](https://github.com/rzwitserloot/lombok/issues/1770) +* PLATFORM: Angular IDE is now recognized by the installer [Issue #1830](https://github.com/rzwitserloot/lombok/issues/1830) + ### v1.18.2 (July 26th, 2018) * BUGFIX: mapstruct + lombok in eclipse should hopefully work again. [Issue #1359](https://github.com/rzwitserloot/lombok/issues/1359) and [mapstruct issue #1159](https://github.com/mapstruct/mapstruct/issues/1159) @@ -14,7 +16,6 @@ Lombok Changelog * BUGFIX: Lombok and gradle v4.9 didn't work together; that's been fixed. [Issue #1716](https://github.com/rzwitserloot/lombok/issues/1716) and [gradle-apt-plugin issue #87](https://github.com/tbroyer/gradle-apt-plugin/issues/87) * FEATURE: You can now make builders for type hierarchies, using the new (experimental) `@SuperBuilder` annotation. Thanks for the contribution, Jan Rieke. [`@SuperBuilder` documentation](https://projectlombok.org/features/experimental/SuperBuilder) * FEATURE: `@NoArgsConstructor`, including forcing one with `lombok.config: lombok.noArgsConstructor.extraPrivate=true` now take any defaults set with `@Builder.Default` into account. [Issue #1347](https://github.com/rzwitserloot/lombok/issues/1347) - ### v1.18.0 (June 5th, 2018) * BREAKING CHANGE: The in 1.16.22 introduced configuration key `lombok.noArgsConstructor.extraPrivate` is now `false` by default. [Issue #1708](https://github.com/rzwitserloot/lombok/issues/1708) * BUGFIX: Do not generate a private no-args constructor if that breaks the code. [Issue #1703](https://github.com/rzwitserloot/lombok/issues/1703), [Issue #1704](https://github.com/rzwitserloot/lombok/issues/1704), [Issue #1712](https://github.com/rzwitserloot/lombok/issues/1712) diff --git a/src/installer/lombok/installer/eclipse/AngularIDELocationProvider.java b/src/installer/lombok/installer/eclipse/AngularIDELocationProvider.java new file mode 100644 index 00000000..6d580e13 --- /dev/null +++ b/src/installer/lombok/installer/eclipse/AngularIDELocationProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2018 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.installer.eclipse; + +import java.util.Collections; + +import org.mangosdk.spi.ProviderFor; + +import lombok.installer.IdeLocationProvider; + +@ProviderFor(IdeLocationProvider.class) +public class AngularIDELocationProvider extends EclipseProductLocationProvider { + + private static final EclipseProductDescriptor ANGULAR = new StandardProductDescriptor( + "Angular IDE", + "angularide", + "angular", + AngularIDELocationProvider.class.getResource("angular.png"), + Collections.emptySet() + ); + + public AngularIDELocationProvider() { + super(ANGULAR); + } +} diff --git a/src/installer/lombok/installer/eclipse/StandardProductDescriptor.java b/src/installer/lombok/installer/eclipse/StandardProductDescriptor.java index 47e103aa..9bd3ae94 100644 --- a/src/installer/lombok/installer/eclipse/StandardProductDescriptor.java +++ b/src/installer/lombok/installer/eclipse/StandardProductDescriptor.java @@ -21,6 +21,7 @@ */ package lombok.installer.eclipse; +import java.io.File; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; @@ -34,7 +35,7 @@ import lombok.installer.OsUtils; public class StandardProductDescriptor implements EclipseProductDescriptor { private static final String USER_HOME = System.getProperty("user.home", "."); - private static final String[] WINDOWS_ROOTS = {"\\", "\\Program Files", "\\Program Files (x86)", USER_HOME}; + private static final String[] WINDOWS_ROOTS = windowsRoots(); private static final String[] MAC_ROOTS = {"/Applications", USER_HOME}; private static final String[] UNIX_ROOTS = {USER_HOME}; @@ -155,4 +156,16 @@ public class StandardProductDescriptor implements EclipseProductDescriptor { } return base + pathSeparator + alternative.replaceAll("[\\/]", "\\" + pathSeparator); } + + private static String[] windowsRoots() { + String localAppData = windowsLocalAppData(); + if (localAppData == null) return new String[] {"\\", "\\Program Files", "\\Program Files (x86)", USER_HOME}; + return new String[] {"\\", "\\Program Files", "\\Program Files (x86)", USER_HOME, localAppData}; + } + + private static String windowsLocalAppData() { + String localAppData = System.getenv("LOCALAPPDATA"); + File file = localAppData == null ? null : new File(localAppData); + return file != null && file.exists() && file.canRead() && file.isDirectory() ? localAppData : null; + } } diff --git a/src/installer/lombok/installer/eclipse/angular.png b/src/installer/lombok/installer/eclipse/angular.png new file mode 100644 index 00000000..d3204cd7 Binary files /dev/null and b/src/installer/lombok/installer/eclipse/angular.png differ -- cgit From 21df1c99391fb8e2678efa2ca11816bfcadd4725 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Tue, 4 Sep 2018 00:51:02 +0200 Subject: Use edge-SNAPSHOT instead of master-SNAPSHOT --- website/templates/_download-edge.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/templates/_download-edge.html b/website/templates/_download-edge.html index 3fa28f83..c1520780 100644 --- a/website/templates/_download-edge.html +++ b/website/templates/_download-edge.html @@ -10,7 +10,7 @@

Download edge release now!

- You can use the edge release also from your build tool using the JitPack repository. + You can use the edge release also from your build tool using the JitPack repository.

-- cgit From 92bc41ae6dce8e16fd9da64c08ad085822fd33ed Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 4 Sep 2018 01:48:49 +0200 Subject: [debugging] Improved the ecj AST printer --- src/core/lombok/eclipse/EclipseASTVisitor.java | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/core/lombok/eclipse/EclipseASTVisitor.java b/src/core/lombok/eclipse/EclipseASTVisitor.java index b2fd4b2f..37bda5e3 100644 --- a/src/core/lombok/eclipse/EclipseASTVisitor.java +++ b/src/core/lombok/eclipse/EclipseASTVisitor.java @@ -34,9 +34,14 @@ import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.ast.Block; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration; +import org.eclipse.jdt.internal.compiler.ast.Expression; import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; import org.eclipse.jdt.internal.compiler.ast.Initializer; import org.eclipse.jdt.internal.compiler.ast.LocalDeclaration; +import org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation; +import org.eclipse.jdt.internal.compiler.ast.MemberValuePair; +import org.eclipse.jdt.internal.compiler.ast.NormalAnnotation; +import org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation; import org.eclipse.jdt.internal.compiler.ast.Statement; import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.ast.TypeReference; @@ -351,7 +356,23 @@ public interface EclipseASTVisitor { } public void visitAnnotationOnMethod(AbstractMethodDeclaration method, EclipseNode node, Annotation annotation) { - forcePrint("", isGenerated(method) ? " (GENERATED)" : "", annotation, position(node)); + forcePrint("", isGenerated(method) ? " (GENERATED)" : "", annotation, position(node)); + if (annotation instanceof MarkerAnnotation || disablePrinting != 0) { + forcePrint("", isGenerated(method) ? " (GENERATED)" : "", annotation, position(node)); + } else { + forcePrint("", isGenerated(method) ? " (GENERATED)" : "", annotation, position(node)); + indent++; + if (annotation instanceof SingleMemberAnnotation) { + Expression expr = ((SingleMemberAnnotation) annotation).memberValue; + print(" %s", expr.getClass(), expr); + } + if (annotation instanceof NormalAnnotation) { + for (MemberValuePair mvp : ((NormalAnnotation) annotation).memberValuePairs) { + print(" %s", new String(mvp.name), mvp.value.getClass(), mvp.value); + } + } + indent--; + } } public void endVisitMethod(EclipseNode node, AbstractMethodDeclaration method) { -- cgit From af55bd0a328aa05f3ffb53a57a37306d1372a478 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 4 Sep 2018 01:53:30 +0200 Subject: [wip] Random fixes to various tests that are failing, especially against Java7. --- src/core/lombok/javac/handlers/HandleBuilder.java | 3 +- src/utils/lombok/core/ClassLiteral.java | 39 +++++++++++++++++----- src/utils/lombok/core/FieldSelect.java | 39 +++++++++++++++++----- src/utils/lombok/eclipse/Eclipse.java | 4 +-- .../BuilderSingularToBuilderWithNull.java | 2 +- .../after-delombok/BuilderWithToBuilder.java | 2 +- .../BuilderSingularToBuilderWithNull.java | 2 +- 7 files changed, 67 insertions(+), 24 deletions(-) diff --git a/src/core/lombok/javac/handlers/HandleBuilder.java b/src/core/lombok/javac/handlers/HandleBuilder.java index 63697691..1a471029 100644 --- a/src/core/lombok/javac/handlers/HandleBuilder.java +++ b/src/core/lombok/javac/handlers/HandleBuilder.java @@ -516,7 +516,8 @@ public class HandleBuilder extends JavacAnnotationHandler { arg = tgt[0]; } else { JCExpression eqNull = maker.Binary(CTC_EQUAL, tgt[0], maker.Literal(CTC_BOT, null)); - JCExpression emptyList = maker.Apply(List.nil(), chainDots(type, "java", "util", "Collections", "emptyList"), List.nil()); + List tas = cloneTypes(maker, bfd.singularData.getTypeArgs(), ast, type.getContext()); + JCExpression emptyList = maker.Apply(tas, chainDots(type, "java", "util", "Collections", "emptyList"), List.nil()); arg = maker.Conditional(eqNull, emptyList, tgt[1]); } diff --git a/src/utils/lombok/core/ClassLiteral.java b/src/utils/lombok/core/ClassLiteral.java index 077ead31..2008484b 100644 --- a/src/utils/lombok/core/ClassLiteral.java +++ b/src/utils/lombok/core/ClassLiteral.java @@ -1,13 +1,34 @@ +/* + * Copyright (C) 2018 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package lombok.core; public class ClassLiteral { - private final String className; - - public ClassLiteral(String className) { - this.className = className; - } - - public String getClassName() { - return className; - } + private final String className; + + public ClassLiteral(String className) { + this.className = className; + } + + public String getClassName() { + return className; + } } diff --git a/src/utils/lombok/core/FieldSelect.java b/src/utils/lombok/core/FieldSelect.java index ab784401..4c055105 100644 --- a/src/utils/lombok/core/FieldSelect.java +++ b/src/utils/lombok/core/FieldSelect.java @@ -1,13 +1,34 @@ +/* + * Copyright (C) 2018 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package lombok.core; public class FieldSelect { - private final String finalPart; - - public FieldSelect(String finalPart) { - this.finalPart = finalPart; - } - - public String getFinalPart() { - return finalPart; - } + private final String finalPart; + + public FieldSelect(String finalPart) { + this.finalPart = finalPart; + } + + public String getFinalPart() { + return finalPart; + } } diff --git a/src/utils/lombok/eclipse/Eclipse.java b/src/utils/lombok/eclipse/Eclipse.java index 943a7a7a..5dbe3e2d 100644 --- a/src/utils/lombok/eclipse/Eclipse.java +++ b/src/utils/lombok/eclipse/Eclipse.java @@ -186,11 +186,11 @@ public class Eclipse { default: return null; } } else if (e instanceof ClassLiteralAccess) { - return new ClassLiteral(Eclipse.toQualifiedName(((ClassLiteralAccess)e).type.getTypeName())); + return new ClassLiteral(Eclipse.toQualifiedName(((ClassLiteralAccess) e).type.getTypeName())); } else if (e instanceof SingleNameReference) { return new FieldSelect(new String(((SingleNameReference)e).token)); } else if (e instanceof QualifiedNameReference) { - String qName = Eclipse.toQualifiedName(((QualifiedNameReference)e).tokens); + String qName = Eclipse.toQualifiedName(((QualifiedNameReference) e).tokens); int idx = qName.lastIndexOf('.'); return new FieldSelect(idx == -1 ? qName : qName.substring(idx+1)); } else if (e instanceof UnaryExpression) { diff --git a/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java b/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java index 1f472438..b0563858 100644 --- a/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java +++ b/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java @@ -58,6 +58,6 @@ class BuilderSingularToBuilderWithNull { } @java.lang.SuppressWarnings("all") public BuilderSingularToBuilderWithNullBuilder toBuilder() { - return new BuilderSingularToBuilderWithNullBuilder().elems(this.elems == null ? java.util.Collections.emptyList() : this.elems); + return new BuilderSingularToBuilderWithNullBuilder().elems(this.elems == null ? java.util.Collections.emptyList() : this.elems); } } diff --git a/test/transform/resource/after-delombok/BuilderWithToBuilder.java b/test/transform/resource/after-delombok/BuilderWithToBuilder.java index b644a16f..8615a40b 100644 --- a/test/transform/resource/after-delombok/BuilderWithToBuilder.java +++ b/test/transform/resource/after-delombok/BuilderWithToBuilder.java @@ -86,7 +86,7 @@ class BuilderWithToBuilder { } @java.lang.SuppressWarnings("all") public BuilderWithToBuilderBuilder toBuilder() { - return new BuilderWithToBuilderBuilder().one(this.mOne).two(this.mTwo).foo(BuilderWithToBuilder.rrr(this)).bars(this.bars == null ? java.util.Collections.emptyList() : this.bars); + return new BuilderWithToBuilderBuilder().one(this.mOne).two(this.mTwo).foo(BuilderWithToBuilder.rrr(this)).bars(this.bars == null ? java.util.Collections.emptyList() : this.bars); } } class ConstructorWithToBuilder { diff --git a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java index 7265e17a..7feff6e9 100644 --- a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java +++ b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java @@ -52,6 +52,6 @@ import lombok.Singular; return new BuilderSingularToBuilderWithNullBuilder(); } public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullBuilder toBuilder() { - return new BuilderSingularToBuilderWithNullBuilder().elems(((this.elems == null) ? java.util.Collections.emptyList() : this.elems)); + return new BuilderSingularToBuilderWithNullBuilder().elems(((this.elems == null) ? java.util.Collections.emptyList() : this.elems)); } } -- cgit From a39ef3ba0cae1fd6038c4407ec7e66f9bf0f5ea2 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 4 Sep 2018 01:53:07 +0200 Subject: [issue #1851] Lombok needs to generate type-use annotations when copying over types from, say, a field, to getter/setter/constructor/builder/wither/etc. --- .../eclipse/handlers/EclipseHandlerUtil.java | 189 ++++++++++++++++++++- .../lombok/javac/handlers/JavacHandlerUtil.java | 8 + .../after-delombok/TypeUseAnnotations.java | 14 ++ .../resource/after-ecj/TypeUseAnnotations.java | 15 ++ .../resource/before/TypeUseAnnotations.java | 11 ++ 5 files changed, 229 insertions(+), 8 deletions(-) create mode 100644 test/transform/resource/after-delombok/TypeUseAnnotations.java create mode 100644 test/transform/resource/after-ecj/TypeUseAnnotations.java create mode 100644 test/transform/resource/before/TypeUseAnnotations.java diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index f89ef061..1e29764a 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -24,8 +24,10 @@ package lombok.eclipse.handlers; import static lombok.core.handlers.HandlerUtil.*; import static lombok.eclipse.Eclipse.*; import static lombok.eclipse.EclipseAugments.*; +import static lombok.eclipse.handlers.EclipseHandlerUtil.EclipseReflectiveMembers.*; import java.lang.reflect.Constructor; +import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; @@ -64,14 +66,22 @@ import org.eclipse.jdt.internal.compiler.ast.ArrayQualifiedTypeReference; import org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference; import org.eclipse.jdt.internal.compiler.ast.Block; import org.eclipse.jdt.internal.compiler.ast.CastExpression; +import org.eclipse.jdt.internal.compiler.ast.CharLiteral; +import org.eclipse.jdt.internal.compiler.ast.ClassLiteralAccess; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration; +import org.eclipse.jdt.internal.compiler.ast.DoubleLiteral; import org.eclipse.jdt.internal.compiler.ast.EqualExpression; import org.eclipse.jdt.internal.compiler.ast.Expression; +import org.eclipse.jdt.internal.compiler.ast.ExtendedStringLiteral; +import org.eclipse.jdt.internal.compiler.ast.FalseLiteral; import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; import org.eclipse.jdt.internal.compiler.ast.FieldReference; +import org.eclipse.jdt.internal.compiler.ast.FloatLiteral; import org.eclipse.jdt.internal.compiler.ast.IfStatement; import org.eclipse.jdt.internal.compiler.ast.IntLiteral; +import org.eclipse.jdt.internal.compiler.ast.Literal; +import org.eclipse.jdt.internal.compiler.ast.LongLiteral; import org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation; import org.eclipse.jdt.internal.compiler.ast.MemberValuePair; import org.eclipse.jdt.internal.compiler.ast.MessageSend; @@ -89,8 +99,10 @@ import org.eclipse.jdt.internal.compiler.ast.SingleNameReference; import org.eclipse.jdt.internal.compiler.ast.SingleTypeReference; import org.eclipse.jdt.internal.compiler.ast.Statement; import org.eclipse.jdt.internal.compiler.ast.StringLiteral; +import org.eclipse.jdt.internal.compiler.ast.StringLiteralConcatenation; import org.eclipse.jdt.internal.compiler.ast.ThisReference; import org.eclipse.jdt.internal.compiler.ast.ThrowStatement; +import org.eclipse.jdt.internal.compiler.ast.TrueLiteral; import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.ast.TypeParameter; import org.eclipse.jdt.internal.compiler.ast.TypeReference; @@ -250,6 +262,9 @@ public class EclipseHandlerUtil { MarkerAnnotation ann = new MarkerAnnotation(copyType(annotation.type, source), pS); setGeneratedBy(ann, source); ann.declarationSourceEnd = ann.sourceEnd = ann.statementEnd = pE; + try { + reflectSet(ANNOTATION__MEMBER_VALUE_PAIR_NAME, ann, reflect(ANNOTATION__MEMBER_VALUE_PAIR_NAME, annotation)); + } catch (Exception ignore) { /* Various eclipse versions don't have it */ } return ann; } @@ -257,8 +272,10 @@ public class EclipseHandlerUtil { SingleMemberAnnotation ann = new SingleMemberAnnotation(copyType(annotation.type, source), pS); setGeneratedBy(ann, source); ann.declarationSourceEnd = ann.sourceEnd = ann.statementEnd = pE; - //TODO memberValue(s) need to be copied as well (same for copying a NormalAnnotation as below). - ann.memberValue = ((SingleMemberAnnotation)annotation).memberValue; + ann.memberValue = copyAnnotationMemberValue(((SingleMemberAnnotation) annotation).memberValue); + try { + reflectSet(ANNOTATION__MEMBER_VALUE_PAIR_NAME, ann, reflect(ANNOTATION__MEMBER_VALUE_PAIR_NAME, annotation)); + } catch (Exception ignore) { /* Various eclipse versions don't have it */ } return ann; } @@ -266,13 +283,138 @@ public class EclipseHandlerUtil { NormalAnnotation ann = new NormalAnnotation(copyType(annotation.type, source), pS); setGeneratedBy(ann, source); ann.declarationSourceEnd = ann.statementEnd = ann.sourceEnd = pE; - ann.memberValuePairs = ((NormalAnnotation)annotation).memberValuePairs; + MemberValuePair[] inPairs = ((NormalAnnotation) annotation).memberValuePairs; + if (inPairs == null) { + ann.memberValuePairs = null; + } else { + ann.memberValuePairs = new MemberValuePair[inPairs.length]; + for (int i = 0; i < inPairs.length; i++) ann.memberValuePairs[i] = + new MemberValuePair(inPairs[i].name, inPairs[i].sourceStart, inPairs[i].sourceEnd, copyAnnotationMemberValue(inPairs[i].value)); + } + try { + reflectSet(ANNOTATION__MEMBER_VALUE_PAIR_NAME, ann, reflect(ANNOTATION__MEMBER_VALUE_PAIR_NAME, annotation)); + } catch (Exception ignore) { /* Various eclipse versions don't have it */ } return ann; } return annotation; } + static class EclipseReflectiveMembers { + public static final Field STRING_LITERAL__LINE_NUMBER; + public static final Field ANNOTATION__MEMBER_VALUE_PAIR_NAME; + public static final Field TYPE_REFERENCE__ANNOTATIONS; + static { + STRING_LITERAL__LINE_NUMBER = getField(StringLiteral.class, "lineNumber"); + ANNOTATION__MEMBER_VALUE_PAIR_NAME = getField(Annotation.class, "memberValuePairName"); + TYPE_REFERENCE__ANNOTATIONS = getField(TypeReference.class, "annotations"); + } + + public static int reflectInt(Field f, Object o) { + try { + return ((Number) f.get(o)).intValue(); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } + + public static void reflectSet(Field f, Object o, Object v) { + try { + f.set(o, v); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } + + public static Object reflect(Field f, Object o) { + try { + return f.get(o); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } + + private static Field getField(Class c, String fName) { + try { + Field f = c.getDeclaredField(fName); + f.setAccessible(true); + return f; + } catch (Exception e) { + return null; + } + } + } + + private static Expression copyAnnotationMemberValue(Expression in) { + Expression out = copyAnnotationMemberValue0(in); + out.constant = in.constant; + return out; + } + + private static Expression copyAnnotationMemberValue0(Expression in) { + int s = in.sourceStart, e = in.sourceEnd; + + // literals + + if (in instanceof FalseLiteral) return new FalseLiteral(s, e); + if (in instanceof TrueLiteral) return new TrueLiteral(s, e); + if (in instanceof NullLiteral) return new NullLiteral(s, e); + + if (in instanceof CharLiteral) return new CharLiteral(((Literal) in).source(), s, e); + if (in instanceof DoubleLiteral) return new DoubleLiteral(((Literal) in).source(), s, e); + if (in instanceof FloatLiteral) return new FloatLiteral(((Literal) in).source(), s, e); + if (in instanceof IntLiteral) return IntLiteral.buildIntLiteral(((Literal) in).source(), s, e); + if (in instanceof LongLiteral) return LongLiteral.buildLongLiteral(((Literal) in).source(), s, e); + + if (in instanceof StringLiteral) return new StringLiteral(((Literal) in).source(), s, e, reflectInt(STRING_LITERAL__LINE_NUMBER, in) + 1); + if (in instanceof ExtendedStringLiteral) { + StringLiteral str = new StringLiteral(((Literal) in).source(), s, e, reflectInt(STRING_LITERAL__LINE_NUMBER, in) + 1); + StringLiteral empty = new StringLiteral(new char[0], s, e, reflectInt(STRING_LITERAL__LINE_NUMBER, in) + 1); + return new ExtendedStringLiteral(str, empty); + } + if (in instanceof StringLiteralConcatenation) { + Expression[] literals = ((StringLiteralConcatenation) in).literals; + // 0 and 1 len shouldn't happen. + if (literals.length == 0) return new StringLiteral(new char[0], s, e, 0); + if (literals.length == 1) return copyAnnotationMemberValue0(literals[0]); + StringLiteralConcatenation c = new StringLiteralConcatenation((StringLiteral) literals[0], (StringLiteral) literals[1]); + for (int i = 2; i < literals.length; i++) c = c.extendsWith((StringLiteral) literals[i]); + return c; + } + + // enums and field accesses (as long as those are references to compile time constant literals that's also acceptable) + + if (in instanceof SingleNameReference) { + SingleNameReference snr = (SingleNameReference) in; + long p = (long) s << 32 | e; + return new SingleNameReference(snr.token, p); + } + if (in instanceof QualifiedNameReference) { + QualifiedNameReference qnr = (QualifiedNameReference) in; + return new QualifiedNameReference(qnr.tokens, qnr.sourcePositions, s, e); + } + + // class refs + if (in instanceof ClassLiteralAccess) return new ClassLiteralAccess(e, copyType(((ClassLiteralAccess) in).type)); + + // arrays + if (in instanceof ArrayInitializer) { + Expression[] exprs = ((ArrayInitializer) in).expressions; + Expression[] copy = new Expression[exprs.length]; + for (int i = 0; i < exprs.length; i++) copy[i] = copyAnnotationMemberValue(exprs[i]); + ArrayInitializer out = new ArrayInitializer(); + out.sourceStart = s; + out.sourceEnd = e; + out.bits = in.bits; + out.implicitConversion = in.implicitConversion; + out.statementEnd = in.statementEnd; + out.expressions = copy; + return out; + } + + return in; + } + /** * You can't share TypeParameter objects or bad things happen; for example, one 'T' resolves differently * from another 'T', even for the same T in a single class file. Unfortunately the TypeParameter type hierarchy @@ -368,6 +510,7 @@ public class EclipseHandlerUtil { } TypeReference typeRef = new ParameterizedQualifiedTypeReference(iRef.tokens, args, iRef.dimensions(), copy(iRef.sourcePositions)); + copyTypeAnns(ref, typeRef); if (source != null) setGeneratedBy(typeRef, source); return typeRef; } @@ -375,6 +518,7 @@ public class EclipseHandlerUtil { if (ref instanceof ArrayQualifiedTypeReference) { ArrayQualifiedTypeReference iRef = (ArrayQualifiedTypeReference) ref; TypeReference typeRef = new ArrayQualifiedTypeReference(iRef.tokens, iRef.dimensions(), copy(iRef.sourcePositions)); + copyTypeAnns(ref, typeRef); if (source != null) setGeneratedBy(typeRef, source); return typeRef; } @@ -382,6 +526,7 @@ public class EclipseHandlerUtil { if (ref instanceof QualifiedTypeReference) { QualifiedTypeReference iRef = (QualifiedTypeReference) ref; TypeReference typeRef = new QualifiedTypeReference(iRef.tokens, copy(iRef.sourcePositions)); + copyTypeAnns(ref, typeRef); if (source != null) setGeneratedBy(typeRef, source); return typeRef; } @@ -398,32 +543,36 @@ public class EclipseHandlerUtil { } } - TypeReference typeRef = new ParameterizedSingleTypeReference(iRef.token, args, iRef.dimensions(), (long)iRef.sourceStart << 32 | iRef.sourceEnd); + TypeReference typeRef = new ParameterizedSingleTypeReference(iRef.token, args, iRef.dimensions(), (long) iRef.sourceStart << 32 | iRef.sourceEnd); + copyTypeAnns(ref, typeRef); if (source != null) setGeneratedBy(typeRef, source); return typeRef; } if (ref instanceof ArrayTypeReference) { ArrayTypeReference iRef = (ArrayTypeReference) ref; - TypeReference typeRef = new ArrayTypeReference(iRef.token, iRef.dimensions(), (long)iRef.sourceStart << 32 | iRef.sourceEnd); + TypeReference typeRef = new ArrayTypeReference(iRef.token, iRef.dimensions(), (long) iRef.sourceStart << 32 | iRef.sourceEnd); + copyTypeAnns(ref, typeRef); if (source != null) setGeneratedBy(typeRef, source); return typeRef; } if (ref instanceof Wildcard) { - Wildcard original = (Wildcard)ref; + Wildcard original = (Wildcard) ref; Wildcard wildcard = new Wildcard(original.kind); wildcard.sourceStart = original.sourceStart; wildcard.sourceEnd = original.sourceEnd; if (original.bound != null) wildcard.bound = copyType(original.bound, source); + copyTypeAnns(ref, wildcard); if (source != null) setGeneratedBy(wildcard, source); return wildcard; } if (ref instanceof SingleTypeReference) { SingleTypeReference iRef = (SingleTypeReference) ref; - TypeReference typeRef = new SingleTypeReference(iRef.token, (long)iRef.sourceStart << 32 | iRef.sourceEnd); + TypeReference typeRef = new SingleTypeReference(iRef.token, (long) iRef.sourceStart << 32 | iRef.sourceEnd); + copyTypeAnns(ref, typeRef); if (source != null) setGeneratedBy(typeRef, source); return typeRef; } @@ -431,6 +580,30 @@ public class EclipseHandlerUtil { return ref; } + private static void copyTypeAnns(TypeReference in, TypeReference out) { + Annotation[][] a; + try { + a = (Annotation[][]) reflect(TYPE_REFERENCE__ANNOTATIONS, in); + } catch (Exception e) { + return; + } + + if (a == null) { + reflectSet(TYPE_REFERENCE__ANNOTATIONS, out, null); + return; + } + + Annotation[][] b = new Annotation[a.length][]; + for (int i = 0; i < a.length; i++) { + b[i] = new Annotation[a[i].length]; + for (int j = 0 ; j < a[i].length; j++) { + b[i][j] = copyAnnotation(a[i][j], a[i][j]); + } + } + + reflectSet(TYPE_REFERENCE__ANNOTATIONS, out, b); + } + public static Annotation[] copyAnnotations(ASTNode source, Annotation[]... allAnnotations) { List result = null; for (Annotation[] annotations : allAnnotations) { @@ -525,7 +698,7 @@ public class EclipseHandlerUtil { public static TypeReference cloneSelfType(EclipseNode context, ASTNode source) { int pS = source == null ? 0 : source.sourceStart, pE = source == null ? 0 : source.sourceEnd; - long p = (long)pS << 32 | pE; + long p = (long) pS << 32 | pE; EclipseNode type = context; TypeReference result = null; while (type != null && type.getKind() != Kind.TYPE) type = type.up(); diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java index 570d1a7e..92c642d4 100644 --- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java +++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java @@ -1583,6 +1583,14 @@ public class JavacHandlerUtil { return node; } + public static List cloneTypes(JavacTreeMaker maker, List in, JCTree source, Context context) { + if (in.isEmpty()) return List.nil(); + if (in.size() == 1) return List.of(cloneType(maker, in.get(0), source, context)); + ListBuffer lb = new ListBuffer(); + for (JCExpression expr : in) lb.append(cloneType(maker, expr, source, context)); + return lb.toList(); + } + /** * Creates a full clone of a given javac AST type node. Every part is cloned (every identifier, every select, every wildcard, every type apply). * diff --git a/test/transform/resource/after-delombok/TypeUseAnnotations.java b/test/transform/resource/after-delombok/TypeUseAnnotations.java new file mode 100644 index 00000000..1e1536bf --- /dev/null +++ b/test/transform/resource/after-delombok/TypeUseAnnotations.java @@ -0,0 +1,14 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@interface TA { + int x(); +} +class TypeUseAnnotations { + List<@TA(x = 5) String> foo; + @java.lang.SuppressWarnings("all") + public List<@TA(x = 5) String> getFoo() { + return this.foo; + } +} diff --git a/test/transform/resource/after-ecj/TypeUseAnnotations.java b/test/transform/resource/after-ecj/TypeUseAnnotations.java new file mode 100644 index 00000000..156643b9 --- /dev/null +++ b/test/transform/resource/after-ecj/TypeUseAnnotations.java @@ -0,0 +1,15 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TA { + int x(); +} +class TypeUseAnnotations { + @lombok.Getter List<@TA(x = 5) String> foo; + TypeUseAnnotations() { + super(); + } + public @java.lang.SuppressWarnings("all") List<@TA(x = 5) String> getFoo() { + return this.foo; + } +} \ No newline at end of file diff --git a/test/transform/resource/before/TypeUseAnnotations.java b/test/transform/resource/before/TypeUseAnnotations.java new file mode 100644 index 00000000..c09a291d --- /dev/null +++ b/test/transform/resource/before/TypeUseAnnotations.java @@ -0,0 +1,11 @@ +//version 8: +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@interface TA { + int x(); +} +class TypeUseAnnotations { + @lombok.Getter List<@TA(x=5) String> foo; +} -- cgit From b60541526c7047aff0f4b2a1aac37804913c61de Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 4 Sep 2018 01:59:22 +0200 Subject: running the edge-release task also sets the git tag now. --- buildScripts/website.ant.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/buildScripts/website.ant.xml b/buildScripts/website.ant.xml index 5c996fc6..ddcb2219 100644 --- a/buildScripts/website.ant.xml +++ b/buildScripts/website.ant.xml @@ -209,6 +209,16 @@ such as applying the templates to produce the website, converting the changelog username="${ssh.username}" keyfile="${ssh.keyfile}" knownHosts="ssh.knownHosts" /> + + + + + + + + + + -- cgit From 3c6513073b4aa89fc5ae2fa52528de79d07d33a6 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Mon, 10 Sep 2018 22:20:41 +0200 Subject: create edge-SNAPSHOT maven artifacts --- build.xml | 32 ++++++++++++++++---------------- doc/maven-pom.xml | 13 ++++--------- jitpack.yml | 5 ----- 3 files changed, 20 insertions(+), 30 deletions(-) delete mode 100644 jitpack.yml diff --git a/build.xml b/build.xml index 2c3188da..a33b31e3 100644 --- a/build.xml +++ b/build.xml @@ -374,30 +374,25 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating - - - - - 4.0.0 - org.projectlombok - lombok - ]]>${lombok.version}-SNAPSHOT -]]> + + - + - + + + - - - + + + @@ -835,7 +830,7 @@ You can also create your own by writing a 'testenvironment.properties' file. The - + @@ -850,13 +845,18 @@ You can also create your own by writing a 'testenvironment.properties' file. The + + - + + + + diff --git a/doc/maven-pom.xml b/doc/maven-pom.xml index baba7ca6..99643f64 100644 --- a/doc/maven-pom.xml +++ b/doc/maven-pom.xml @@ -21,8 +21,8 @@ http://github.com/rzwitserloot/lombok - Google Code - http://code.google.com/p/projectlombok/issues + GitHub Issues + https://github.com/rzwitserloot/lombok/issues @@ -30,18 +30,13 @@ Reinier Zwitserloot reinier@projectlombok.org http://zwitserloot.com - +1 + Europe/Amsterdam rspilker Roel Spilker roel@projectlombok.org - +1 - - - rgrootjans - Robbert Jan Grootjans - +1 + Europe/Amsterdam diff --git a/jitpack.yml b/jitpack.yml deleted file mode 100644 index b8c08047..00000000 --- a/jitpack.yml +++ /dev/null @@ -1,5 +0,0 @@ -jdk: -- openjdk10 -install: -- echo "Running a custom install command" -- ant install-maven \ No newline at end of file -- cgit From 8c28302705a027646c0ee0a83379b4084cb475ba Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 10 Sep 2018 22:23:42 +0200 Subject: Upgraded our objectweb ASM dep and moved API level up to 6, to avoid a ‘this feature requires ASM5’ error that occurs when patching recent eclipse releases. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ivy-repo/org.projectlombok-lombok.patcher-0.24.xml | 14 -------------- .../ivy-repo/org.projectlombok-lombok.patcher-0.26.xml | 14 -------------- .../ivy-repo/org.projectlombok-lombok.patcher-0.28.xml | 14 ++++++++++++++ buildScripts/ivy.xml | 2 +- 4 files changed, 15 insertions(+), 29 deletions(-) delete mode 100644 buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.24.xml delete mode 100644 buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.26.xml create mode 100644 buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.28.xml diff --git a/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.24.xml b/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.24.xml deleted file mode 100644 index 87e1594f..00000000 --- a/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.24.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.26.xml b/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.26.xml deleted file mode 100644 index 6525604f..00000000 --- a/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.26.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.28.xml b/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.28.xml new file mode 100644 index 00000000..5ff77341 --- /dev/null +++ b/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.28.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/buildScripts/ivy.xml b/buildScripts/ivy.xml index 4eed2fa6..15c03ed1 100644 --- a/buildScripts/ivy.xml +++ b/buildScripts/ivy.xml @@ -18,7 +18,7 @@ - + -- cgit From 6a42bccb9730b7072b1219a03642074ab96fbe61 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 10 Sep 2018 22:24:06 +0200 Subject: toBuilder() with singular should force the typeargs on the Collections.emptyList call. --- src/core/lombok/eclipse/handlers/HandleBuilder.java | 1 + test/transform/resource/after-ecj/BuilderWithToBuilder.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/lombok/eclipse/handlers/HandleBuilder.java b/src/core/lombok/eclipse/handlers/HandleBuilder.java index 9a069c58..4d20f052 100644 --- a/src/core/lombok/eclipse/handlers/HandleBuilder.java +++ b/src/core/lombok/eclipse/handlers/HandleBuilder.java @@ -541,6 +541,7 @@ public class HandleBuilder extends EclipseAnnotationHandler { MessageSend emptyList = new MessageSend(); emptyList.receiver = generateQualifiedNameRef(source, TypeConstants.JAVA, TypeConstants.UTIL, "Collections".toCharArray()); emptyList.selector = EMPTY_LIST; + emptyList.typeArguments = copyTypes(bfd.singularData.getTypeArgs().toArray(new TypeReference[0])); ms.arguments = new Expression[] {new ConditionalExpression(ifNull, emptyList, tgt[1])}; } ms.receiver = receiver; diff --git a/test/transform/resource/after-ecj/BuilderWithToBuilder.java b/test/transform/resource/after-ecj/BuilderWithToBuilder.java index b9cc27dd..a8935107 100644 --- a/test/transform/resource/after-ecj/BuilderWithToBuilder.java +++ b/test/transform/resource/after-ecj/BuilderWithToBuilder.java @@ -74,7 +74,7 @@ import lombok.Builder; return new BuilderWithToBuilderBuilder(); } public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder toBuilder() { - return new BuilderWithToBuilderBuilder().one(this.mOne).two(this.mTwo).foo(BuilderWithToBuilder.rrr(this)).bars(((this.bars == null) ? java.util.Collections.emptyList() : this.bars)); + return new BuilderWithToBuilderBuilder().one(this.mOne).two(this.mTwo).foo(BuilderWithToBuilder.rrr(this)).bars(((this.bars == null) ? java.util.Collections.emptyList() : this.bars)); } } @lombok.experimental.Accessors(prefix = "m") class ConstructorWithToBuilder { -- cgit From 7319256a37b1ca78d6ff736e3db2caaf59b55e68 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 10 Sep 2018 22:24:42 +0200 Subject: [website] some work on releasing edge and updating git. --- buildScripts/website.ant.xml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/buildScripts/website.ant.xml b/buildScripts/website.ant.xml index ddcb2219..f7a86fd4 100644 --- a/buildScripts/website.ant.xml +++ b/buildScripts/website.ant.xml @@ -209,15 +209,22 @@ such as applying the templates to produce the website, converting the changelog username="${ssh.username}" keyfile="${ssh.keyfile}" knownHosts="ssh.knownHosts" /> + + + + + + - + - + + - - + + -- cgit From db91eb8e9cec2686d3dc0a6e880985e070fc9430 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 10 Sep 2018 22:42:08 +0200 Subject: Fully integrating ‘ant edge-release’ to include updating the site, our mavenrepo on projectlombok.org, and the branch on git. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.xml | 72 +++++++++++++++++++++++--------------------- buildScripts/website.ant.xml | 4 ++- 2 files changed, 40 insertions(+), 36 deletions(-) diff --git a/build.xml b/build.xml index a33b31e3..02c1e343 100644 --- a/build.xml +++ b/build.xml @@ -32,7 +32,6 @@ the common tasks and can be called on to run the main aspects of all the sub-scr - @@ -368,38 +367,6 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -929,7 +896,7 @@ You can also create your own by writing a 'testenvironment.properties' file. The - @@ -991,7 +958,42 @@ You can also create your own by writing a 'testenvironment.properties' file. The - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/buildScripts/website.ant.xml b/buildScripts/website.ant.xml index f7a86fd4..a799e7fe 100644 --- a/buildScripts/website.ant.xml +++ b/buildScripts/website.ant.xml @@ -185,9 +185,11 @@ such as applying the templates to produce the website, converting the changelog - + + + -- cgit From 0c23659103c169bf42837801f961f47bf272060f Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 10 Sep 2018 22:54:22 +0200 Subject: [trivial] --- build.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/build.xml b/build.xml index 02c1e343..5c939f55 100644 --- a/build.xml +++ b/build.xml @@ -891,6 +891,7 @@ You can also create your own by writing a 'testenvironment.properties' file. The username="${ssh.username}" keyfile="${ssh.keyfile}" knownHosts="ssh.knownHosts" /> + WARNING: You should now immediately run an edge release! Date: Mon, 10 Sep 2018 23:07:15 +0200 Subject: update website documentation --- website/resources/files/pom.xml | 78 ----------------------------------- website/templates/_download-edge.html | 34 ++++++++++++++- website/templates/setup/gradle.html | 4 +- 3 files changed, 35 insertions(+), 81 deletions(-) delete mode 100644 website/resources/files/pom.xml diff --git a/website/resources/files/pom.xml b/website/resources/files/pom.xml deleted file mode 100644 index 6562afe8..00000000 --- a/website/resources/files/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - 4.0.0 - - org.projectlombok - eclipse-compiler-test - 1.0-SNAPSHOT - - - UTF-8 - 1.16.8 - - - - - org.projectlombok - lombok - ${lombok.version} - provided - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.5.1 - - eclipse - 1.8 - 1.8 - - - - org.codehaus.plexus - plexus-compiler-eclipse - 2.7 - - - org.projectlombok - lombok - ${lombok.version} - - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.10 - - - get-lombok - - copy - - - - - org.projectlombok - lombok - ${lombok.version} - jar - ${project.build.directory} - lombok.jar - - - - - - - - - - diff --git a/website/templates/_download-edge.html b/website/templates/_download-edge.html index c1520780..0e04596c 100644 --- a/website/templates/_download-edge.html +++ b/website/templates/_download-edge.html @@ -10,7 +10,39 @@

Download edge release now!

- You can use the edge release also from your build tool using the JitPack repository. + You can use the edge release from maven using the projectlombok.org repository:

+<repositories>
+	<repository>
+		<id>projectlombok.org</id>
+		<url>https://projectlombok.org/edge-releases</url>
+	</repository>
+</repositories>
+
+<dependencies>
+	<dependency>
+		<groupId>org.projectlombok</groupId>
+		<artifactId>lombok</artifactId>
+		<version>edge-SNAPSHOT</version>
+		<scope>provided</scope>
+	</dependency>
+</dependencies>
+

+

+ You can use the edge release from gradle using the projectlombok.org repository:

+repositories {
+	mavenCentral()
+	maven { url 'https://projectlombok.org/edge-releases' }
+}
+
+plugins {
+	id 'net.ltgt.apt' version '0.10'
+}
+
+dependencies {
+	compileOnly 'org.projectlombok:lombok:edge-SNAPSHOT'
+	
+	apt 'org.projectlombok:lombok:edge-SNAPSHOT'
+}

diff --git a/website/templates/setup/gradle.html b/website/templates/setup/gradle.html index 41d90dcc..b3c7de3a 100644 --- a/website/templates/setup/gradle.html +++ b/website/templates/setup/gradle.html @@ -29,13 +29,13 @@ repositories { } plugins { - id 'net.ltgt.apt' version '0.10' + id 'net.ltgt.apt' version '0.10' } dependencies { compileOnly 'org.projectlombok:lombok:${version}' - apt "org.projectlombok:lombok:${version}" + apt 'org.projectlombok:lombok:${version}' }

Remember that you still have to download lombok.jar (or find it in gradle's caches) and run it as a jarfile, if you wish to program in eclipse. The plugin makes that part easier. -- cgit From da7c7720a68d05713d641e701114bbf474296d40 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Mon, 10 Sep 2018 23:27:42 +0200 Subject: update changelog --- doc/changelog.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog.markdown b/doc/changelog.markdown index ad39475f..04c9a052 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -2,6 +2,7 @@ Lombok Changelog ---------------- ### v1.18.3 "Edgy Guinea Pig" +* PLATFORM: Support for Eclipse Photon. [Issue #1831](https://github.com/rzwitserloot/lombok/issues/1831) * FEATURE: The `@FieldNameConstants` feature has been completely redesigned. [Issue #1774](https://github.com/rzwitserloot/lombok/issues/1774) [FieldNameConstants documentation](https://projectlombok.org/features/experimental/FieldNameConstants) * BUGFIX: When using lombok to compile modularized (`module-info.java`-style) code, if the module name has dots in it, it wouldn't work. [Issue #1808](https://github.com/rzwitserloot/lombok/issues/1808) * BUGFIX: Errors about lombok not reading a module providing `org.mapstruct.ap.spi` when trying to use lombok in jigsaw-mode on JDK 11. [Issue #1806](https://github.com/rzwitserloot/lombok/issues/1806) -- cgit From f3881e51dada4fcc9f01174821427b9a14a60b4a Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Tue, 11 Sep 2018 00:45:24 +0200 Subject: layout delombok page --- website/templates/features/delombok.html | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/website/templates/features/delombok.html b/website/templates/features/delombok.html index 6f41fc46..56b02f7d 100644 --- a/website/templates/features/delombok.html +++ b/website/templates/features/delombok.html @@ -17,22 +17,19 @@

Delombok is included in lombok.jar. To use it, all you need to run on the command line is: -

-
java -jar lombok.jar delombok src -d src-delomboked
-

+
java -jar lombok.jar delombok src -d src-delomboked
+
Which will duplicate the contents of the src directory into the src-delomboked directory, which will be created if it doesn't already exist, but delomboked of course. Delombok on the command line has a few more options; use the --help parameter to see more options.

To let delombok print the transformation result of a single java file directly to standard output, you can use: -

-
java -jar lombok.jar delombok -p MyJavaFile.java
-
+
java -jar lombok.jar delombok -p MyJavaFile.java

<@f.main.h3 title="Running delombok in ant" />

lombok.jar includes an ant task which can apply delombok for you. For example, to create javadoc for your project, your build.xml file would look something like: -

<target name="javadoc">
+			
<target name="javadoc">
 <taskdef classname="lombok.delombok.ant.Tasks$Delombok" classpath="lib/lombok.jar" name="delombok" />
 <mkdir dir="build/src-delomboked" />
 <delombok verbose="true" encoding="UTF-8" to="build/src-delomboked" from="src">
@@ -41,7 +38,7 @@
 <mkdir dir="build/api" />
 <javadoc sourcepath="build/src-delomboked" defaultexcludes="yes" destdir="build/api" />
 </target>
-

+
Instead of a from attribute, you can also nest <fileset> nodes.

-- cgit From 910f3611afafcdff5babb7b9159f32ad01dfafef Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Tue, 11 Sep 2018 01:27:47 +0200 Subject: website 404 on image load --- website/resources/js/supporters.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/resources/js/supporters.js b/website/resources/js/supporters.js index 58db28cc..62beca81 100644 --- a/website/resources/js/supporters.js +++ b/website/resources/js/supporters.js @@ -77,7 +77,7 @@ ji.attr("title", n.text()); a.prepend(ji); }; - i.src = 'files/' + this.logo; + i.src = '/files/' + this.logo; } return d; } @@ -132,6 +132,7 @@ var supPerBar = 4; function updateSupporterBar() { var s = $(".supporterBar"); + if (s.length === 0) return; s.find(".introText").show(); s.append($("
").addClass("sbCnt")); var sf = s.find(".supporterFooter").show(); -- cgit From 2027ffc49f194da2892938e0cd5868cd286a06f6 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 11 Sep 2018 01:59:09 +0200 Subject: [website] force-align pre blocks to the left --- website/resources/css/custom.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/resources/css/custom.css b/website/resources/css/custom.css index f81a3dd9..995f298a 100644 --- a/website/resources/css/custom.css +++ b/website/resources/css/custom.css @@ -7,6 +7,10 @@ margin-bottom: 40px; } +pre { + text-align: left; +} + .buttonLike { cursor: pointer; background: -webkit-linear-gradient(top, #FFFEF7, #CFCEC7); -- cgit