2023-11-07 19:23:33 +08:00
|
|
|
plugins {
|
|
|
|
id 'com.android.library'
|
|
|
|
id 'maven-publish'
|
2024-02-22 14:29:24 +08:00
|
|
|
id 'kotlin-android'
|
2023-11-07 19:23:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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()
|
2024-01-12 19:06:12 +08:00
|
|
|
withJavadocJar()
|
2023-11-07 19:23:33 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
release(MavenPublication) {
|
2024-01-12 19:06:12 +08:00
|
|
|
// 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
|
2023-11-07 19:23:33 +08:00
|
|
|
groupId = 'org.opencv'
|
|
|
|
artifactId = '${PACKAGE_NAME}'
|
|
|
|
version = '${OPENCV_VERSION}'
|
|
|
|
artifact("opencv-release.aar")
|
2024-01-12 19:06:12 +08:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
}
|
2023-11-07 19:23:33 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
name = 'myrepo'
|
|
|
|
url = "${project.buildDir}/repo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-01-10 21:22:03 +08:00
|
|
|
}
|