- Android Studio
There is automated testing for every push
command through github actions (see .github/workflows/ci.yml
).
You can manually test before pushing by running both unit tests and instrumented tests:
./gradlew sdk:test
./gradlew test:connectedAndroidTest
./gradlew test:connectedAndroidTest -P testingMinimizedBuild=true -P android.enableR8.fullMode=false
-
{normal,invisible,compact} -> verify -> success -> mark used
-
{normal,invisible,compact} -> verify -> success -> token timeout
-
{normal,invisible,compact} -> verify -> touch outside -> challenge closed
-
{normal,invisible,compact} -> verify -> back button -> challenge closed
-
{normal,invisible,compact} -> verify -> rotate device (recreate activity, i.e. without
android:configChanges
inAndroidManifest.xml
) -> hcaptcha gone, no callbacks fired -
{normal,invisible,compact} -> verify -> send app to background -> open app from history again -> hcaptcha is displayed
-
{hide dialog} -> verify -> token obtained -> mark used
- Proguard configuration update
- API Changes
- Breaking Changes
To install the SDK for a specific pull request (PR) or git branch in the same way as end-developers do, i.e. as a Gradle dependency, follow the steps below:
- Update your dependency in
example-app/build.gradle
by replacing:dependencies { // ... implementation project(path: ':sdk') // ... }
with:
dependencies {
// ...
implementation "com.github.hCaptcha.hcaptcha-android-sdk:sdk:BRANCH_NAME-SNAPSHOT"
// or
implementation "com.github.hCaptcha.hcaptcha-android-sdk:sdk:pull/PR_NUMBER/head-SNAPSHOT"
}
- Build
example-app
forrelease
variant - Test
example-app
NOTE: JitPack builds dependencies on-demand, i.e. once Gradle requests the dependency. If the dependency for the specified PR branch has not been built yet, Gradle may fail with a timeout error. It can take 5-10 minutes for JitPack to build and make the dependency available to Gradle, so please be patient.
To publish a new version follow the next steps:
- Bump versions in the
sdk/build.gradle
file:android.defaultConfig.versionCode
: increment by 1 (next integer)android.defaultConfig.versionName
: Semantic Versioning
- Use the same
versionCode
andversionName
forcompose-sdk/build.gradle
- Update
CHANGES.md
with changes since last version - Create a Github Release with the SAME version from step 1 (without a prefix such as
v
)- JitPack's automatic process will be triggered upon first installation of the new package version
Install lombok plugin from mplushnikov/lombok-intellij-plugin#1130 (comment)