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

Integrate Android example #275

Merged
merged 19 commits into from
May 17, 2023

Conversation

Nashatyrev
Copy link
Collaborator

@Nashatyrev Nashatyrev commented May 15, 2023

Adds Android example to the gradle build to ensure jvm-Libp2p is interoperable with Android SDK:

  • Upgrade Gradle version to 8.0
  • Refactor Android example
  • Add 2 Android gradle plugins (without applying) to the root build (haven't managed to isolate them in Android example module)
  • Add android.useAndroidX property to the root gradle.properties (for some reason defining this property in the Android submodule doesn't work)
  • Add libp2p.gradle.custom per project property which indicates whether common gradle code for submodules should be skipped (set it up for Adnroid example)
  • Move Maven repositories definitions to settings.gradle
  • In the settings.gradle detect if Android SDK is installed and conditionally include :examples:android-chatter module
    • check if env var ANDROID_HOME is defined
    • or sdk.dir property is defined in local.properties file (created by AndroidStudio)
  • Add Setup Android SDK GitHub action

As a result:

  • When no Android SDK is installed:
    • Gradle build works as before, Android example is not included into the build
    • The project is imported into IntelliJ IDEA as before: Android example is not included as a module
  • When Android SDK is installed and env var ANDROID_HOME is defined, Android example is build by the gradle
  • When the project is imported to AndroidStudio (local.properties file is automatically created), the Android example module is included and can be executed

Fix #270

@Nashatyrev Nashatyrev marked this pull request as ready for review May 15, 2023 15:31
@Nashatyrev Nashatyrev changed the base branch from develop to v1.0.0 May 15, 2023 15:48
Copy link
Collaborator

@StefanBratanov StefanBratanov left a comment

Choose a reason for hiding this comment

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

LGTM

@Nashatyrev Nashatyrev merged commit 98df084 into libp2p:v1.0.0 May 17, 2023
@Nashatyrev
Copy link
Collaborator Author

Part of #272

@Nashatyrev Nashatyrev deleted the feature/integrate-android-example branch May 17, 2023 15:20
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.

Add Android example as a gradle module
2 participants