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

Add support for compiling to Kotlin/JS targets #146

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

farmerbb
Copy link
Contributor

@farmerbb farmerbb commented Oct 29, 2024

This PR adds support for compiling to Kotlin/JS targets.

In order to get compilation working, the following dependencies have been upgraded:

  • Gradle: 7.5.2 -> 8.10.2
  • Kotlin: 1.7.0 -> 1.9.24
  • Android Gradle Plugin: 7.4.2 -> 8.7.1
  • Dokka: 1.8.10 -> 1.9.10
  • JDK: 11 -> 17
    • NOTE: This is a requirement of the Android Gradle Plugin version bump, and does not affect the ability for apps to implement the SDK on earlier Java versions. The Kotlin JVM target is still set to 1.8.

@Bohdan-Kim
Copy link
Collaborator

./gradlew build command fails on this branch
image

@ToxicBakery
Copy link
Contributor

I've added changes to support 1.8 compilation but I would like to also add that this doesn't really seem valuable. JRE 8 is ancient and support for using it anywhere internet facing is rapidly dwindling in favor of 11,17, and 21.

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.sdk.growthbook"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please clarify why package was removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was done to resolve the following warning during build time:

> Task :NetworkDispatcherKtor:processDebugManifest
package="com.sdk.growthbook" found in source AndroidManifest.xml: /home/farmerbb/growthbook-kotlin/NetworkDispatcherKtor/src/androidMain/AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

Having the package attribute in the manifest results in an error when using Android Gradle Plugin 8.0.0 or higher.
However, it doesn't matter as much now that we've downgraded back to 7.4.2 for this PR.

@vazarkevych vazarkevych changed the base branch from main to release/1.1.63 November 7, 2024 16:08
@vazarkevych vazarkevych merged commit 985a450 into growthbook:release/1.1.63 Nov 7, 2024
1 check passed
@farmerbb farmerbb deleted the for-upstream-1 branch November 7, 2024 17:50
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.

4 participants