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

feat: compose sdk #149

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

feat: compose sdk #149

wants to merge 17 commits into from

Conversation

CAMOBAP
Copy link
Collaborator

@CAMOBAP CAMOBAP commented Apr 10, 2024

Open question

jitpack doesn't allow to customize published dependency names. For now, we have com.github.hcaptcha:hcaptcha-android-sdk:x.y.z which will become com.github.hcaptcha.hcaptcha-android-sdk:sdk:x.y.z and one more artifact will be added com.github.hcaptcha.hcaptcha-android-sdk:compose:u.v.w

There are two possible solutions to this problem:

  1. move out of jitpack to mvncentral or other repository
  2. create a separate GitHub repository something like hcaptcha-android-jetpack

Both approaches have their benefits and drawbacks:

  • N1 - no extra repository need and configuration will become more comples (need to find a way to disable jutpack publishing for compose module)
  • N2 - build system stays clean
  • N2 - sdk and compose more isolated, but we cannot share configuration and build system scripts

Personally to me there is no ideal solution but N2 looks a bit better

@CAMOBAP CAMOBAP self-assigned this Apr 10, 2024
Copy link

github-actions bot commented Apr 10, 2024

Diffuse report:

OLD: sdk-main.aar
NEW: sdk-pr.aar

 AAR      │ old       │ new       │ diff   
──────────┼───────────┼───────────┼────────
      jar │  51.9 KiB │  51.7 KiB │ -120 B 
 manifest │     411 B │     411 B │    0 B 
      res │  78.3 KiB │  78.3 KiB │    0 B 
    other │     930 B │     930 B │    0 B 
──────────┼───────────┼───────────┼────────
    total │ 131.4 KiB │ 131.3 KiB │ -120 B 

 JAR     │ old │ new │ diff       
─────────┼─────┼─────┼────────────
 classes │  37 │  37 │  0 (+0 -0) 
 methods │ 507 │ 507 │  0 (+3 -3) 
  fields │ 163 │ 162 │ -1 (+1 -2)
AAR
 size     │ diff   │ path          
──────────┼────────┼───────────────
 51.7 KiB │ -120 B │ ∆ classes.jar 
──────────┼────────┼───────────────
 51.7 KiB │ -120 B │ (total)
JAR
METHODS:

   old │ new │ diff      
  ─────┼─────┼───────────
   507 │ 507 │ 0 (+3 -3) 
  
  + com.hcaptcha.sdk.HCaptchaWebViewHelper <init>(Handler, Context, HCaptchaConfig, HCaptchaInternalConfig, IHCaptchaVerifier, HCaptchaWebView)
  + com.hcaptcha.sdk.HCaptchaWebViewHelper access_200(HCaptchaWebViewHelper) → IHCaptchaVerifier
  + com.hcaptcha.sdk.HCaptchaWebViewHelper_HCaptchaWebClient <init>(HCaptchaWebViewHelper, Handler)
  
  - com.hcaptcha.sdk.HCaptchaWebViewHelper <init>(Handler, Context, HCaptchaConfig, HCaptchaInternalConfig, IHCaptchaVerifier, HCaptchaStateListener, HCaptchaWebView)
  - com.hcaptcha.sdk.HCaptchaWebViewHelper getListener() → HCaptchaStateListener
  - com.hcaptcha.sdk.HCaptchaWebViewHelper_HCaptchaWebClient <init>(HCaptchaWebViewHelper, Handler, HCaptchaStateListener)
  

FIELDS:

   old │ new │ diff       
  ─────┼─────┼────────────
   163 │ 162 │ -1 (+1 -2) 
  
  + com.hcaptcha.sdk.HCaptchaDialogFragment listener: HCaptchaStateListener
  
  - com.hcaptcha.sdk.HCaptchaWebViewHelper listener: HCaptchaStateListener
  - com.hcaptcha.sdk.HCaptchaWebViewHelper_HCaptchaWebClient listener: HCaptchaStateListener

@DSergiu DSergiu changed the title Feature/compose sdk feat: compose sdk Apr 16, 2024
Copy link

github-actions bot commented Apr 17, 2024

Benchmark report:

Test name Time ms. (median) Allocations (median)
com.hcaptcha.sdk.HCaptchaBenchmarkTest.EMULATOR_UNLOCKED_benchmarkInvisibleVerification +342.86 -6
com.hcaptcha.sdk.HCaptchaBenchmarkTest.EMULATOR_UNLOCKED_benchmarkInvisibleVerificationColdRun +401.46 +101
com.hcaptcha.sdk.HCaptchaBenchmarkTest.EMULATOR_UNLOCKED_benchmarkInvisibleSetup -0.57 +97
com.hcaptcha.sdk.HCaptchaDebugInfoTest.EMULATOR_UNLOCKED_benchmarkDebugInfo -4.63 +556
com.hcaptcha.sdk.HCaptchaDebugInfoTest.EMULATOR_UNLOCKED_benchmarkDebugSys +32.83 +1
com.hcaptcha.sdk.HCaptchaWebViewHelperTest.EMULATOR_UNLOCKED_benchmarkWebViewLoad +548.42 +97

@CAMOBAP CAMOBAP marked this pull request as draft April 18, 2024 13:38
@CAMOBAP
Copy link
Collaborator Author

CAMOBAP commented Apr 18, 2024

I will proceed with one repository solution and implement test publishing and

  • rename module compose -> sdk-compose
  • move compose example as separated module example-app-compose
  • Add a note to README about dependency name changes

@CAMOBAP CAMOBAP marked this pull request as ready for review May 16, 2024 21:43
Copy link
Contributor

@DSergiu DSergiu May 20, 2024

Choose a reason for hiding this comment

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

Should be deleted? example unit tests

Copy link

sonarcloud bot commented May 20, 2024

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.

None yet

2 participants