From 401f23da8d424308e0983db91d0b083ad309d9da Mon Sep 17 00:00:00 2001 From: Stefan Triller Date: Tue, 7 Nov 2017 15:57:46 +0100 Subject: [PATCH] WIP: External null annotations via zip This PR is similar to #4217 but instead of creating a project that contains the annotations in a directory it sets up the IDE to read the annotations from a zip file. The reason behind this is that the IDE should be for the every day developer who will not create external annotations. Nevertheless he should benefit from them which is why they are provided in a zip file. This zip file should be hosted externally, maybe together with lastnpe.org. That is also the place to add new annotations, i.e. download the project from there, change the IDE to use this project as a directory, add your annotations and afterwards the project releases a new zip file. In this PR I created a setup task for the IDE to download the annotations file and place it in a "eea" directory in the targetplatform folder. For maven there is a new dependency to the wagon-maven-plugin which enables downloading a single file to be placed where the IDE stores the file too. The compile task uses this zip file as "annotationpath". Also I reactivated the "Unchecked conversion from non-annotated type to @nonnull type" check by setting it to warning level, otherwise (if set to ignore) external annotations are not needed. As an example I updated the ".classpath" file of the sonos binding to use the downloaded zip file. The parts which are still valid from PR #4217 are: * all created external annotations * all updated .classpath files (IF adjusted to use the zip file instead of a directory) The URL where the file will be hosted is still left open, which is why this PR is WIP. --- .../.classpath | 12 ++++++++-- pom.xml | 24 +++++++++++++++++++ targetplatform/EclipseSmartHome.setup | 6 ++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/extensions/binding/org.eclipse.smarthome.binding.sonos/.classpath b/extensions/binding/org.eclipse.smarthome.binding.sonos/.classpath index 7f457fa4138..70da1a9ec7b 100644 --- a/extensions/binding/org.eclipse.smarthome.binding.sonos/.classpath +++ b/extensions/binding/org.eclipse.smarthome.binding.sonos/.classpath @@ -1,7 +1,15 @@ - - + + + + + + + + + + diff --git a/pom.xml b/pom.xml index 4c9d5eae216..84d5ddfcf1b 100644 --- a/pom.xml +++ b/pom.xml @@ -54,6 +54,9 @@ 1.8 UTF-8 0.3.0 + http://www.TODO.tld + path/to/file/on/server + jdk.zip pom @@ -70,6 +73,25 @@ + + org.codehaus.mojo + wagon-maven-plugin + 1.0 + + + download-eea-zip + initialize + + download-single + + + ${eea-url} + ${eea-dir}/${eea-file} + ${basedirRoot}/targetplatform/eea/ + + + + org.commonjava.maven.plugins directory-maven-plugin @@ -184,6 +206,8 @@ -err:+nullAnnot(org.eclipse.jdt.annotation.Nullable|org.eclipse.jdt.annotation.NonNull|org.eclipse.jdt.annotation.NonNullByDefault),+inheritNullAnnot -warn:+null,+inheritNullAnnot,+nullAnnotConflict,+nullUncheckedConversion,+nullAnnotRedundant,+nullDereference + -annotationpath + ${basedirRoot}/targetplatform/eea/${eea-file} diff --git a/targetplatform/EclipseSmartHome.setup b/targetplatform/EclipseSmartHome.setup index 050887e41d5..65c396bba9f 100644 --- a/targetplatform/EclipseSmartHome.setup +++ b/targetplatform/EclipseSmartHome.setup @@ -124,7 +124,7 @@ + value="warning"/> +