mirror of
https://github.com/opencv/opencv.git
synced 2024-12-17 02:48:01 +08:00
1e190b3094
Modified AAR script: added javadoc to Android Maven #24849 Modified AAR script. Now the script creates 2 maven repos. The first repo contains sources jar, javadoc jar and AAR without cpp libraries. The second repo contains modified AAR with cpp libraries. The script merges two repos into one. ### 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 <alexander.lyulkov@opencv.ai> Co-authored-by: Alexander Smorkalov <alexander.smorkalov@xperience.ai>
116 lines
3.0 KiB
Plaintext
116 lines
3.0 KiB
Plaintext
plugins {
|
|
id 'com.android.library'
|
|
id 'maven-publish'
|
|
}
|
|
|
|
android {
|
|
namespace 'org.opencv'
|
|
compileSdk ${COMPILE_SDK}
|
|
|
|
defaultConfig {
|
|
minSdk ${MIN_SDK}
|
|
targetSdk ${TARGET_SDK}
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
externalNativeBuild {
|
|
cmake {
|
|
cppFlags ""
|
|
arguments "-DANDROID_STL=${LIB_TYPE}"
|
|
}
|
|
}
|
|
ndk {
|
|
abiFilters ${ABI_FILTERS}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_${JAVA_VERSION}
|
|
targetCompatibility JavaVersion.VERSION_${JAVA_VERSION}
|
|
}
|
|
externalNativeBuild {
|
|
cmake {
|
|
path file('src/main/cpp/CMakeLists.txt')
|
|
}
|
|
}
|
|
buildFeatures {
|
|
prefabPublishing true
|
|
buildConfig true
|
|
}
|
|
prefab {
|
|
${LIB_NAME} {
|
|
headers "src/main/cpp/include"
|
|
}
|
|
}
|
|
sourceSets {
|
|
main {
|
|
java.srcDirs = ['src/main/java']
|
|
//jniLibs.srcDirs = ['libs']
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
singleVariant('release') {
|
|
withSourcesJar()
|
|
withJavadocJar()
|
|
}
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
release(MavenPublication) {
|
|
// Builds aar, sources jar and javadoc jar from project sources and creates maven
|
|
groupId = 'org.opencv'
|
|
artifactId = '${PACKAGE_NAME}'
|
|
version = '${OPENCV_VERSION}'
|
|
afterEvaluate {
|
|
from components.release
|
|
}
|
|
}
|
|
modified(MavenPublication) {
|
|
// Creates maven from opencv-release.aar
|
|
groupId = 'org.opencv'
|
|
artifactId = '${PACKAGE_NAME}'
|
|
version = '${OPENCV_VERSION}'
|
|
artifact("opencv-release.aar")
|
|
pom {
|
|
name = "OpenCV"
|
|
description = "Open Source Computer Vision Library"
|
|
url = "https://opencv.org/"
|
|
licenses {
|
|
license {
|
|
name = "The Apache License, Version 2.0"
|
|
url = "https://github.com/opencv/opencv/blob/master/LICENSE"
|
|
}
|
|
}
|
|
developers {
|
|
developer {
|
|
id = "admin"
|
|
name = "OpenCV Team"
|
|
email = "admin@opencv.org"
|
|
}
|
|
}
|
|
scm {
|
|
connection = "scm:git:https://github.com/opencv/opencv.git"
|
|
url = "https://github.com/opencv/opencv"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
name = 'myrepo'
|
|
url = "${project.buildDir}/repo"
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
}
|