diff options
49 files changed, 1106 insertions, 286 deletions
@@ -19,4 +19,5 @@ /junit*.properties /eclipse.location /.apt_generated/ -/out
\ No newline at end of file +/out +/website/lombokSupporters @@ -28,8 +28,19 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <property name="build.compiler" value="javac1.6" /> <property name="ivy.retrieve.pattern" value="lib/[conf]/[organisation]-[artifact].[ext]" /> <available file="lib/ivyplusplus.jar" property="ivyplusplus.available" /> - <available file="lib/openJDK6Environment/rt-openjdk6.jar" property="rt-openjdk6.available" /> - + <property name="rt-openjdk6" location="lib/openJDk6Environment/rt-openjdk6.jar" /> + <property name="rt-openjdk8" location="lib/openJDk8Environment/rt-openjdk8.jar" /> + <property name="openjdk6.md5" value="de953d5062b7183fbf3fa9f5d623e2e7" /> + <property name="openjdk8.md5" value="8099e5d7aa182374d299d03f5003a27f" /> + <checksum file="${rt-openjdk6}" property="${openjdk6.md5}" verifyProperty="rt-openjdk6.checksumOk" /> + <checksum file="${rt-openjdk8}" property="${openjdk8.md5}" verifyProperty="rt-openjdk8.checksumOk" /> + <condition property="rt-openjdk6.available"> + <equals arg1="${rt-openjdk6.checksumOk}" arg2="true" /> + </condition> + <condition property="rt-openjdk8.available"> + <equals arg1="${rt-openjdk8.checksumOk}" arg2="true" /> + </condition> + <path id="build.path"> <fileset dir="lib/build"> <include name="*.jar" /> @@ -98,12 +109,17 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <ivy:retrieve /> </target> - <target name="ensureOpenJdk7Rt" unless="rt-openjdk6.available"> + <target name="ensureOpenJdk6Rt" unless="rt-openjdk6.available"> <mkdir dir="lib/openJDK6Environment" /> - <get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk6.jar" dest="lib/openJDK6Environment/rt-openjdk6.jar" verbose="true" usetimestamp="true" /> + <get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk6.jar" dest="${rt-openjdk6}" verbose="true" usetimestamp="true" /> </target> - <target name="ensureBuildDeps" depends="config-ivy,ensureOpenJdk7Rt"> + <target name="ensureOpenJdk8Rt" unless="rt-openjdk8.available"> + <mkdir dir="lib/openJDK8Environment" /> + <get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk8.jar" dest="${rt-openjdk8}" verbose="true" usetimestamp="true" /> + </target> + + <target name="ensureBuildDeps" depends="config-ivy,ensureOpenJdk6Rt"> <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="build, javac7" /> <ivy:retrieve /> </target> @@ -118,9 +134,15 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <ivy:retrieve /> </target> - <target name="version" depends="ensure-ipp" description="Shows the version number." unless="lombok.version"> + <target name="ensureSupportersDeps" depends="config-ivy"> + <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="supporters" /> + <ivy:retrieve /> + </target> + + <target name="version" depends="ensure-ipp, ensureOpenJdk8Rt" description="Shows the version number." unless="lombok.version"> <mkdir dir="build/lombok" /> <ivy:compile destdir="build/lombok" source="1.5" target="1.5" ecj="true" nowarn="true"> + <bootclasspath path="${rt-openjdk8}" /> <src path="src/core" /> <include name="lombok/core/Version.java" /> </ivy:compile> @@ -155,10 +177,12 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <delete file="build/lombok/META-INF/services/javax.annotation.processing.Processor" quiet="true" /> <delete file="build/lombok/META-INF/services/org.mapstruct.ap.spi.AstModifyingAnnotationProcessor" quiet="true" /> <ivy:compile destdir="build/stubsstubs" source="1.5" target="1.5" ecj="true" nowarn="true"> + <bootclasspath path="${rt-openjdk8}" /> <src path="src/stubsstubs" /> <classpath location="build/stubsstubs" /> </ivy:compile> <ivy:compile destdir="build/stubs" source="1.5" target="1.5" ecj="true" nowarn="true"> + <bootclasspath path="${rt-openjdk8}" /> <src path="src/stubs" /> <src path="src/javac-only-stubs" /> <classpath location="build/stubsstubs" /> @@ -167,6 +191,7 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <ivy:compile destdir="build/lombok-utils" source="1.5" target="1.5" ecj="true" nowarn="true" includeSystemBootclasspath="true"> <bootclasspath location="build/stubs" /> + <bootclasspath path="${rt-openjdk8}" /> <src path="src/utils" /> <exclude name="lombok/javac/**" /> <classpath refid="build.path" /> @@ -199,16 +224,19 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <ivy:compile destdir="build/lombok" source="1.4" target="1.4" ecj="true" nowarn="true" includeSystemBootclasspath="true"> <bootclasspath location="build/stubs" /> + <bootclasspath path="${rt-openjdk8}" /> <src path="build/transformedSources" /> </ivy:compile> <ivy:compile destdir="build/lombok/Class50" source="1.4" target="1.6" ecj="true" nowarn="true" includeSystemBootclasspath="true"> <bootclasspath location="build/stubs" /> + <bootclasspath path="${rt-openjdk8}" /> <src path="build/transformedSources" /> </ivy:compile> <ivy:compile destdir="build/lombok" source="1.5" target="1.5" ecj="true" nowarn="true" includeSystemBootclasspath="true"> <bootclasspath location="build/stubs" /> + <bootclasspath path="${rt-openjdk8}" /> <src path="src/launch" /> <src path="src/core" /> <src path="src/installer" /> @@ -230,6 +258,7 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <ivy:compile destdir="build/lombok/Class50" source="1.5" target="1.6" ecj="true" nowarn="true" includeSystemBootclasspath="true"> <bootclasspath location="build/stubs" /> + <bootclasspath path="${rt-openjdk8}" /> <src path="src/eclipseAgent" /> <include name="lombok/launch/PatchFixesHider.java" /> <classpath location="build/lombok" /> @@ -503,6 +532,7 @@ ${sourceWarning}</echo> <target name="-test-compile" depends="ensureTestDeps, compile" unless="skipTests"> <mkdir dir="build/tests" /> <ivy:compile destdir="build/tests" source="1.5" target="1.5" ecj="true" nowarn="true"> + <bootclasspath path="${rt-openjdk8}" /> <classpath refid="test.path" /> <classpath refid="build.path" /> <classpath path="build/lombok" /> @@ -889,7 +919,17 @@ You can also create your own by writing a 'testenvironment.properties' file. The </ant> </target> - <target name="website-only-publish" depends="config-ssh, clean, version" + <target name="website-supporters" depends="ensureSupportersDeps, website-only" description="Updates the supporters repo and adds it to the website build."> + <ant antfile="buildScripts/supporters.ant.xml" target="deployToWebsiteBuild" inheritAll="false" /> + </target> + + <target name="website-supporters-fast" depends="website-only" description="Updates the supporters repo and adds it to the website build."> + <ant antfile="buildScripts/supporters.ant.xml" target="deployToWebsiteBuild" inheritAll="false"> + <property name="noUpdateRepo" value="true" /> + </ant> + </target> + + <target name="website-only-publish" depends="config-ssh, clean, ensureSupportersDeps" description="Prepares the website (using lombok version current 'live') for distribution and then publishes it to projectlombok.org."> <ant antfile="buildScripts/website.ant.xml" target="website-only-publish" inheritAll="false"> <property name="ssh.username" value="${ssh.username}" /> @@ -897,7 +937,7 @@ You can also create your own by writing a 'testenvironment.properties' file. The </ant> </target> - <target name="website-publish" depends="config-ssh, clean, version" + <target name="website-publish" depends="config-ssh, clean, version, ensureSupportersDeps" description="Prepares the website for distribution and then publishes it to projectlombok.org."> <ant antfile="buildScripts/website.ant.xml" target="website-publish" inheritAll="false"> <property name="lombok.version" value="${lombok.version}" /> diff --git a/buildScripts/ivy.xml b/buildScripts/ivy.xml index 81f50f4c..a27c909e 100644 --- a/buildScripts/ivy.xml +++ b/buildScripts/ivy.xml @@ -14,6 +14,7 @@ <conf name="ecj9" /> <conf name="javac6" /> <conf name="javac7" /> + <conf name="supporters" /> </configurations> <dependencies> <dependency org="org.projectlombok" name="lombok.patcher" rev="0.24" conf="buildBase->default; runtime->default" /> @@ -22,10 +23,10 @@ <dependency org="junit" name="junit" rev="4.8.2" conf="test->default; contrib->sources" /> <dependency org="log4j" name="log4j" rev="1.2.16" conf="test->default; contrib->sources" /> <dependency org="org.apache.logging.log4j" name="log4j-api" rev="2.0-beta4" conf="test->default; contrib->sources" /> - <dependency org="commons-logging" name="commons-logging" rev="1.1.1" conf="test->default; contrib->sources"/> - <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1" conf="test->default; contrib->sources"/> - <dependency org="org.slf4j" name="slf4j-ext" rev="1.6.1" conf="test->default; contrib->sources"/> - <dependency org="org.jboss.logging" name="jboss-logging" rev="3.3.0.Final" conf="test->default; contrib->sources"/> + <dependency org="commons-logging" name="commons-logging" rev="1.1.1" conf="test->default; contrib->sources" /> + <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1" conf="test->default; contrib->sources" /> + <dependency org="org.slf4j" name="slf4j-ext" rev="1.6.1" conf="test->default; contrib->sources" /> + <dependency org="org.jboss.logging" name="jboss-logging" rev="3.3.0.Final" conf="test->default; contrib->sources" /> <dependency org="com.google.guava" name="guava" rev="18.0" conf="test->default; contrib->sources" /> <dependency org="com.google.code.findbugs" name="findbugs" rev="3.0.0" conf="test->master" /> @@ -56,5 +57,11 @@ <dependency org="org.eclipse.custom" name="osgi" rev="3.9.0" conf="eclipseBuild->default; contrib->sources" /> <dependency org="org.eclipse.custom" name="core.resources" rev="3.8.100" conf="eclipseBuild->default; contrib->sources" /> <dependency org="org.eclipse.custom" name="core.jobs" rev="3.5.300" conf="eclipseBuild->default; contrib->sources" /> + + <dependency org="org.eclipse.jgit" name="org.eclipse.jgit.ant" rev="4.11.0.201803080745-r" conf="supporters->default" /> + <dependency org="org.eclipse.jgit" name="org.eclipse.jgit" rev="4.11.0.201803080745-r" conf="supporters->default" /> + <dependency org="com.jcraft" name="jsch" rev="0.1.54" conf="supporters->default" /> + <dependency org="com.rimerosolutions.ant" name="ant-git-tasks" rev="1.3.2" conf="supporters->default" /> + <dependency org="org.slf4j" name="slf4j-simple" rev="1.6.1" conf="supporters->default" /> </dependencies> </ivy-module> diff --git a/buildScripts/supporters.ant.xml b/buildScripts/supporters.ant.xml new file mode 100644 index 00000000..d1d3fedc --- /dev/null +++ b/buildScripts/supporters.ant.xml @@ -0,0 +1,57 @@ +<!-- + Copyright (C) 2010-2017 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. +--> +<project name="lombok-supporters" default="updateRepo" basedir=".." xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" xmlns:git="antlib:com.rimerosolutions.ant.git"> + <description> +This buildfile is part of projectlombok.org. It is responsible for updating/maintaining the separate git repository +containing the status of lombok's supporters. + </description> + + <path id="supporters.path"> + <fileset dir="lib/supporters"> + <include name="*.jar" /> + </fileset> + </path> + + <taskdef uri="antlib:com.rimerosolutions.ant.git" resource="com/rimerosolutions/ant/git/jgit-ant-lib.xml" classpathref="supporters.path" /> + + <target name="checkIfRepoExists"> + <available file="website/lombokSupporters/.git/HEAD" property="supportersrepo.exists" /> + </target> + + <target name="initRepo" depends="checkIfRepoExists" unless="supportersrepo.exists"> + <git:git directory="website/lombokSupporters"> + <git:clone uri="escudo2:/data/git/lombokSupporters.git" /> + </git:git> + </target> + + <target name="updateRepo" depends="initRepo" unless="noUpdateRepo"> + <git:git directory="website/lombokSupporters"> + <git:pull /> + </git:git> + </target> + + <target name="deployToWebsiteBuild" depends="updateRepo"> + <copy todir="build/website/files" overwrite="true" failonerror="false" quiet="true"> + <fileset dir="website/lombokSupporters" /> + </copy> + </target> +</project> diff --git a/buildScripts/website.ant.xml b/buildScripts/website.ant.xml index 15a0f95f..5c996fc6 100644 --- a/buildScripts/website.ant.xml +++ b/buildScripts/website.ant.xml @@ -37,13 +37,17 @@ such as applying the templates to produce the website, converting the changelog <delete dir="build/website" quiet="true" /> </target> - <target name="website-only" description="Prepares the website for distribution using the lombok version currently 'live'." depends="-fetch-version-from-site, -show-version, -ensure-version, -website-main, -delete-edge-page, -website-only-dist" /> + <target name="website-only" description="Prepares the website for distribution using the lombok version currently 'live'." depends="-fetch-version-from-site, -show-version, -ensure-version, -website-main, -delete-edge-page" /> <target name="-delete-edge-page"> <delete file="build/website/download-edge.html" /> </target> - <target name="website" description="Prepares the website for distribution" depends="javadoc, -website-main, -website-dist" /> + <target name="website" description="Prepares the website for distribution" depends="javadoc, -website-main" /> + + <target name="website-supporters" description="Updates website supporters store and adds it to the website build."> + <ant antfile="buildScripts/supporters.ant.xml" target="deployToWebsiteBuild" inheritAll="false" /> + </target> <target name="-fetch-version-from-site" depends="-compile-webclasses"> <fail if="lombok.version">lombok.version already set.</fail> @@ -134,8 +138,8 @@ such as applying the templates to produce the website, converting the changelog </tar> </target> - <target name="website-publish" depends="website, -send-site-to-remote" /> - <target name="website-only-publish" depends="website-only, -send-site-to-remote" /> + <target name="website-publish" depends="website, website-supporters, -website-dist, -send-site-to-remote" /> + <target name="website-only-publish" depends="website-only, website-supporters, -website-only-dist, -send-site-to-remote" /> <target name="-send-site-to-remote" depends="-requires-ssh"> <ivy:scpUpload from="dist/website.tar.bz2" diff --git a/docker/provision/ant/ant-1.10.1.sh b/docker/provision/ant/ant-1.10.1.sh index 3de7f3d0..3de7f3d0 100644..100755 --- a/docker/provision/ant/ant-1.10.1.sh +++ b/docker/provision/ant/ant-1.10.1.sh diff --git a/docker/provision/gradle/gradle-4.2.1.sh b/docker/provision/gradle/gradle-4.2.1.sh index 8c300f11..8c300f11 100644..100755 --- a/docker/provision/gradle/gradle-4.2.1.sh +++ b/docker/provision/gradle/gradle-4.2.1.sh diff --git a/docker/provision/jdk/java-10.sh b/docker/provision/jdk/java-10.sh new file mode 100755 index 00000000..ecdafc8b --- /dev/null +++ b/docker/provision/jdk/java-10.sh @@ -0,0 +1,4 @@ +apt-get update && apt-get install -y wget +wget https://download.java.net/java/jdk10/archive/44/GPL/openjdk-10+44_linux-x64_bin.tar.gz -O jdk.tar.gz +tar -xzf jdk.tar.gz -C /opt/ +mv /opt/jdk-10 /opt/jdk diff --git a/docker/provision/jdk/java-8.sh b/docker/provision/jdk/java-8.sh index 44795c6c..44795c6c 100644..100755 --- a/docker/provision/jdk/java-8.sh +++ b/docker/provision/jdk/java-8.sh diff --git a/docker/provision/jdk/java-9.sh b/docker/provision/jdk/java-9.sh index 2023ae39..fd488dc8 100644..100755 --- a/docker/provision/jdk/java-9.sh +++ b/docker/provision/jdk/java-9.sh @@ -1,4 +1,4 @@ apt-get update && apt-get install -y wget -wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.tar.gz -O jdk.tar.gz +wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/9.0.4+11/c2514751926b4512b076cc82f959763f/jdk-9.0.4_linux-x64_bin.tar.gz -O jdk.tar.gz tar -xzf jdk.tar.gz -C /opt/ -mv /opt/jdk-9.0.1 /opt/jdk +mv /opt/jdk-9.0.4 /opt/jdk diff --git a/docker/provision/maven/maven-3.5.0.sh b/docker/provision/maven/maven-3.5.0.sh index 3167a964..3167a964 100644..100755 --- a/docker/provision/maven/maven-3.5.0.sh +++ b/docker/provision/maven/maven-3.5.0.sh diff --git a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java index 0d0f51db..75339f7c 100644 --- a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java +++ b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java @@ -475,47 +475,62 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH public TypeReference createTypeReference(EclipseNode type, long p, ASTNode source, boolean addWildcards) { int pS = source.sourceStart; int pE = source.sourceEnd; List<String> list = new ArrayList<String>(); + List<Integer> genericsCount = addWildcards ? new ArrayList<Integer>() : null; + list.add(type.getName()); + if (addWildcards) genericsCount.add(arraySizeOf(((TypeDeclaration) type.get()).typeParameters)); + boolean staticContext = (((TypeDeclaration) type.get()).modifiers & Modifier.STATIC) != 0; EclipseNode tNode = type.up(); + while (tNode != null && tNode.getKind() == Kind.TYPE) { list.add(tNode.getName()); + if (addWildcards) genericsCount.add(staticContext ? 0 : arraySizeOf(((TypeDeclaration) tNode.get()).typeParameters)); + if (!staticContext) staticContext = (((TypeDeclaration) tNode.get()).modifiers & Modifier.STATIC) != 0; tNode = tNode.up(); } Collections.reverse(list); - - TypeDeclaration typeDecl = (TypeDeclaration) type.get(); - int typeParamCount = typeDecl.typeParameters == null ? 0 : typeDecl.typeParameters.length; - if (typeParamCount == 0) addWildcards = false; - TypeReference[] typeArgs = null; - if (addWildcards) { - typeArgs = new TypeReference[typeParamCount]; - for (int i = 0; i < typeParamCount; i++) { - typeArgs[i] = new Wildcard(Wildcard.UNBOUND); - typeArgs[i].sourceStart = pS; typeArgs[i].sourceEnd = pE; - setGeneratedBy(typeArgs[i], source); - } - } + if (addWildcards) Collections.reverse(genericsCount); if (list.size() == 1) { - if (addWildcards) { - return new ParameterizedSingleTypeReference(list.get(0).toCharArray(), typeArgs, 0, p); - } else { + if (!addWildcards || genericsCount.get(0) == 0) { return new SingleTypeReference(list.get(0).toCharArray(), p); + } else { + return new ParameterizedSingleTypeReference(list.get(0).toCharArray(), wildcardify(pS, pE, source, genericsCount.get(0)), 0, p); } } + + if (addWildcards) { + addWildcards = false; + for (int i : genericsCount) if (i > 0) addWildcards = true; + } + long[] ps = new long[list.size()]; char[][] tokens = new char[list.size()][]; for (int i = 0; i < list.size(); i++) { ps[i] = p; tokens[i] = list.get(i).toCharArray(); } - if (addWildcards) { - TypeReference[][] typeArgs2 = new TypeReference[tokens.length][]; - typeArgs2[typeArgs2.length - 1] = typeArgs; - return new ParameterizedQualifiedTypeReference(tokens, typeArgs2, 0, ps); - } else { - return new QualifiedTypeReference(tokens, ps); + + if (!addWildcards) return new QualifiedTypeReference(tokens, ps); + TypeReference[][] typeArgs2 = new TypeReference[tokens.length][]; + for (int i = 0; i < tokens.length; i++) typeArgs2[i] = wildcardify(pS, pE, source, genericsCount.get(i)); + return new ParameterizedQualifiedTypeReference(tokens, typeArgs2, 0, ps); + } + + private TypeReference[] wildcardify(int pS, int pE, ASTNode source, int count) { + if (count == 0) return null; + TypeReference[] typeArgs = new TypeReference[count]; + for (int i = 0; i < count; i++) { + typeArgs[i] = new Wildcard(Wildcard.UNBOUND); + typeArgs[i].sourceStart = pS; typeArgs[i].sourceEnd = pE; + setGeneratedBy(typeArgs[i], source); } + + return typeArgs; + } + + private int arraySizeOf(Object[] arr) { + return arr == null ? 0 : arr.length; } public MethodDeclaration createEquals(EclipseNode type, Collection<EclipseNode> fields, boolean callSuper, ASTNode source, FieldAccess fieldAccess, boolean needsCanEqual, List<Annotation> onParam) { @@ -683,7 +698,7 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH } else /* objects */ { /* final java.lang.Object this$fieldName = this.fieldName; */ /* final java.lang.Object other$fieldName = other.fieldName; */ - /* if (this$fieldName == null ? other$fieldName != null : !this$fieldName.equals(other$fieldName)) return false;; */ + /* if (this$fieldName == null ? other$fieldName != null : !this$fieldName.equals(other$fieldName)) return false; */ char[] thisDollarFieldName = ("this$" + field.getName()).toCharArray(); char[] otherDollarFieldName = ("other$" + field.getName()).toCharArray(); diff --git a/src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java b/src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java index b42761f4..89964914 100644 --- a/src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java +++ b/src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java @@ -369,11 +369,6 @@ public final class SetGeneratedByVisitor extends ASTVisitor { return super.visit(node, scope); } - @Override public boolean visit(ArrayInitializer node, ClassScope scope) { - fixPositions(setGeneratedBy(node, source)); - return super.visit(node, scope); - } - @Override public boolean visit(ArrayQualifiedTypeReference node, BlockScope scope) { fixPositions(setGeneratedBy(node, source)); return super.visit(node, scope); diff --git a/src/core/lombok/javac/apt/LombokFileObjects.java b/src/core/lombok/javac/apt/LombokFileObjects.java index 7184629f..aba10540 100644 --- a/src/core/lombok/javac/apt/LombokFileObjects.java +++ b/src/core/lombok/javac/apt/LombokFileObjects.java @@ -106,7 +106,8 @@ final class LombokFileObjects { "com.google.devtools.build.buildjar.javac.BlazeJavacMain$ClassloaderMaskingFileManager", "com.google.devtools.build.java.turbine.javac.JavacTurbineCompiler$ClassloaderMaskingFileManager", "org.netbeans.modules.java.source.parsing.ProxyFileManager", - "com.sun.tools.javac.api.ClientCodeWrapper$WrappedStandardJavaFileManager" + "com.sun.tools.javac.api.ClientCodeWrapper$WrappedStandardJavaFileManager", + "com.sun.tools.javac.main.DelegatingJavaFileManager$DelegatingSJFM" // IntelliJ + JDK10 ); static Compiler getCompiler(JavaFileManager jfm) { @@ -130,6 +131,10 @@ final class LombokFileObjects { catch (Throwable e) {} } try { + if (Class.forName("com.sun.tools.javac.file.PathFileObject") == null) throw new NullPointerException(); + return new Java9Compiler(jfm); + } catch (Throwable e) {} + try { if (Class.forName("com.sun.tools.javac.file.BaseFileObject") == null) throw new NullPointerException(); return Compiler.JAVAC7; } catch (Throwable e) {} diff --git a/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java index da2db909..d8bfd154 100644 --- a/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java +++ b/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java @@ -371,31 +371,44 @@ public class HandleEqualsAndHashCode extends JavacAnnotationHandler<EqualsAndHas public JCExpression createTypeReference(JavacNode type, boolean addWildcards) { java.util.List<String> list = new ArrayList<String>(); + java.util.List<Integer> genericsCount = addWildcards ? new ArrayList<Integer>() : null; + list.add(type.getName()); + if (addWildcards) genericsCount.add(((JCClassDecl) type.get()).typarams.size()); + boolean staticContext = (((JCClassDecl) type.get()).getModifiers().flags & Flags.STATIC) != 0; JavacNode tNode = type.up(); + while (tNode != null && tNode.getKind() == Kind.TYPE) { list.add(tNode.getName()); + if (addWildcards) genericsCount.add(staticContext ? 0 : ((JCClassDecl) tNode.get()).typarams.size()); + if (!staticContext) staticContext = (((JCClassDecl) tNode.get()).getModifiers().flags & Flags.STATIC) != 0; tNode = tNode.up(); } Collections.reverse(list); - JCClassDecl typeDecl = (JCClassDecl) type.get(); + if (addWildcards) Collections.reverse(genericsCount); JavacTreeMaker maker = type.getTreeMaker(); JCExpression chain = maker.Ident(type.toName(list.get(0))); + if (addWildcards) chain = wildcardify(maker, chain, genericsCount.get(0)); for (int i = 1; i < list.size(); i++) { chain = maker.Select(chain, type.toName(list.get(i))); + if (addWildcards) chain = wildcardify(maker, chain, genericsCount.get(i)); } - if (!addWildcards || typeDecl.typarams.length() == 0) return chain; + return chain; + } + + private JCExpression wildcardify(JavacTreeMaker maker, JCExpression expr, int count) { + if (count == 0) return expr; ListBuffer<JCExpression> wildcards = new ListBuffer<JCExpression>(); - for (int i = 0 ; i < typeDecl.typarams.length() ; i++) { + for (int i = 0 ; i < count ; i++) { wildcards.append(maker.Wildcard(maker.TypeBoundKind(BoundKind.UNBOUND), null)); } - return maker.TypeApply(chain, wildcards.toList()); + return maker.TypeApply(expr, wildcards.toList()); } public JCMethodDecl createEquals(JavacNode typeNode, List<JavacNode> fields, boolean callSuper, FieldAccess fieldAccess, boolean needsCanEqual, JCTree source, List<JCAnnotation> onParam) { diff --git a/src/installer/lombok/installer/eclipse/STS4LocationProvider.java b/src/installer/lombok/installer/eclipse/STS4LocationProvider.java new file mode 100644 index 00000000..47a07bdd --- /dev/null +++ b/src/installer/lombok/installer/eclipse/STS4LocationProvider.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.Arrays; +import java.util.Collections; + +import lombok.installer.IdeLocationProvider; + +import org.mangosdk.spi.ProviderFor; + +@ProviderFor(IdeLocationProvider.class) +public class STS4LocationProvider extends EclipseProductLocationProvider { + + private static final EclipseProductDescriptor STS4 = new StandardProductDescriptor("Spring Tools Suite 4", + "SpringToolSuite4", + "sts", + STS4LocationProvider.class.getResource("STS.png"), + Collections.unmodifiableList(Arrays.asList("springsource", "spring-tool-suite")) + ); + + public STS4LocationProvider() { + super(STS4); + } +} diff --git a/test/transform/resource/after-delombok/BuilderChainAndFluent.java b/test/transform/resource/after-delombok/BuilderChainAndFluent.java deleted file mode 100644 index f9833be6..00000000 --- a/test/transform/resource/after-delombok/BuilderChainAndFluent.java +++ /dev/null @@ -1,32 +0,0 @@ -class BuilderChainAndFluent { - private final int yes; - @java.lang.SuppressWarnings("all") - BuilderChainAndFluent(final int yes) { - this.yes = yes; - } - @java.lang.SuppressWarnings("all") - public static class BuilderChainAndFluentBuilder { - @java.lang.SuppressWarnings("all") - private int yes; - @java.lang.SuppressWarnings("all") - BuilderChainAndFluentBuilder() { - } - @java.lang.SuppressWarnings("all") - public void setYes(final int yes) { - this.yes = yes; - } - @java.lang.SuppressWarnings("all") - public BuilderChainAndFluent build() { - return new BuilderChainAndFluent(yes); - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "BuilderChainAndFluent.BuilderChainAndFluentBuilder(yes=" + this.yes + ")"; - } - } - @java.lang.SuppressWarnings("all") - public static BuilderChainAndFluentBuilder builder() { - return new BuilderChainAndFluentBuilder(); - } -} diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithGenericsOnInners.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithGenericsOnInners.java new file mode 100644 index 00000000..501d45a1 --- /dev/null +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithGenericsOnInners.java @@ -0,0 +1,28 @@ +public class EqualsAndHashCodeWithGenericsOnInners<A> { + class Inner<B> { + int x; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCodeWithGenericsOnInners.Inner)) return false; + final EqualsAndHashCodeWithGenericsOnInners<?>.Inner<?> other = (EqualsAndHashCodeWithGenericsOnInners<?>.Inner<?>) o; + if (!other.canEqual((java.lang.Object) this)) return false; + if (this.x != other.x) return false; + return true; + } + @java.lang.SuppressWarnings("all") + protected boolean canEqual(final java.lang.Object other) { + return other instanceof EqualsAndHashCodeWithGenericsOnInners.Inner; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 59; + int result = 1; + result = result * PRIME + this.x; + return result; + } + } +} + diff --git a/test/transform/resource/after-delombok/ValueExperimental.java b/test/transform/resource/after-delombok/ValueExperimental.java deleted file mode 100644 index 5846a2d8..00000000 --- a/test/transform/resource/after-delombok/ValueExperimental.java +++ /dev/null @@ -1,46 +0,0 @@ -final class ValueExperimental1 { - @java.lang.SuppressWarnings("all") - public ValueExperimental1() { - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public boolean equals(final java.lang.Object o) { - if (o == this) return true; - if (!(o instanceof ValueExperimental1)) return false; - return true; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public int hashCode() { - int result = 1; - return result; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "ValueExperimental1()"; - } -} -final class ValueExperimental2 { - @java.lang.SuppressWarnings("all") - public ValueExperimental2() { - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public boolean equals(final java.lang.Object o) { - if (o == this) return true; - if (!(o instanceof ValueExperimental2)) return false; - return true; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public int hashCode() { - int result = 1; - return result; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "ValueExperimental2()"; - } -} diff --git a/test/transform/resource/after-delombok/ValueExperimentalStarImport.java b/test/transform/resource/after-delombok/ValueExperimentalStarImport.java deleted file mode 100644 index cb755b47..00000000 --- a/test/transform/resource/after-delombok/ValueExperimentalStarImport.java +++ /dev/null @@ -1,25 +0,0 @@ -import lombok.experimental.*; -final class ValueExperimentalStarImport { - @java.lang.SuppressWarnings("all") - public ValueExperimentalStarImport() { - - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public boolean equals(final java.lang.Object o) { - if (o == this) return true; - if (!(o instanceof ValueExperimentalStarImport)) return false; - return true; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public int hashCode() { - int result = 1; - return result; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "ValueExperimentalStarImport()"; - } -} diff --git a/test/transform/resource/after-ecj/BuilderChainAndFluent.java b/test/transform/resource/after-ecj/BuilderChainAndFluent.java deleted file mode 100644 index f789f535..00000000 --- a/test/transform/resource/after-ecj/BuilderChainAndFluent.java +++ /dev/null @@ -1,25 +0,0 @@ -@lombok.experimental.Builder(fluent = false,chain = false) class BuilderChainAndFluent { - public static @java.lang.SuppressWarnings("all") class BuilderChainAndFluentBuilder { - private @java.lang.SuppressWarnings("all") int yes; - @java.lang.SuppressWarnings("all") BuilderChainAndFluentBuilder() { - super(); - } - public @java.lang.SuppressWarnings("all") void setYes(final int yes) { - this.yes = yes; - } - public @java.lang.SuppressWarnings("all") BuilderChainAndFluent build() { - return new BuilderChainAndFluent(yes); - } - public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (("BuilderChainAndFluent.BuilderChainAndFluentBuilder(yes=" + this.yes) + ")"); - } - } - private final int yes; - @java.lang.SuppressWarnings("all") BuilderChainAndFluent(final int yes) { - super(); - this.yes = yes; - } - public static @java.lang.SuppressWarnings("all") BuilderChainAndFluentBuilder builder() { - return new BuilderChainAndFluentBuilder(); - } -} diff --git a/test/transform/resource/after-ecj/BuilderComplex.java b/test/transform/resource/after-ecj/BuilderComplex.java index 8f520ae5..93d70fe9 100644 --- a/test/transform/resource/after-ecj/BuilderComplex.java +++ b/test/transform/resource/after-ecj/BuilderComplex.java @@ -1,5 +1,5 @@ import java.util.List; -import lombok.experimental.Builder; +import lombok.Builder; class BuilderComplex { public static @java.lang.SuppressWarnings("all") class VoidBuilder<T extends Number> { private @java.lang.SuppressWarnings("all") T number; diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeWithGenericsOnInners.java b/test/transform/resource/after-ecj/EqualsAndHashCodeWithGenericsOnInners.java new file mode 100644 index 00000000..164d0f15 --- /dev/null +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeWithGenericsOnInners.java @@ -0,0 +1,32 @@ +public class EqualsAndHashCodeWithGenericsOnInners<A> { + @lombok.EqualsAndHashCode class Inner<B> { + int x; + Inner() { + super(); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof EqualsAndHashCodeWithGenericsOnInners.Inner))) + return false; + final EqualsAndHashCodeWithGenericsOnInners<?>.Inner<?> other = (EqualsAndHashCodeWithGenericsOnInners<?>.Inner<?>) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + if ((this.x != other.x)) + return false; + return true; + } + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + return (other instanceof EqualsAndHashCodeWithGenericsOnInners.Inner); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 59; + int result = 1; + result = ((result * PRIME) + this.x); + return result; + } + } + public EqualsAndHashCodeWithGenericsOnInners() { + super(); + } +} diff --git a/test/transform/resource/after-ecj/ValueExperimental.java b/test/transform/resource/after-ecj/ValueExperimental.java deleted file mode 100644 index dd13574a..00000000 --- a/test/transform/resource/after-ecj/ValueExperimental.java +++ /dev/null @@ -1,39 +0,0 @@ -import lombok.experimental.Value; -final @Value class ValueExperimental1 { - public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { - if ((o == this)) - return true; - if ((! (o instanceof ValueExperimental1))) - return false; - return true; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - int result = 1; - return result; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return "ValueExperimental1()"; - } - public @java.lang.SuppressWarnings("all") ValueExperimental1() { - super(); - } -} -final @lombok.experimental.Value class ValueExperimental2 { - public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { - if ((o == this)) - return true; - if ((! (o instanceof ValueExperimental2))) - return false; - return true; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - int result = 1; - return result; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return "ValueExperimental2()"; - } - public @java.lang.SuppressWarnings("all") ValueExperimental2() { - super(); - } -}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValueExperimentalStarImport.java b/test/transform/resource/after-ecj/ValueExperimentalStarImport.java deleted file mode 100644 index b69e85d9..00000000 --- a/test/transform/resource/after-ecj/ValueExperimentalStarImport.java +++ /dev/null @@ -1,20 +0,0 @@ -import lombok.experimental.*; -final @Value class ValueExperimentalStarImport { - public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { - if ((o == this)) - return true; - if ((! (o instanceof ValueExperimentalStarImport))) - return false; - return true; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - int result = 1; - return result; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return "ValueExperimentalStarImport()"; - } - public @java.lang.SuppressWarnings("all") ValueExperimentalStarImport() { - super(); - } -} diff --git a/test/transform/resource/before/BuilderChainAndFluent.java b/test/transform/resource/before/BuilderChainAndFluent.java deleted file mode 100644 index 4d08741b..00000000 --- a/test/transform/resource/before/BuilderChainAndFluent.java +++ /dev/null @@ -1,4 +0,0 @@ -@lombok.experimental.Builder(fluent = false, chain = false) -class BuilderChainAndFluent { - private final int yes; -} diff --git a/test/transform/resource/before/BuilderComplex.java b/test/transform/resource/before/BuilderComplex.java index 590a2723..c13f5877 100644 --- a/test/transform/resource/before/BuilderComplex.java +++ b/test/transform/resource/before/BuilderComplex.java @@ -1,5 +1,5 @@ import java.util.List; -import lombok.experimental.Builder; +import lombok.Builder; class BuilderComplex { @Builder(buildMethodName = "execute") diff --git a/test/transform/resource/before/EqualsAndHashCodeWithGenericsOnInners.java b/test/transform/resource/before/EqualsAndHashCodeWithGenericsOnInners.java new file mode 100644 index 00000000..7af1d054 --- /dev/null +++ b/test/transform/resource/before/EqualsAndHashCodeWithGenericsOnInners.java @@ -0,0 +1,6 @@ +public class EqualsAndHashCodeWithGenericsOnInners<A> { + @lombok.EqualsAndHashCode class Inner<B> { + int x; + } +} + diff --git a/test/transform/resource/before/ValueExperimental.java b/test/transform/resource/before/ValueExperimental.java deleted file mode 100644 index 6bae26a0..00000000 --- a/test/transform/resource/before/ValueExperimental.java +++ /dev/null @@ -1,9 +0,0 @@ -import lombok.experimental.Value; - -@Value -class ValueExperimental1 { -} - -@lombok.experimental.Value -class ValueExperimental2 { -}
\ No newline at end of file diff --git a/test/transform/resource/before/ValueExperimentalStarImport.java b/test/transform/resource/before/ValueExperimentalStarImport.java deleted file mode 100644 index 5f18cffe..00000000 --- a/test/transform/resource/before/ValueExperimentalStarImport.java +++ /dev/null @@ -1,5 +0,0 @@ -import lombok.experimental.*; - -@Value -class ValueExperimentalStarImport { -}
\ No newline at end of file diff --git a/test/transform/resource/messages-ecj/BuilderComplex.java.messages b/test/transform/resource/messages-ecj/BuilderComplex.java.messages deleted file mode 100644 index 4856a80d..00000000 --- a/test/transform/resource/messages-ecj/BuilderComplex.java.messages +++ /dev/null @@ -1 +0,0 @@ -2 The type Builder is deprecated diff --git a/test/transform/resource/messages-ecj/ValueExperimental.java.messages b/test/transform/resource/messages-ecj/ValueExperimental.java.messages deleted file mode 100644 index e454a878..00000000 --- a/test/transform/resource/messages-ecj/ValueExperimental.java.messages +++ /dev/null @@ -1 +0,0 @@ -1 The type Value is deprecated
\ No newline at end of file diff --git a/website/extra/htaccess b/website/extra/htaccess index ea53d49c..db3393af 100644 --- a/website/extra/htaccess +++ b/website/extra/htaccess @@ -24,6 +24,12 @@ RewriteRule ^disable-checked-exceptions$ /disable-checked-exceptions.html [L,END RewriteRule ^disable-checked-exceptions(\.html)?$ /disable-checked-exceptions [NC,R=301] RewriteRule ^contributing$ /contributing.html [L,END] RewriteRule ^contributing(\.html)?$ /contributing [NC,R=301] +RewriteRule ^supporters$ /supporters.html [L,END] +RewriteRule ^supporters(.html)?$ /supporters [NC,R=301] +RewriteRule ^order-license-info$ /order-license-info.html [L,END] +RewriteRule ^order-?license-?info(.html)?$ /order-license-info [NC,R=301] +RewriteRule ^order-license$ /order-license.html [L,END] +RewriteRule ^order-?license(.html)?$ /order-license [NC,R=301] <#list setupPages as pg> RewriteRule ^setup/${pg?no_esc}$ /setup/${pg?no_esc}.html [L,END] diff --git a/website/resources/W8BEN_lombok.pdf b/website/resources/W8BEN_lombok.pdf Binary files differnew file mode 100644 index 00000000..b87bded8 --- /dev/null +++ b/website/resources/W8BEN_lombok.pdf diff --git a/website/resources/css/custom.css b/website/resources/css/custom.css index 795b155c..f81a3dd9 100644 --- a/website/resources/css/custom.css +++ b/website/resources/css/custom.css @@ -7,6 +7,101 @@ margin-bottom: 40px; } +.buttonLike { + cursor: pointer; + background: -webkit-linear-gradient(top, #FFFEF7, #CFCEC7); + background: -moz-linear-gradient(top, #FFFEF7, #CFCEC7); + background: -o-linear-gradient(#FFFEF7, #CFCEC7); + background: -ms-linear-gradient(#FFFEF7, #CFCEC7); + background: linear-gradient(top, #FFFEF7, #CFCEC7); + line-height: 1; + padding: 3px 10px; + border: 1px solid black; + position: relative; + overflow: visible; + color: black; + margin: 2px; + border-radius: 5px; + display: inline-block; + text-align: center; +} + +.orderButton { + width: 280px; +} + +.orderDetails { + font-style: italic; + font-size: 10px; + margin-top: 20px; +} + +.formErr { + color: #FF7777; +} + +.order-license #deleteCompanyLogo { + margin-top: 12px; +} + +.formSubmitFail { + color: #FF6666; + font-size: 1.2em; + font-style: italic; +} + +.order-license .btn-primary { + float: left; + margin-right: 20px; + background: -webkit-linear-gradient(#1725e0, #0923df 6%, #0b21ce); + background: -o-linear-gradient(#1725e0, #0923df 6%, #0b21ce); + background: -webkit-gradient(linear, left top, left bottom, from(#1725e0), color-stop(6%, #0923df), to(#0b21ce)); + background: linear-gradient(#1725e0, #0923df 6%, #0b21ce); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff1725e0', endColorstr='#ff0b21ce', GradientType=0); + -webkit-filter: none; + filter: none; + border: 1px solid #091bac; +} + +#onlyYearlyWarning { + font-size: 0.8em; + padding-left: 16px; +} + +.deemphasize { + color: #AAAAAA; + font-size: 0.8em; + font-style: italic; +} + +.supporterBar .introText { + margin-top: 16px; +} + +.barItem { + margin: 16px; + max-width: 168px; +} + +.barItem img { + width: 100%; +} + +.supportItem, .barItem { + display: inline-block; +} + +.supporters .supportItem { + margin: 6px 10px; +} + +.supporterBar { + width: 100%; + margin-left: auto; + margin-right: auto; +} + .errorBox { border: 1px dashed #F44; font-size: 1.2em; @@ -30,11 +125,6 @@ height: 16px; } -.legalese { - font-style: italic; - font-size: 0.8em; -} - #companyLogo { margin-right: 8px; } diff --git a/website/resources/files/supporters.json b/website/resources/files/supporters.json new file mode 100644 index 00000000..a895f95b --- /dev/null +++ b/website/resources/files/supporters.json @@ -0,0 +1,13 @@ +{ + "modWeight": { + "professional": 2.0, + "enterprise": 4.0, + "patron": 1.0 + }, + "professional": [ + ], + "enterprise": [ + ], + "patron": [ + ] +} diff --git a/website/resources/img/spinner.gif b/website/resources/img/spinner.gif Binary files differnew file mode 100644 index 00000000..f627b993 --- /dev/null +++ b/website/resources/img/spinner.gif diff --git a/website/resources/js/main.js b/website/resources/js/main.js index 3ad77958..f07da70d 100644 --- a/website/resources/js/main.js +++ b/website/resources/js/main.js @@ -37,7 +37,7 @@ if (self.data("clc")) return; var href = self.attr("href"); self.data("clc", true); - if (!href || href.substr(0, 4) === "http" || href === "/api/") return; + if (!href || href.substr(0, 4) === "http" || href === "/api/" || href === "/" || href === "/supporters" || href === "/order-license") return; var ext = href.substr(href.length - 4, 4); if (ext === ".xml" || ext === ".jar") return; self.on("click", function(evt) { diff --git a/website/resources/js/order-license.js b/website/resources/js/order-license.js new file mode 100644 index 00000000..b2842456 --- /dev/null +++ b/website/resources/js/order-license.js @@ -0,0 +1,231 @@ +"use strict"; + +(function() { + if (!String.prototype.trim) { + String.prototype.trim = function () { + return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + }; + } + + var imgDataUrl = null; + + function updateLocationInfo() { + var locationType = $("input:radio[name='locationType']:checked").val(); + $("#locationType_usa").toggle(locationType === "usa"); + $("#locationType_eu").toggle(locationType === "eu"); + $("#locationType_other").toggle(locationType === "other"); + $("#paymentMethod_iban").toggle(locationType === "eu"); + if ($("#paymentMethod_iban input").is(":checked") && locationType !== "eu") $("#paymentMethod_payoneer input").prop("checked", true); + if ($("#paymentMethod_intl input").is(":checked") && locationType === "eu") $("#paymentMethod_iban input").prop("checked", true); + $("#paymentMethod_intl").toggle(locationType !== "eu"); + } + + function updatePriceIndication() { + $("#onlyYearlyWarning").hide(); + var x = getPriceIndication(); + if (x === "") { + $("#costIndicator").text("").hide(); + } else { + $("#costIndicator").text(x).show(); + } + } + + function getPriceIndication() { + try { + var seats = parseInt($("#seats").val()); + if (isNaN(seats) || seats < 1) return ""; + var licenseType = $("input:radio[name='licenseType']:checked").val(); + var costPer; + if (licenseType === "enterprise") costPer = 5; + else if (licenseType === "professional") costPer = 2; + else return ""; + var periodRaw = $("input:radio[name='paymentType']:checked").val(); + if (periodRaw === "monthly") { + if (costPer*seats < 50) { + $("#onlyYearlyWarning").show(); + return "Your license will cost €" + (costPer*seats*12) + ",- per year."; + } + return "Your license will cost €" + (costPer*seats) + ",- per month."; + } + return "Your license will cost €" + (costPer*seats*12) + ",- per year."; + } catch (e) { + return ""; + } + } + + function showError(elemName) { + var elem = $("#" + elemName + "Err"); + elem.fadeIn(); + $("#" + elemName).on("change keyup", function() { + elem.hide(); + }); + } + + function applyLicense() { + var submitButton = $("#submit"); + var spinner = $("<img>").attr("src", "/img/spinner.gif").attr("alt", "submitting").css("float", "left").css("margin-right", "20px"); + + submitButton.on("click", function(evt) { + evt.preventDefault(); + + var onSuccess = function() { + $("#orderHelp").hide(); + var okMsg = $("<div>").addClass("formSubmitOk").html("Thank you for ordering a Project Lombok license! We'll send your bill via email. If you have any further questions please contact us at <a href=\"mailto:orders@projectlombok.org\"><code>orders@projectlombok.org</code></a>."); + spinner.replaceWith(okMsg); + }; + + var onFailure = function() { + $("#orderHelp").hide(); + var errMsg = $("<div>").addClass("formSubmitFail").html("Our order form appears to be broken. Could you do us a favour and contact us at <a href=\"mailto:orders@projectlombok.org\"><code>orders@projectlombok.org</code></a>? Thank you!"); + spinner.replaceWith(errMsg); + }; + + var data = {}; + data.name = $("#companyName").val(); + data.email = $("#email").val(); + data.licenseType = $("input:radio[name='licenseType']:checked").val(); + data.seats = parseInt($("#seats").val()); + data.paymentType = $("input:radio[name='paymentType']:checked").val(); + data.mentionMe = $("#mentionMe").prop("checked"); + data.companyUrl = $("#companyUrl").val(); + data.locationType = $("input:radio[name='locationType']:checked").val(); + data.euVat = $("#euVat").val(); + data.paymentMethod = $("input:radio[name='paymentMethod']:checked").val(); + + var formFail = false; + + if (!data.paymentMethod) { + showError("paymentMethod"); + formFail = true; + } + + if (!data.euVat && data.locationType === 'eu') { + $("#euVat").focus(); + showError("euVat"); + formFail = true; + } + + if (!data.locationType) { + showError("locationType"); + formFail = true; + } + + if (!data.seats || isNaN(data.seats) || data.seats < 1) { + $("#seats").focus(); + showError("seats"); + formFail = true; + } + + if (!data.paymentType) { + showError("paymentType"); + formFail = true; + } + + if (data.email.indexOf('@') === -1) { + $("#email").focus(); + showError("email"); + formFail = true; + } + + if (data.name.trim().length < 1) { + $("#companyName").focus(); + showError("companyName"); + formFail = true; + } + + if (formFail) return; + + var rnd = generateRandom(); + var err = processImageUpload(); + if (err) { + alert(err); + $("#logo")[0].value = null; + return; + } + if (imgDataUrl) data.logo = imgDataUrl; + + submitButton.replaceWith(spinner); + + $.ajax({ + url: "/license-submit/" + rnd, + method: "PUT", + contentType: "application/json", + data: JSON.stringify(data), + processData: false, + success: onSuccess, + error: onFailure + }); + }); + + $("#companyLogo").on("click", function(evt) { + evt.preventDefault(); + $("#logo").click(); + }); + + $("#deleteCompanyLogo").on("click", function(evt) { + evt.preventDefault(); + $("#logo")[0].value = null; + $("#logoCnt").empty().hide(); + $("#companyLogo").show(); + $("#deleteCompanyLogo").hide(); + }); + + $("#logo").on("change", function() { + var err = showImage(); + if (err) { + alert(err); + $("#logo")[0].value = null; + } else { + $("#companyLogo").hide(); + $("#deleteCompanyLogo").show(); + } + }); + + $("#seats,.paymentType,.licenseType").on("change keyup", function() { + updatePriceIndication(); + }); + $(".locationType").on("change", function() { + updateLocationInfo(); + }); + } + + function generateRandom() { + var buf = new Uint8Array(40); + window.crypto.getRandomValues(buf); + return btoa(String.fromCharCode.apply(null, buf)).replace(/\+/g, '_').replace(/\//gi, '-'); + } + + function showImage() { + $("#logoCnt").empty().hide(); + try { + return processImageUpload(function(dataUrl) { + var img = $("<img />"); + img.css({ + "max-width": "500px", + "max-height": "300px" + }); + $("#logoCnt").append(img).show(); + img.attr("src", dataUrl); + }); + } catch (e) { + if (console && console.log) console.log(e); + } + } + + function processImageUpload(fnc) { + var f = $("#logo")[0].files[0]; + if (!f) return; + if (f.size > 10000000) return "Logo too large; please give us a logo below 10MiB in size."; + var imageType = /^image\//; + if (!imageType.test(f.type)) return "Please upload an image, for example in PNG format."; + var reader = new FileReader(); + reader.onload = function(e) { + imgDataUrl = e.target.result; + if (fnc) fnc(e.target.result); + }; + reader.readAsDataURL(f); + return null; + } + + $(applyLicense); +})(); diff --git a/website/resources/js/supporters.js b/website/resources/js/supporters.js new file mode 100644 index 00000000..11f77640 --- /dev/null +++ b/website/resources/js/supporters.js @@ -0,0 +1,221 @@ +"use strict"; + +(function($) { + var supporters = {}; + var weights = {}; + var types = ["enterprise", "professional", "patron"]; + + function shuffle(array) { + var i = 0, j = 0, temp = null; + for (i = array.length - 1; i > 0; i -= 1) { + j = Math.floor(Math.random() * (i + 1)); + temp = array[i]; + array[i] = array[j]; + array[j] = temp; + } + } + + function pad(number) { + return number < 10 ? '0' + number : number; + } + + function fromDate(d) { + return d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate()); + + } + + function toDate(s) { + var x = /^(\d{4})-(\d{2})-(\d{2})$/.exec(s); + if (x) return new Date(parseInt(x[1]), parseInt(x[2]), parseInt(x[3])); + return null; + } + + function Supporter(type, json) { + this.type = type; + this.name = json.name; + this.logo = json.logo; + this.url = json.url; + this.showName = json.showName; + this.start = json.range ? toDate(json.range[0]) : null; + this.end = json.range ? toDate(json.range[1]) : null; + this.weight = (!json.weight && json.weight !== 0.0) ? 1.0 : json.weight; + } + + Supporter.prototype.inRange = function(d) { + return (!this.start || this.start <= d) && (!this.end || this.end > d); + }; + + Supporter.prototype.render = function() { + var d = $("<div />").addClass("supportItem").addClass(this.type); + var a = d; + if (this.url) { + a = $("<a />").attr("href", this.url).attr("rel", "noopener").attr("target", "_blank"); + d.append(a); + } + var n = $("<span />").text(this.name); + a.append(n); + + if (this.logo) { + a.addClass("logo"); + var i = new Image(); + var showName = this.showName; + i.onload = function() { + var w = i.width; + var h = i.height; + var wf = w / 162; + var hf = h / 80; + var f = hf > wf ? hf : wf; + var wt = Math.round(w / f); + var ht = Math.round(h / f); + i.width = wt; + i.height = ht; + var ji = $(i); + if (!showName) a.empty(); + ji.css("width", wt + "px"); + ji.css("height", ht + "px"); + ji.attr("alt", n.text()); + ji.attr("title", n.text()); + a.prepend(ji); + }; + i.src = 'files/' + this.logo; + } + return d; + } + + function errorHandler(xhr, statusText, err) { + var errMsg = "Can't connect to projectlombok.org to fetch the list of licensees and supporters."; + if (console && console.log) { + console.log("AJAX error for loading list of supporters:"); + console.log(err); + } + var errBox = $("<div />").addClass("errorBox").text(errMsg); + $(".supporters").text("").append(errBox); + } + + function successHandler(data) { + $.each(types, function() { + var t = this; + supporters[t] = []; + if (data && data[t]) $.each(data[t], function() { + supporters[t].push(new Supporter(t, this)); + }); + }); + weights = data.modWeight; + if (typeof weights !== 'object') weights = {}; + updatePage(); + } + + function build() { + var spinner = $("<img />").attr("title", "loading").attr("src", "/img/spinner.gif").addClass("spinner"); + $(".supporters").append(spinner); + $.ajax({ + url: "/files/supporters.json", + dataType: "json", + cache: true, + error: errorHandler, + success: function(data) { + spinner.remove(); + successHandler(data); + } + }); + } + + function applySupporters() { + build(); + } + + function updatePage() { + updateSupporters(); + updateSupporterBar(); + } + + var supPerBar = 4; + function updateSupporterBar() { + var s = $(".supporterBar"); + s.find(".introText").show(); + s.append($("<div />").addClass("sbCnt")); + var sf = s.find(".supporterFooter").show(); + s.append(sf); + s = s.find(".sbCnt"); + var now = new Date(); + var list = []; + $.each(types, function() { + var t = this; + $.each(supporters[t], function() { + if (this.inRange(now)) { + var w = weights[t] ? weights[t] : 1.0; + if (this.weight) w = w * this.weight; + for (var i = 0; i < w; i++) list.push(this); + } + }); + }); + + shuffle(list); + + var len = list.length; + var pos = 0; + var c = [], cd = []; + for (var i = 0; i < supPerBar; i++) { + c[i] = null; + cd[i] = $("<div />").addClass("barItem"); + } + + var upd = function() { + var nw = [], a = [], fo = $(), fi = $(); + var sPos = pos; + for (var i = 0; i < supPerBar; i++) { + if (++pos === len) pos = 0; + var z = false; + for (var j = 0; j < i; j++) if (nw[j] === list[pos]) z = true; + if (z) i--; + else nw[i] = list[pos]; + if (pos === sPos) break; + } + for (var i = 0; i < supPerBar; i++) a[i] = (nw[i] === c[i] || !nw[i]) ? null : nw[i].render(i + 1).hide(); + for (var i = 0; i < supPerBar; i++) { + if (a[i]) { + fi = fi.add(a[i]); + fo = fo.add(cd[i].children()); + if (cd[i].parent().length === 0) s.append(cd[i]); + cd[i].append(a[i]); + c[i] = nw[i]; + } + } + + if (fo.length === 0) fi.fadeIn(); + else { + fo.fadeOut("normal", function() { + fi.fadeIn(); + fo.remove(); + }); + } + }; + + setInterval(upd, 10000); + upd(); + } + + function updateSupporters() { + var s = $(".supporters"); + s.empty(); + var now = new Date(); + $.each(types, function() { + var t = this; + var d = $("<div />").addClass("row"); + var h = $("<h2 />").text(t); + d.append(h); + $.each(supporters[t], function() { + if (this.inRange(now)) d.append(this.render()); + }); + if (d.children().length > 1) s.append(d); + }); + if (s.children().length < 1) { + var x = $("<div />").addClass("noSupportersBox").html( + "We don't have any supporters yet this month.<br /><a href=\"https://patreon.com/lombok\" rel=\"noopener\">Become a patron</a> " + + "or <a href=\"/order-license-info\">order a professional or enterprise license</a> today!"); + s.append(x); + } + } + + $(applySupporters); +})($);
\ No newline at end of file diff --git a/website/templates/_scaffold.html b/website/templates/_scaffold.html index c461423f..646f0247 100644 --- a/website/templates/_scaffold.html +++ b/website/templates/_scaffold.html @@ -22,7 +22,8 @@ "Netbeans": "netbeans", "MyEclipse": "eclipse", "Spring Tool Suite": "eclipse", - "JBoss Developer Studio": "eclipse" + "JBoss Developer Studio": "eclipse", + "Visual Studio Code": "vscode" }, "Platforms": { "Android": "android", @@ -92,14 +93,17 @@ ga('send', 'pageview'); <li><a href="/features/experimental/all">Experimental</a></li> </ul> </li> - <li> - <a href="https://groups.google.com/group/project-lombok" target="_blank"> - <span>Discuss/Help</span> - </a> + <li class="dropdown"> + <a class="dropdown-toggle pointer" data-toggle="dropdown">Community<span class="caret"></span></a> + <ul class="dropdown-menu" aria-labelledby="themes"> + <li><a href="https://groups.google.com/group/project-lombok" rel="noopener">Discuss / Help</a></li> + <li><a href="https://github.com/rzwitserloot/lombok/issues" rel="noopener">Issues</a></li> + <li><a href="/contributing">Contribute</a></li> + </ul> </li> <li> - <a href="/contributing"> - <span>Contribute</span> + <a href="/order-license-info"> + <span>Order / Donate</span> </a> </li> <li class="dropdown"> diff --git a/website/templates/contributing.html b/website/templates/contributing.html index dde6e3ff..3a99c77a 100644 --- a/website/templates/contributing.html +++ b/website/templates/contributing.html @@ -3,6 +3,11 @@ <@main.scaffold> <div class="page-header top5"> <div class="row text-center"> + <@main.h1 title="Contributing to Project Lombok's development" /> + </div><div class="row"> + You can choose to <a href="/order-license-info">become a project lombok licensee or support us on patreon</a>. + </div> + <div class="row text-center"> <@main.h1 title="How to work on Project Lombok yourself" /> </div><div class="row"> Project Lombok is being developed via the <a href="https://github.com/rzwitserloot/lombok">lombok git repository on github</a>. diff --git a/website/templates/features/experimental/ExtensionMethod.html b/website/templates/features/experimental/ExtensionMethod.html index ca63bb2e..f1d8b084 100644 --- a/website/templates/features/experimental/ExtensionMethod.html +++ b/website/templates/features/experimental/ExtensionMethod.html @@ -36,7 +36,7 @@ </p><p> Lombok does not (currently) have any runtime dependencies which means lombok does not (currently) ship with any useful extension methods so you'll have to make your own. However, here's one that might spark your imagination: <br /> <pre>public class ObjectExtensions { - public static <T> or(T object, T ifNull) { + public static <T> T or(T object, T ifNull) { return object != null ? object : ifNull; } }</pre><br /> diff --git a/website/templates/main.html b/website/templates/main.html index 00d64dab..25098758 100644 --- a/website/templates/main.html +++ b/website/templates/main.html @@ -28,21 +28,17 @@ <a href="http://jnb.ociweb.com/jnb/jnbJan2010.html">Show me a text and images based explanation and tutorial instead!</a> </div> </div> - <div class="row supporterBar"> - </div> </div> <div class="row text-center"> <@main.h2 title="Upcoming presentations" /> <p> - Roel and Reinier will be talking about <em>(near) future java features; a preview of what Java10 and Java11 will probably look like</em>, across germany:<ul> - <li><a href="https://www.meetup.com/Java-User-Group-Saarland-jugsaar/">JUG Saarland, Monday March 5th, 2018, Saarbrücken (Details to follow)</a></li> - <li><a href="http://www.majug.de/">JUG Mannheim, Tuesday March 6th, 2018, Mannheim (Details to follow)</a></li> - <li><a href="http://www.jug-kl.de/double-feature/">JUG Kaiserslautern, Wednesday March 7th, 2018, 19:00, Chaos Computer Club</a></li> - <li><a href="https://www.jug-da.de/">JUG Darmstadt, Thursday March 8th, 2018 (Details to follow)</a></li> - <li><a href="https://programm.javaland.eu/2018/#/scheduledEvent/549331">JavaLand March 14th 2018, 12:00</a>, room: Schauspielhaus.</li> - </ul> - <em>See you there! (We'll have stickers!)</em> + We're talking to NL-JUG to give a presentation soon in the The Hague (The Netherlands) area.<br /> + Want us to present at your JUG or conference? Feel free to contact us, via email (<code>info@</code>) or twitter: <a href="https://twitter.com/project_lombok">@project_lombok</a>. </p> </div> + <div class="row text-center supporterBar"> + <h2 class="introText" hidden="hidden">Project Lombok is <a href="/supporters">powered by</a>:</h2> + <div class="supporterFooter" hidden="hidden"><a class="buttonLike" href="/order-license-info">I want to support Project Lombok too!</a></div> + </div> </div> </@main.scaffold> diff --git a/website/templates/order-license-info.html b/website/templates/order-license-info.html new file mode 100644 index 00000000..724e44f7 --- /dev/null +++ b/website/templates/order-license-info.html @@ -0,0 +1,31 @@ +<#import "/_scaffold.html" as main> + +<@main.scaffold> + <div class="page-header top5"> + <div class="row text-center"> + <h2>Order a professional or enterprise license</h2> + </div> + <div class="row"> + <p> + Lombok is open source. We offer three licenses for using lombok. The standard license is free. Here you can order a professional or enterprise license. + </p><p> + <a class="buttonLike orderButton" href="/order-license">Order a professional or enterprise license</a><br /> + <a class="buttonLike orderButton" href="https://www.patreon.com/lombok">For individuals: Become a patreon</a> + </p> + <div class="row text-center"> + <h2>Benefits of becoming a licensee</h2> + </div> + <p> + Lombok is and will remain a free, open source product. However, we ask you to consider becoming a licensee. Licensees will be <a href="/supporters">listed</a> on the <code>projectlombok.org</code> website, we'll send you some stickers, and an official license. You'll be supporting the development of Project Lombok. + </p> + <div class="row text-center"> + <h2>Small print</h2> + </div> + <p class="deemphasize"> + As part of being a professional or enterprise licensee, we will put your name, a logo, and possibly a link on our ‘supporters and licensees’ page. We'll also put (at random) some supporters and licensees on our front page. You may of course opt out of this offer. We may, at our discretion, opt not to list you. If we elect not to do so, you will be notified at the email address you fill in on our form, and you are as always free to cancel your license at any time. + </p><p class="deemphasize"> + Project Lombok is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed, even for professional and enterprise license holders. In no event shall the copyright holder or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. + </p> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/order-license.html b/website/templates/order-license.html new file mode 100644 index 00000000..a364fc79 --- /dev/null +++ b/website/templates/order-license.html @@ -0,0 +1,151 @@ +<#import "/_scaffold.html" as main> + +<@main.scaffold load=["/js/order-license.js"]> + <div class="page-header top5 order-license"> + <div class="row text-center"> + <h2>Order a professional or enterprise license</h2> + </div> + <div class="row"> + <form> + <fieldset class="form-group"> + <legend>Basic information</legend> + <div class="form-group"> + <label for="companyName">Company name</label> + <input type="text" class="form-control" aria-describedby="companyNameHelp" id="companyName" placeholder="license holder name" /> + <div id="companyNameErr" class="formErr" hidden="hidden">Company name is a required field.</div> + <small id="companyNameHelp" class="form-text text-muted">If applying for an individual license, fill in your own name.</small> + </div> + <div class="form-group"> + <label for="email">Email</label> + <input type="email" class="form-control" aria-describedby="emailHelp" id="email" placeholder="email of contact / holder" /> + <div id="emailErr" class="formErr" hidden="hidden">Your email address is required; we will send the bill to this email address.</div> + <small id="emailHelp" class="form-text text-muted">We will never share this email with any third parties; we'll email you the invoice at this email address.</small> + </div> + </fieldset> + <fieldset class="form-group"> + <legend>Type of license</legend> + <div class="form-group"> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input licenseType" name="licenseType" value="professional" checked="checked" /> + Professional (€2,- per developer per month; ~ $2.50). + </label> + </div> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input licenseType" name="licenseType" value="enterprise" /> + Enterprise (€5,- per developer per month; ~ $6.10). + </label> + </div> + </div> + <div id="licenseTypeErr" class="formErr" hidden="hidden">License type is a required field.</div> + <div class="form-group"> + <label for="seats"># of developers using lombok</label> + <input type="number" placeholder="# of developers" class="form-control" id="seats" /> + <div id="seatsErr" class="formErr" hidden="hidden">We need to know the # of developers to determine the license price.</div> + </div> + </fieldset> + <fieldset class="form-group"> + <legend>Payment</legend> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input paymentType" name="paymentType" value="yearly" checked="checked" /> + Yearly + </label> + </div> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input paymentType" name="paymentType" value="monthly" /> + Monthly<span id="onlyYearlyWarning" hidden="hidden" class="warning">The total license cost is sufficiently low that we'll bill you yearly.</span> + </label> + </div> + <div id="paymentTypeErr" class="formErr" hidden="hidden">Payment type is a required field.</div> + <div class="form-group" hidden="hidden" id="costIndicator"> + </div> + </fieldset> + <fieldset class="form-group"> + <legend>Mention</legend> + <div class="form-check"> + <label class="form-check-label"> + <input type="checkbox" class="form-check-input" id="mentionMe" name="mentionMe" checked="checked" /> + Mention me on the <em>supporters / licensees</em> page. + </label> + </div> + <div class="form-group"> + <label for="companyUrl">Company URL (optional)</label> + <input type="url" class="form-control" id="companyUrl" placeholder="URL of your company website" /> + </div> + <div class="form-group"> + <label for="logo">Company Logo (optional)</label> + <input type="file" style="display: none;" id="logo" name="logo" /> + <button class="form-control" id="companyLogo">Upload a logo</button> + <div id="logoCnt" style="display: none;"></div> + <button class="form-control" id="deleteCompanyLogo" style="display: none;">Remove logo</button> + </div> + </fieldset> + <fieldset class="form-group"> + <legend>Location and VAT</legend> + <div class="form-group"> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input locationType" name="locationType" value="eu" checked="checked" /> + We are based in the Europe + </label> + </div> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input locationType" name="locationType" value="usa" /> + We are based in the USA + </label> + </div> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input locationType" name="locationType" value="other" /> + We are based elsewhere + </label> + </div> + <div id="locationTypeErr" class="formErr" hidden="hidden">Location (continent) is a required field.</div> + </div> + <div class="form-group" id="locationType_eu"> + <label for="euVat">EU VAT number</label> + <input type="text" class="form-control" id="euVat" placeholder="EU VAT number" /> + <div id="euVatErr" class="formErr" hidden="hidden">EU VAT is a required field. If you are an individual and you have no EU VAT number, consider giving us a <a href="https://www.patreon.com/lombok">patreon</a> donation.</div> + </div> + <div class="form-group" hidden="hidden" id="locationType_usa"> + Please <a href="/W8BEN_lombok.pdf">download our W-8BEN form</a> for your tax records. + </div> + <div class="form-group" hidden="hidden" id="locationType_other"> + Please make sure you fulfill any local tax obligations for buying software from other countries. + </div> + </fieldset> + <fieldset class="form-group"> + <legend>Payment method</legend> + <div class="form-group"> + <div class="form-check" id="paymentMethod_iban"> + <label class="form-check-label"> + <input type="radio" class="form-check-input" name="paymentMethod" value="iban" checked="checked" /> + Pay via IBAN (european bank transfer) + </label> + </div> + <div class="form-check" hidden="hidden" id="paymentMethod_intl"> + <label class="form-check-label"> + <input type="radio" class="form-check-input" name="paymentMethod" value="intl" /> + Pay via international bank transfer + </label> + </div> + <div class="form-check"> + <label class="form-check-label" id="paymentMethod_payoneer"> + <input type="radio" class="form-check-input" name="paymentMethod" value="payoneer" /> + Pay with Payoneer + </label> + </div> + <div id="paymentMethodErr" class="formErr" hidden="hidden">Payment method is a required field.</div> + </div> + </fieldset> + <button type="submit" id="submit" class="btn btn-primary">Submit order</button> + <div id="orderHelp">If you run into issues with the order form, or you have any other questions, please send us an email at <a href="mailto:orders@projectlombok.org"><code>orders@projectlombok.org</code></a>. You can cancel your subscription at any time.</div> + <div class="orderDetails">Our EU VAT number: NL858105378B01</div> + </p> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/setup/intellij.html b/website/templates/setup/intellij.html index 989986e5..331a7bcd 100644 --- a/website/templates/setup/intellij.html +++ b/website/templates/setup/intellij.html @@ -5,7 +5,7 @@ <p> The <a href="https://www.jetbrains.com/idea/">Jetbrains IntelliJ IDEA</a> editor is compatible with lombok. </p><p> - Add the <a href="https://plugins.jetbrains.com/plugin/6317">Lombok IntelliJ plugin</a> to add lombok support IntelliJ: + Add the <a href="https://plugins.jetbrains.com/plugin/6317">Lombok IntelliJ plugin</a> to add lombok support for IntelliJ: <ul><li> Go to <code>File > Settings > Plugins</code> </li><li> diff --git a/website/templates/setup/vscode.html b/website/templates/setup/vscode.html new file mode 100644 index 00000000..bf9c3e58 --- /dev/null +++ b/website/templates/setup/vscode.html @@ -0,0 +1,18 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Microsoft Visual Studio Code"> + <@s.introduction> + <p> + The <a href="https://code.visualstudio.com/">Microsoft Visual Studio Code</a> editor is compatible with lombok. + </p><p> + Add the <a href="https://marketplace.visualstudio.com/items?itemName=GabrielBB.vscode-lombok">vscode-lombok</a> plugin to your Visual Studio Code IDE to add lombok support. + <ul><li> + press <code>Ctrl + Shift + X</code> to open the extension manager. + </li><li> + Type <code>lombok</code> to find the plugin, and click <code>install</code>. + </li><li> + Reload VS Code when asked. + </li></ul> + </p> + </@s.introduction> +</@s.scaffold> diff --git a/website/templates/supporters.html b/website/templates/supporters.html new file mode 100644 index 00000000..2003a23f --- /dev/null +++ b/website/templates/supporters.html @@ -0,0 +1,10 @@ +<#import "/_scaffold.html" as main> + +<@main.scaffold load=["js/supporters.js"]> + <div class="page-header top5"> + <div class="row text-center"> + <h1>Project Lombok supporters</h1> + </div><div class="row supporters"> + </div> + </div> +</@main.scaffold> |