diff --git a/src/android/CommandSystem/build.gradle b/src/android/CommandSystem/build.gradle index f73890d5..515f5cfc 100644 --- a/src/android/CommandSystem/build.gradle +++ b/src/android/CommandSystem/build.gradle @@ -4,7 +4,11 @@ plugins { id 'maven-publish' } // So far I'm unable to get this to be set dynamically ... -project.ext.GRADLE_DOTNET_VERSION = "7.0.10" +//project.ext.GRADLE_DOTNET_VERSION = "7.0.9" +def localProperties = new Properties() +localProperties.load(new FileInputStream(rootProject.file("local.properties"))) +project.ext.GRADLE_DOTNET_VERSION = localProperties.getProperty("dotnet.version") + apply from: 'copyDependentBinaries.gradle' android { diff --git a/src/android/app/build.gradle b/src/android/app/build.gradle index b2c59bb1..4f0a654d 100644 --- a/src/android/app/build.gradle +++ b/src/android/app/build.gradle @@ -3,6 +3,9 @@ plugins { id 'org.jetbrains.kotlin.android' } +def localProperties = new Properties() +localProperties.load(new FileInputStream(rootProject.file("local.properties"))) + android { namespace 'com.microsoft.commandsystemsample' compileSdk 33 @@ -18,6 +21,15 @@ android { } buildTypes { + // TODO: there has to be a way to be dry with these settings see https://developer.android.com/build/gradle-tips#share-properties-with-the-manifest + debug { + buildConfigField("String", "SPEECH_KEY", "\"" + localProperties['speech.key'] + "\"") + buildConfigField("String", "SPEECH_REGION", "\"" + localProperties['speech.region'] + "\"") + buildConfigField("String", "CLU_KEY", "\"" + localProperties['clu.key'] + "\"") + buildConfigField("String", "CLU_ENDPOINT", "\"" + localProperties['clu.endpoint'] + "\"") + buildConfigField("String", "CLU_PROJECT_NAME", "\"" + localProperties['clu.project.name'] + "\"") + buildConfigField("String", "CLU_DEPLOYMENT_NAME", "\"" + localProperties['clu.deployment.name'] + "\"") + } release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' diff --git a/src/android/app/src/main/java/com/microsoft/commandsystemsample/MainActivity.kt b/src/android/app/src/main/java/com/microsoft/commandsystemsample/MainActivity.kt index 183cb0f8..b13cdffe 100644 --- a/src/android/app/src/main/java/com/microsoft/commandsystemsample/MainActivity.kt +++ b/src/android/app/src/main/java/com/microsoft/commandsystemsample/MainActivity.kt @@ -189,15 +189,15 @@ class MainActivity : AppCompatActivity() { } .configureSecrets { secrets: ConfigureSecretBuilder -> secrets - .addSecret("SPEECH_KEY","YOUR_KEY") - .addSecret("SPEECH_REGION","westus") + .addSecret("SPEECH_KEY", BuildConfig.SPEECH_KEY) + .addSecret("SPEECH_REGION", BuildConfig.SPEECH_REGION) .addSecret("SPEECH_DEFAULT_LANGUAGE","en-us") .addSecret("SPEECH_CUSTOM_RECOGNITION_ENDPOINT_ID","") .addSecret("SPEECH_CUSTOM_SYNTHESIS_ENDPOINT_ID","") - .addSecret("CLU_KEY","YOUR_KEY") - .addSecret("CLU_ENDPOINT","https://internal-gm-dev.cognitiveservices.azure.com") - .addSecret("CLU_PROJECT_NAME","GM-Orchestrator") - .addSecret("CLU_DEPLOYMENT_NAME","2023-02-06") + .addSecret("CLU_KEY", BuildConfig.CLU_KEY) + .addSecret("CLU_ENDPOINT", BuildConfig.CLU_ENDPOINT) + .addSecret("CLU_PROJECT_NAME", BuildConfig.CLU_PROJECT_NAME) + .addSecret("CLU_DEPLOYMENT_NAME", BuildConfig.CLU_DEPLOYMENT_NAME) .addSecret("OPEN_AI_DEPLOYMENT","robch-southcentral-oai-txtdav002") .addSecret("OPEN_AI_ENDPOINT","https://robch-openai.openai.azure.com/") .addSecret("OPEN_AI_KEY","YOUR_KEY") diff --git a/src/android/local.properties.example b/src/android/local.properties.example new file mode 100644 index 00000000..11425ad9 --- /dev/null +++ b/src/android/local.properties.example @@ -0,0 +1,19 @@ +## This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Mon Aug 21 05:54:26 EDT 2023 + +# the line sdk.dir should ALREADY be in your local.properties file... +sdk.dir=C\:\\Users\\scicoria\\AppData\\Local\\Android\\Sdk +# this needs to be set to the version present in C:\Program Files\dotnet\templates\7.???? +dotnet.version=7.0.10 +# this is the Language Service Speech Key and region +speech.key=?????????? +speech.region=westus3 +clu.key=???? +clu.endpoint=https://???.cognitiveservices.azure.com +clu.project.name=???? +clu.deployment.name=2023-02-06