-
Notifications
You must be signed in to change notification settings - Fork 739
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
Set up dokka to generate SDK documentation and cleanup the API #5744
Conversation
Run `./gradlew matrix-sdk-android:dokkaHtml` to generate the Html documentation of the Matrix Android SDK
Classes marked with `internal` will be excluded from Kdoc.
It is used by the app. Make the extensions internal
83134ab
to
23d2a29
Compare
@@ -73,6 +75,10 @@ android { | |||
|
|||
kotlinOptions { | |||
jvmTarget = "11" | |||
freeCompilerArgs += [ | |||
// Disabled for now, there are too many errors. Could be handled in another dedicated PR |
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.
👍
|
||
/** | ||
* Data model for response to [KeysBackup.getKeysBackupTrust()]. | ||
* TODO Members should be only val |
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.
could be handy to track these todos as github issues (if they aren't already)
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.
Yes, you are right. Moar issues!
@@ -65,10 +63,8 @@ internal class SyncResponseHandler @Inject constructor( | |||
private val aggregatorHandler: SyncResponsePostTreatmentAggregatorHandler, | |||
private val cryptoService: DefaultCryptoService, | |||
private val tokenStore: SyncTokenStore, | |||
private val lightweightSettingsStorage: LightweightSettingsStorage, |
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 these are unused?
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.
yep
context: Context, | ||
private val matrixConfiguration: MatrixConfiguration | ||
) { | ||
) : LightweightSettingsStorage { |
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.
👍
@@ -28,21 +29,20 @@ import javax.inject.Inject | |||
* on the sdk without using the database. This should be used just for sdk/user preferences and | |||
* not for large data sets | |||
*/ | |||
|
|||
class LightweightSettingsStorage @Inject constructor( | |||
internal class DefaultLightweightSettingsStorage @Inject constructor( |
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.
not for this PR but I wonder if these settings should be client side rather than in the SDK
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.
They are meant to be SDK side, client side we have vectorPreferences. You can't read vectorPreferences
from SDK side. It's mainly for dynamic settings changes, MatrixConfiguration cannot be changed dynamically.
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.
The main problem to me, is that those settings are SDK scope and should be session scope.
# | ||
|
||
### You should not use code from internal SDK package. Either move them to the API package, or add a proper API to access this code, and add internal keyword SDK side. | ||
import org.matrix.android.sdk.internal |
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.
💯
@@ -265,6 +264,8 @@ class DebugMenuActivity : VectorBaseActivity<ActivityDebugMenuBinding>() { | |||
} | |||
} | |||
} | |||
// Ensure developer will see that this cannot work anymore | |||
error("toQrCodeData() is now internal") |
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.
is the qrscanning debug option still helpful if we can't log the toQrCodeData
result?
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.
Probably not, hence not used a lot nowadays. I guess if we want to test it we can uncomment the code and remove the internal
keyword. Not sure what was the best approach to avoid to do that for that specific case.
)) | ||
} | ||
}) | ||
keysBackupService.computePrivateKey( |
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'm assuming deriveKey
and keysBackupService.computePrivateKey
are equivalent
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.
True, new API added for this specific purpose: 3735ac3
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.
great clean up! 💯
some minor comments/questions but they could be handled in another PR to help get this through faster
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 the PR, I only have one comment. There are a lot of changes here but most of the changes are straight forward. I also run the app & generated the dokka file I didn't observe any issue
@@ -22,6 +22,7 @@ buildscript { | |||
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5' | |||
classpath "com.likethesalad.android:stem-plugin:2.0.0" | |||
classpath 'org.owasp:dependency-check-gradle:7.0.4.1' | |||
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.6.10" |
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.
We do not need this while it is already defined in the matrix-sdk-android/build.gradle
. I also tested it and works fine without it
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.
Ah, you are right. I will keep this one and remove the line in the matrix sdk build.gradle file, if ever we need to generate documentation for another module (such as matrix-sdk-android-flow for instance)
…ready declared in the main build.gradle file.
Type of change
Content
internal
package toapi
packageinternal
internal
package 🙈Motivation and context
#5726 (this PR does not close it)
Screenshots / GIFs
Tests
Tested devices
Checklist