Skip to content

Kotlin usage tracking in android builds #5060

Closed
@KristianDD

Description

@KristianDD

Is your feature request related to a problem? Please describe.

We need a way to track if Kontlin integrations is used inside NativeScript projects.

Describe the solution you'd like

Every android build to produce data about Kotlin usage and this data to be tracked if Usage Reporting is enabled.

Describe alternatives you've considered

No alternatives

Additional context

None

Acceptance Criteria

  • 1. If usage reporting is enabled every android build should produce a file with build statistics at platforms/android/analytics/build-statistics.json with content:
{
   "kotlinUsage": {
       "hasUseKotlinPropertyInApp": true,
       "hasKotlinRuntimeClasses": true
   }
}
  • 2. With attached projects the properties in the should be changed.
  • 3. An event with Action: Using Kotlin and label hasUseKotlinPropertyInAppData__true__ hasKotlinRuntimeClassesData__true. The values should be true/false according to the content of the build-statistics.json.

Make sure that usage reporting is enabled - tns usage-reporting enable. The flag --analyticsLogFile could be used for easier verification of the events that are sent.

For testing the properties use the attached project. To have hasUseKotlinPropertyInApp turn to false remove App_Resources/android/gradle.poperties. To have hasKotlinRuntimeClasses turn to false remove the jar file from App_Resources/android/libs. To test the feature use android@next.
kotlinTest.zip

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions