You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
2.0 KiB
58 lines
2.0 KiB
2 months ago
|
plugins {
|
||
|
id 'com.android.application'
|
||
|
}
|
||
|
|
||
|
android {
|
||
|
namespace 'com.intel.realsense.camera'
|
||
|
compileSdk defaultCompileSdkVersion
|
||
|
|
||
|
defaultConfig {
|
||
|
applicationId "com.intel.realsense.camera"
|
||
|
minSdk defaultMinSdkVersion
|
||
|
targetSdk defaultTargetSdkVersion
|
||
|
versionCode 5
|
||
|
versionName "0.0.5"
|
||
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||
|
}
|
||
|
buildTypes {
|
||
|
release {
|
||
|
minifyEnabled false
|
||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
def getFwVersion(String productLine) {
|
||
|
try {
|
||
|
String versionsFile = new File("$projectDir/../../../../common/fw/firmware-version.h").text
|
||
|
def regex = productLine + " \"(.*)\""
|
||
|
def matcher = ( versionsFile =~ regex )
|
||
|
return matcher[0][1]
|
||
|
}catch(e){
|
||
|
println(e)
|
||
|
return "Unknown FW version"
|
||
|
}
|
||
|
}
|
||
|
|
||
|
task downloadFirmware() {
|
||
|
mkdir "$projectDir/src/main/res/raw"
|
||
|
|
||
|
def d4xxFwVersion = getFwVersion('D4XX_RECOMMENDED_FIRMWARE_VERSION')
|
||
|
def d4xxFile = new File("$projectDir/src/main/res/raw/fw_d4xx.bin")
|
||
|
if (!d4xxFile.exists()) {
|
||
|
println("downloading D4xx fw: " + d4xxFwVersion)
|
||
|
new URL('https://librealsense.intel.com/Releases/RS4xx/FW/D4XX_FW_Image-' + d4xxFwVersion + '.bin').withInputStream{ i -> d4xxFile.withOutputStream{ it << i }}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
dependencies {
|
||
|
implementation project(':librealsense')
|
||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||
|
implementation "androidx.appcompat:appcompat:$appcompatVersion"
|
||
|
implementation "androidx.constraintlayout:constraintlayout:$constraintlayoutVersion"
|
||
|
implementation "com.google.android.material:material:$materialVersion"
|
||
|
testImplementation "junit:junit:$junitVersion"
|
||
|
androidTestImplementation "androidx.test.ext:junit:$androidextjunitVersion"
|
||
|
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoCoreVersion"
|
||
|
}
|