From 1e1945145e7e6ebbb1df735eddf289676a5539af Mon Sep 17 00:00:00 2001 From: sebthom Date: Fri, 1 Mar 2024 20:52:32 +0100 Subject: [PATCH] build: explicitly configure Eclipse compiler settings --- build.gradle | 128 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 123 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index e8c9e050..412ce914 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,12 @@ /****************************************************************************** * Copyright (c) 2016 TypeFox and others. - * + * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0, * or the Eclipse Distribution License v. 1.0 which is available at * http://www.eclipse.org/org/documents/edl-v10.php. - * + * * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause ******************************************************************************/ @@ -32,15 +32,16 @@ apply from: "${rootDir}/gradle/versions.gradle" subprojects { repositories.mavenCentral() - + group = 'org.eclipse.lsp4j' version = rootProject.version - + + apply plugin: 'eclipse' apply plugin: 'java-library' apply plugin: 'org.xtext.xtend' apply plugin: 'eclipse' apply plugin: 'maven-publish' - + apply from: "${rootDir}/gradle/java-compiler-settings.gradle" apply from: "${rootDir}/gradle/xtend-compiler-settings.gradle" apply from: "${rootDir}/gradle/maven-deployment.gradle" @@ -54,6 +55,123 @@ subprojects { } } } + + eclipse { + jdt.file.withProperties { properties -> + properties['org.eclipse.jdt.core.compiler.release']='enabled' + properties['org.eclipse.jdt.core.compiler.doc.comment.support']='enabled' + properties['org.eclipse.jdt.core.compiler.problem.APILeak']='warning' + properties['org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated']='info' + properties['org.eclipse.jdt.core.compiler.problem.annotationSuperInterface']='warning' + properties['org.eclipse.jdt.core.compiler.problem.assertIdentifier']='error' + properties['org.eclipse.jdt.core.compiler.problem.autoboxing']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.comparingIdentical']='warning' + properties['org.eclipse.jdt.core.compiler.problem.deadCode']='warning' + properties['org.eclipse.jdt.core.compiler.problem.deprecation']='warning' + properties['org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.discouragedReference']='warning' + properties['org.eclipse.jdt.core.compiler.problem.emptyStatement']='warning' + properties['org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.enumIdentifier']='error' + properties['org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable']='warning' + properties['org.eclipse.jdt.core.compiler.problem.fallthroughCase']='warning' + properties['org.eclipse.jdt.core.compiler.problem.fatalOptionalError']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.fieldHiding']='warning' + properties['org.eclipse.jdt.core.compiler.problem.finalParameterBound']='warning' + properties['org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally']='warning' + properties['org.eclipse.jdt.core.compiler.problem.forbiddenReference']='error' + properties['org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock']='warning' + properties['org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts']='enabled' + properties['org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod']='warning' + properties['org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch']='warning' + properties['org.eclipse.jdt.core.compiler.problem.indirectStaticAccess']='warning' + properties['org.eclipse.jdt.core.compiler.problem.invalidJavadoc']='warning' + properties['org.eclipse.jdt.core.compiler.problem.invalidJavadocTags']='enabled' + properties['org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef']='enabled' + properties['org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef']='enabled' + properties['org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility']='protected' + properties['org.eclipse.jdt.core.compiler.problem.localVariableHiding']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.methodWithConstructorName']='warning' + properties['org.eclipse.jdt.core.compiler.problem.missingDefaultCase']='info' + properties['org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation']='warning' + properties['org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod']='warning' + properties['org.eclipse.jdt.core.compiler.problem.missingJavadocComments']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility']='public' + properties['org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription']='return_tag' + properties['org.eclipse.jdt.core.compiler.problem.missingJavadocTags']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility']='public' + properties['org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation']='warning' + properties['org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation']='enabled' + properties['org.eclipse.jdt.core.compiler.problem.missingSerialVersion']='warning' + properties['org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod']='warning' + properties['org.eclipse.jdt.core.compiler.problem.noEffectAssignment']='warning' + properties['org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion']='warning' + properties['org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped']='warning' + properties['org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation']='warning' + properties['org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict']='error' + properties['org.eclipse.jdt.core.compiler.problem.nullReference']='warning' + properties['org.eclipse.jdt.core.compiler.problem.nullSpecViolation']='error' + properties['org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion']='warning' + properties['org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod']='warning' + properties['org.eclipse.jdt.core.compiler.problem.parameterAssignment']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables']='warning' + properties['org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment']='warning' + properties['org.eclipse.jdt.core.compiler.problem.potentialNullReference']='warning' + properties['org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable']='warning' + properties['org.eclipse.jdt.core.compiler.problem.rawTypeReference']='warning' + properties['org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation']='warning' + properties['org.eclipse.jdt.core.compiler.problem.redundantNullCheck']='warning' + properties['org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments']='warning' + properties['org.eclipse.jdt.core.compiler.problem.redundantSuperinterface']='warning' + properties['org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures']='warning' + properties['org.eclipse.jdt.core.compiler.problem.specialParameterHidingField']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.staticAccessReceiver']='warning' + properties['org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.suppressWarnings']='enabled' + properties['org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed']='info' + properties['org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.terminalDeprecation']='warning' + properties['org.eclipse.jdt.core.compiler.problem.typeParameterHiding']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unclosedCloseable']='warning' + properties['org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.unhandledWarningToken']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType']='info' + properties['org.eclipse.jdt.core.compiler.problem.unnecessaryElse']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable']='enabled' + properties['org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference']='enabled' + properties['org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.unusedImport']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unusedLabel']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unusedLocal']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unusedParameter']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference']='enabled' + properties['org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete']='disabled' + properties['org.eclipse.jdt.core.compiler.problem.unusedPrivateMember']='warning' + properties['org.eclipse.jdt.core.compiler.problem.unusedTypeParameter']='ignore' + properties['org.eclipse.jdt.core.compiler.problem.unusedWarningToken']='warning' + properties['org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast']='warning' + } + } } task clean(type: Delete) {