From 915e677866d1bf3f6858424abab6467472b4d11d Mon Sep 17 00:00:00 2001 From: alexlyulkov Date: Thu, 22 Feb 2024 09:29:24 +0300 Subject: [PATCH] Merge pull request #24884 from alexlyulkov:al/aar-add-kotlin Added kotlin classes to AAR #24884 The resulting maven repo doesn't have kotlin-plugin dependency, and it works fine out of the box: Android Kotlin projects already have kotlin-plugin dependency, Android Java projects ignore kotlin classes. Details on KGP versions: https://kotlinlang.org/docs/gradle-configure-project.html#apply-the-plugin ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake Co-authored-by: Alexander Lyulkov Co-authored-by: Alexander Smorkalov --- platforms/android/aar-template/OpenCV/build.gradle.template | 1 + platforms/android/aar-template/build.gradle | 1 + 2 files changed, 2 insertions(+) diff --git a/platforms/android/aar-template/OpenCV/build.gradle.template b/platforms/android/aar-template/OpenCV/build.gradle.template index 10c8e64aa7..b12802063b 100644 --- a/platforms/android/aar-template/OpenCV/build.gradle.template +++ b/platforms/android/aar-template/OpenCV/build.gradle.template @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'maven-publish' + id 'kotlin-android' } android { diff --git a/platforms/android/aar-template/build.gradle b/platforms/android/aar-template/build.gradle index decab5bc55..280dab5da7 100644 --- a/platforms/android/aar-template/build.gradle +++ b/platforms/android/aar-template/build.gradle @@ -1,4 +1,5 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { id 'com.android.library' version '7.3.0' apply false + id 'org.jetbrains.kotlin.android' version '1.8.20' apply false }