-
Notifications
You must be signed in to change notification settings - Fork 2
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
Upgrade to Java 11 #107
Upgrade to Java 11 #107
Conversation
c8c55d7
to
1a7bfe5
Compare
023043b
to
c62c41b
Compare
Some changes in this commit: * Non scala changes for java upgrade * Remove jackson mapper * Add notes for testing on CODE
c62c41b
to
6b346d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the extra documentation in docs/testing/user-deletion.md
& README.md
, brilliant work!
New files being added...
There's 3 files being added with this PR, that I'm not sure of why they're being added:
- cdk/yarn.lock
- mobile-save-for-later-user-deletion/template.yml
- mobile-save-for-later/template.yml
Are the template.yml ones auto-generated - do they need to be committed in order for deploy to work, or are they involved in manual deploy steps? I'm kind of surprised to see them if this project is using GuCDK- maybe they should be added to .gitignore
? It would reduce the size of this diff if they were excluded.
MergeFilesStrategy
This is the biggest code change included in this PR - as noted in build.sbt
, could we add some context on why the change is necessary? Is it because sbt-assembly
has been upgraded?
BTW I actually will be around in the office this morning if you want to chat/pair on any of this in person!
build.sbt
Outdated
case "META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat" => | ||
new MergeFilesStrategy | ||
case PathList(ps @ _*) if ps.last equalsIgnoreCase "Log4j2Plugins.dat" => | ||
import java.io.FileInputStream | ||
import java.io.FileOutputStream | ||
import org.apache.logging.log4j.core.config.plugins.processor.PluginCache | ||
|
||
import scala.collection.JavaConverters.asJavaEnumerationConverter | ||
|
||
import sbt.io.{IO, Using} | ||
import sbtassembly.Assembly.Dependency | ||
|
||
CustomMergeStrategy("Log4j2Plugins") { conflicts => | ||
val dependencyStreamResource = | ||
Using.resource((dependency: Dependency) => dependency.stream()) | ||
val tempDir = "target/log4j2-plugin-cache" | ||
val urls = conflicts | ||
.map { conflict => | ||
dependencyStreamResource(conflict) { is => | ||
val file = new File( | ||
s"$tempDir/${conflict.module.get.jarName}-Log4j2Plugins.dat" | ||
) | ||
IO.write(file, IO.readBytes(is)) | ||
file.toURI.toURL | ||
} | ||
} | ||
val aggregator = new PluginCache() | ||
aggregator.loadCacheFiles(urls.toIterator.asJavaEnumeration) | ||
val pluginCache = new File(s"$tempDir/Log4j2Plugins.dat") | ||
val pluginCacheOutputStream = new FileOutputStream(pluginCache) | ||
aggregator.writeCache(pluginCacheOutputStream) | ||
pluginCacheOutputStream.close() | ||
Right( | ||
Vector( | ||
JarEntry( | ||
conflicts.head.target, | ||
() => new FileInputStream(pluginCache) | ||
) | ||
) | ||
) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this chunk of code has come from project/MergeFilesStrategy.scala
, and taken on some more modifications?
It's quite a big and obscure bit of code though, so I feel like keeping it in its own file in MergeFilesStrategy.scala
is not a bad idea - we should probably include some explanation or references for it (like, where did we get this code, and what prompted the changes to it that are occurring now?)
Thanks for the thorough feedback, much appreciated :). Yes I'm in the office today, sitting on the 4th floor, a quick chat would be great if you have the time. |
Co-authored-by: Roberto Tyley <[email protected]>
Co-authored-by: Roberto Tyley <[email protected]>
Co-authored-by: Roberto Tyley <[email protected]>
Co-authored-by: Roberto Tyley <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing all the fixes! Lovely work 👍
What does this change?
This updates the run time environment of the app to Java 11
How to test
Using the iOS Simulator
Using the lambda console