Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to java 8 #1665

Merged
merged 6 commits into from
Sep 19, 2020
Merged

Switch to java 8 #1665

merged 6 commits into from
Sep 19, 2020

Conversation

jkwatson
Copy link
Contributor

And Android level 24

@@ -148,8 +146,8 @@ configure(opentelemetryProjects) {
mavenLocal()
}

sourceCompatibility = 1.7
targetCompatibility = 1.7
sourceCompatibility = 1.8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can only use the new flag if we're compiling with java9+, though, correct?

Copy link
Contributor Author

@jkwatson jkwatson Sep 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried switching to the new flag and it built locally with java 14, but failed to build on CI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we'll want to switch to using Java 11 to build on CI and drop support for building on older to take advantage of the new features. Even 15 would be ok there are usually new compilation features (often javadoc improvements) and still works on older. We would need to change the CI to have a build and separate test jdk configured with Gradle to continue testing with Java 8.

For another issue of course :)

@codecov
Copy link

codecov bot commented Sep 18, 2020

Codecov Report

Merging #1665 into master will decrease coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1665      +/-   ##
============================================
- Coverage     86.70%   86.70%   -0.01%     
  Complexity     1402     1402              
============================================
  Files           164      164              
  Lines          5545     5542       -3     
  Branches        554      553       -1     
============================================
- Hits           4808     4805       -3     
  Misses          541      541              
  Partials        196      196              
Impacted Files Coverage Δ Complexity Δ
...i/src/main/java/io/opentelemetry/trace/Status.java 92.53% <50.00%> (-0.11%) 16.00 <2.00> (ø)
.../metrics/aggregator/DoubleLastValueAggregator.java 100.00% <100.00%> (ø) 7.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51e93f7...458d616. Read the comment docs.

signature "org.codehaus.mojo.signature:java17:1.0@signature"
signature "net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature"
signature "org.codehaus.mojo.signature:java18:1.0@signature"
signature "net.sf.androidscents.signature:android-api-level-24:7.0_r2@signature"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okhttp uses API 21 signature and once before we had discussed following what they do to get Java 8 support in a way that follows the most used Android library. Is it possible to stick with that?

https://github.com/square/okhttp/blob/master/build.gradle#L153

Though if we just avoid CompletableFuture I think any signature there should be fine too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion on this one. If CompletableFuture is the only thing we lose between 21 and 24 then I'm cool with that.

@@ -148,8 +146,8 @@ configure(opentelemetryProjects) {
mavenLocal()
}

sourceCompatibility = 1.7
targetCompatibility = 1.7
sourceCompatibility = 1.8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we'll want to switch to using Java 11 to build on CI and drop support for building on older to take advantage of the new features. Even 15 would be ok there are usually new compilation features (often javadoc improvements) and still works on older. We would need to change the CI to have a build and separate test jdk configured with Gradle to continue testing with Java 8.

For another issue of course :)

Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can revisit the Android API level later let's go ahead and merge first!

@anuraaga anuraaga merged commit 27090b8 into open-telemetry:master Sep 19, 2020
dengliming pushed a commit to dengliming/opentelemetry-java that referenced this pull request Sep 19, 2020
* switch to java 8

* update the READMEs and use Object.equals in a couple of cases to test that we're really compiling for java 8/android 24.

* formatting

* use the newer release options for the build, and change the int test to not be java 7 any more.

* switch back to source/target compatibility

* sure wish I could run docker locally to test this out.
@jkwatson jkwatson deleted the java8 branch September 23, 2020 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants