GoogleCloudPlatform / gradle-appengine-plugin

Gradle plugin that provides tasks for uploading, running and managing Google App Engine projects
Apache License 2.0
236 stars 60 forks source link

task compileJava throws warnings #288

Open syslogic opened 7 years ago

syslogic commented 7 years ago

This happens when building with JDK 1.8, while RELEASE_6 is JDK 1.6. These complaints probably would not be thrown, by already building the tools against JDK 1.7 or JDK 1.8. The mess seems to consists of 3 JDK versions, while the expected behavior would be, that it should build without complaints at least against JDK 1.7 or preferably altogether against JDK 1.8.

apply plugin: 'appengine'

// the below output is with / without these lines
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

dependencies {
    appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.54'
}

:appengine:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.7
warning: Supported source version 'RELEASE_6' from annotation processor 
'com.google.appengine.tools.compilation.DatastoreCallbacksProcessor' less than -source '1.7'
1 warning

:appengine:compileJava
 warning: Supported source version 'RELEASE_6' from annotation processor 'com.google.appengine.tools.compilation.DatastoreCallbacksProcessor' less than -source '1.8'
1 warning

Q: How to fix the bootstrap class path? are these compatibility flags even required? Q: How to upgrade the RELEASE_6 of the DatastoreCallbacksProcessor to RELEASE_7 or RELEASE_8?

loosebazooka commented 7 years ago

Bootstrap classpath is a java thing you can fix in gradle using the compile task option kind of like this but for java8/java7 instead of java7/java6 : https://discuss.gradle.org/t/compile-java-1-6-compatible-classes-with-gradle-started-with-java-7/4527/2

I can't say I have an answer for the datastore callbacks processor. Perhaps @ludoch has an idea?

syslogic commented 7 years ago

the build.gradle of the gradle-appengine-templates (added with the latest Android Studio wizard), does not configure the project module properly (both variables are grayed out):

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

while when becoming more explicit, the project module is actually being configured:

project.sourceCompatibility = JavaVersion.VERSION_1_7
project.targetCompatibility = JavaVersion.VERSION_1_7

alike this one can at least configure JavaCC per project module, instead the rootProject. despite it's another repository, the wrongful configuration in the template leads to follow-up issues, when using the plugin.