79 lines
2.8 KiB
Groovy
79 lines
2.8 KiB
Groovy
plugins {
|
|
id 'com.android.application'
|
|
}
|
|
|
|
def quotedBuildConfig = { String value ->
|
|
'"' + value.replace('\\', '\\\\').replace('"', '\\"') + '"'
|
|
}
|
|
def orchestratorBaseUrl = providers.gradleProperty('orchestratorBaseUrl')
|
|
.orElse(providers.environmentVariable('COGNITIVE_AGENT_BASE_URL'))
|
|
.getOrElse('http://10.0.2.2:8000')
|
|
def orchestratorApiToken = providers.gradleProperty('orchestratorApiToken')
|
|
.orElse(providers.environmentVariable('COGNITIVE_AGENT_DEVICE_API_TOKEN'))
|
|
.getOrElse('')
|
|
def orchestratorVehicleId = providers.gradleProperty('orchestratorVehicleId')
|
|
.getOrElse('denza_n7')
|
|
def orchestratorHardwareClientId = providers.gradleProperty('orchestratorHardwareClientId')
|
|
.getOrElse('hwc-n7cockpit-001')
|
|
def orchestratorExecutionTarget = providers.gradleProperty('orchestratorExecutionTarget')
|
|
// Safe by default: real CAN execution must always be selected explicitly.
|
|
.getOrElse('dry_run')
|
|
|
|
android {
|
|
namespace 'com.seeker.n7cockpit'
|
|
compileSdk 35
|
|
|
|
buildFeatures {
|
|
buildConfig true
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId 'com.seeker.n7cockpit'
|
|
minSdk 26
|
|
targetSdk 29
|
|
versionCode 2
|
|
versionName '1.1.0'
|
|
|
|
testInstrumentationRunner 'android.test.InstrumentationTestRunner'
|
|
buildConfigField 'boolean', 'FORCE_SIMULATION', 'false'
|
|
buildConfigField 'String', 'ORCHESTRATOR_BASE_URL', quotedBuildConfig(orchestratorBaseUrl)
|
|
buildConfigField 'String', 'ORCHESTRATOR_API_TOKEN', quotedBuildConfig(orchestratorApiToken)
|
|
buildConfigField 'String', 'ORCHESTRATOR_VEHICLE_ID', quotedBuildConfig(orchestratorVehicleId)
|
|
buildConfigField 'String', 'ORCHESTRATOR_HARDWARE_CLIENT_ID', quotedBuildConfig(orchestratorHardwareClientId)
|
|
buildConfigField 'String', 'ORCHESTRATOR_EXECUTION_TARGET', quotedBuildConfig(orchestratorExecutionTarget)
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
applicationIdSuffix '.remote'
|
|
minifyEnabled false
|
|
}
|
|
release {
|
|
minifyEnabled false
|
|
// Signed with the local debug keystore so the APK can be sideloaded on the
|
|
// vehicle head unit. Gateway selection is runtime auto-detection: real
|
|
// hardware always uses RealVehicleGateway / RealUsbCanGateway.
|
|
signingConfig signingConfigs.debug
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
|
|
lint {
|
|
disable 'ExpiredTargetSdkVersion'
|
|
}
|
|
|
|
testOptions {
|
|
unitTests.returnDefaultValues = true
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'dev.mobile:dadb:2.0.0'
|
|
testImplementation 'junit:junit:4.13.2'
|
|
}
|