Skip to content

Convert the unit test from java to kotlin #10702

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

Merged
merged 3 commits into from
May 8, 2025
Merged

Convert the unit test from java to kotlin #10702

merged 3 commits into from
May 8, 2025

Conversation

phaiting
Copy link
Contributor

@phaiting phaiting commented May 6, 2025

Summary

This change converts the unit test from java to kotlin.

Test plan

./gradlew :executorch_android:testDebugUnitTest

@phaiting phaiting requested a review from kirklandsign as a code owner May 6, 2025 00:24
Copy link

pytorch-bot bot commented May 6, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/10702

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 44e263e with merge base 578358b (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 6, 2025
@@ -34,6 +35,9 @@ android {
resources.srcDirs += [ 'src/androidTest/resources' ]
}
}
kotlinOptions {
jvmTarget = '17'
Copy link
Contributor

Choose a reason for hiding this comment

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

Right now we have

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

is 1.8 possible? Otherwise we make everything 17?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we should make it to use 1.8 for kotlin compiler as well for the compatibility, will update.

@phaiting
Copy link
Contributor Author

phaiting commented May 6, 2025

@pytorchbot label "topic: not user facing"

@kirklandsign
Copy link
Contributor

* What went wrong:
Execution failed for task ':executorch_android:checkDebugAndroidTestAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > 2 issues were found when checking AAR metadata:
     
       1.  Dependency 'androidx.core:core:1.16.0' requires libraries and applications that
           depend on it to compile against version 35 or later of the
           Android APIs.
     
           :executorch_android is currently compiled against android-34.
     
           Recommended action: Update this project to use a newer compileSdk
           of at least 35, for example 35.
     
           Note that updating a library or application's compileSdk (which
           allows newer APIs to be used) can be done separately from updating
           targetSdk (which opts the app in to new runtime behavior) and
           minSdk (which determines which devices the app can be installed
           on).
     
       2.  Dependency 'androidx.core:core-ktx:1.16.0' requires libraries and applications that
           depend on it to compile against version 35 or later of the
           Android APIs.
     
           :executorch_android is currently compiled against android-34.
     
           Recommended action: Update this project to use a newer compileSdk
           of at least 35, for example 35.
     
           Note that updating a library or application's compileSdk (which
           allows newer APIs to be used) can be done separately from updating

@phaiting
Copy link
Contributor Author

phaiting commented May 7, 2025

Looks like all CI jobs succeeded now.

@phaiting phaiting merged commit d25ce54 into main May 8, 2025
85 checks passed
@phaiting phaiting deleted the haiting-test branch May 8, 2025 20:42
jhelsby pushed a commit to jhelsby/executorch that referenced this pull request May 9, 2025
### Summary
This change converts the unit test from java to kotlin.

### Test plan
./gradlew :executorch_android:testDebugUnitTest

---------

Co-authored-by: Haiting Pu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants