On Wednesday, February 17, 2016 at 9:13:43 PM UTC+1, Goktug Gokdogan wrote:
>
> I think you didn't understand what I said. Let me try to clarify:
>
> "For any reason, if community wants to run the GWT 2.8 SDK in Java 7 
> source level *(i.e. gwtc sourcelevel 7)*, they can theoretically do it by 
> supplying *a java7 compatible JRE emulation* without any compiler/SDK 
> changes *(but just setting the gwtc sourcelevel 7)*. That's why I didn't 
> originally remove Java7 option from the SourceLevel flag.
> By removing the flag (which seems submitted now), the community will not 
> have that option *(i.e. they need also supply a modified compiler 
> together with the emulation)*."
>
> This may never happen but keeping the flag was cheap so I kept it.
>

Thanks for the reminder Goktug.

We had a quick discussion with Manolo about whether we should remove the 
-sourceLevel entirely, remove the 1.7 value only (only keeping 1.8), or 
"aliasing" 1.7 to 1.8 (with a warning).
The immediate goal was to make it possible to build GWT with a JDK 7. 
Things can still change back.

Let's see what we had and we could have (incl. what we have now):
The problem we were having is that -sourceLevel defaulted to the level of 
the Java version being used to run GWTC, and defaulting to 7 as a last 
resort, which means that with a Java 7 (or 6) VM you'd have to pass 
"-sourceLevel 8" to make it work with the new Java 8-only emul.

We have (had) several options:

   - leave it like that, forcing every Java 7 user to explicitly pass 
   "-sourceLevel 8". They'd see it as a breaking change (which it could be, 
   according to Daniel in this thread) and wouldn't understand why there's a 
   "7" value that doesn't work. As a user, I'd probably see it as a bug.
   - change the default value to Java 8 (independently of the current JVM). 
This 
   is backwards-compatible with people passing "-sourceLevel 8", breaking 
   those passing "-sourceLevel 7" with cryptic errors due to GWT being 
   incapable of compiling the Java 8-only emul, and "transparently upgrades" 
   others to sourceLevel 8.
   - remove the "7" value, only leaving "8" as a valid value. Given that 
   the default value depends on the current JVM and always has a valid 
   fallback, that means GWT always uses Java 8, but starts to fail if you pass 
   a sourceLevel with a value different from 8 or 1.8. This is 
   backwards-compatible with people passing "-sourceLevel 8", breaking those 
   passing "-sourceLevel 7" with an explicit error that this value is not 
   supported, and "transparently upgrades" others to sourceLevel 8. This is 
   what we did.
   - remove the -sourceLevel flag entirely; this would break many, many 
   people; including those passing a "compatible" sourceLevel value.
   - alias the "-sourceLevel 7" to "-sourceLevel 8". In many cases this 
   wouldn't break builds, except for those cases where people run into 
   differences between Java 7 and Java 8, as Daniel mentioned. Those people 
   possibly won't understand why their explicit "-sourceLevel 7" isn't honored 
   (even if we issue a warning).
   - deprecate -sourceLevel and make it a no-op. This "transparently 
   upgrades" everyone to Java 8, and is similar to the above case where 
   "-sourceLevel 7" is aliased to "-sourceLevel 8"

I think we chose the "least bad" of those options, by being explicit. 
People using Java 7 *and* using an explicit sourceLevel should be aware 
that JavaC and GWTC would use different rules, so let's force them to be 
extra-explicit.

Note that whether you pass -sourceLevel or not, and with which value 
depends on how you call GWTC:
In Maven, you have to configure your project with an explicit source level 
version (even for JavaC) unless you're OK with Java 1.4 or 1.5 (depending 
on the version of the maven-compiler-plugin, whose default version depends 
on the version of Maven you're using), and depending on how you configure 
it, it could instruct the gwt-maven-plugin (both flavors) to pass an 
explicit -sourceLevel to GWTC. This would break people using Java 7. In 
other words, it's quite likely that many projects (but far from all) have a 
configured (possibly implicitly) sourceLevel matching their JavaC source 
level.
Gradle (gwt-gradle-plugin) only passes a sourceLevel if configured 
explicitly (through a specific property), independently of the source level 
configured for JavaC.
Others (Ant, Buck, etc.) probably have to pass arguments explicitly.
I have no idea what IDEs (Eclipse, IntelliJ) do.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/7d940cf7-d743-4845-9e82-70567c52eb27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to