The Java/Kotlin compiler saves the string constant in a Modified UTF-8 byte array which has to be 16 bit addressable.
This PR adds a function that will chunk any given string based on it's Modified UTF-8 byte array representation.
This will allow us to have as few chunks as possible and also not accidentally creating a chrunk that is larger than the max size allowed in code.
Added new function chunkOnModifiedUtf8ByteSize to chunk a string based on how long it's representation as Modified UTF-8 byte array would be, as this is what the java compiler uses to store the string in code and what the variable size limitation in based upon.
Added tests for new function
Update gradleMavenPublishPlugin and agp to make CI pass.
The Java/Kotlin compiler saves the string constant in a Modified UTF-8 byte array which has to be 16 bit addressable. This PR adds a function that will chunk any given string based on it's Modified UTF-8 byte array representation.
This will allow us to have as few chunks as possible and also not accidentally creating a chrunk that is larger than the max size allowed in code.
chunkOnModifiedUtf8ByteSize
to chunk a string based on how long it's representation as Modified UTF-8 byte array would be, as this is what the java compiler uses to store the string in code and what the variable size limitation in based upon.gradleMavenPublishPlugin
andagp
to make CI pass.