209 строки
7.2 KiB
Groovy
209 строки
7.2 KiB
Groovy
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
buildscript {
|
|
def getVersionCode = { ->
|
|
return project.hasProperty('versionCode') ? versionCode.toInteger() : 1
|
|
}
|
|
|
|
ext {
|
|
call_library_version_name = '1.13.0-beta.1'
|
|
chat_library_version_name = '1.0.0-beta.3'
|
|
|
|
ui_library_version_code = getVersionCode()
|
|
|
|
kotlin_version = '1.7.20'
|
|
jacoco_version = '0.8.8'
|
|
junit_version = '4.13.2'
|
|
|
|
androidx_activity_ktx_version = '1.4.0'
|
|
androidx_appcompat_version = '1.4.1'
|
|
androidx_constraint_layout_version = '2.1.4'
|
|
androidx_core_ktx_version = '1.7.0'
|
|
androidx_core_testing_version = '2.1.0'
|
|
androidx_espresso_contrib_version = '3.4.0'
|
|
androidx_espresso_core_version = '3.4.0'
|
|
androidx_fragment_ktx_version = '1.4.1'
|
|
androidx_junit_version = '1.1.3'
|
|
androidx_lifecycle_viewmodel_ktx_version = '2.4.1'
|
|
androidx_navigation_fragment_ktx_version = '2.4.2'
|
|
androidx_test_rules_version = '1.4.1-alpha07'
|
|
androidx_activity_compose_version = "1.5.1"
|
|
androidx_navigation_compose = "2.5.2"
|
|
|
|
if (project.rootProject.file('private_drop.properties').canRead()) {
|
|
Properties privateDropProps = new Properties()
|
|
privateDropProps.load(project.rootProject.file('private_drop.properties').newDataInputStream())
|
|
azure_calling_sdk_version_ga = privateDropProps.getProperty('PRIVATE_DROP_VERSION', '""')
|
|
azure_calling_sdk_version_beta = azure_calling_sdk_version_ga
|
|
}
|
|
else {
|
|
|
|
// To use Beta Calling SDK and Features, set the following in local.properties:
|
|
//
|
|
// USE_CALLING_SDK_BETA=true
|
|
//
|
|
// and then run ./gradlew clean
|
|
// This will use the beta version of the SDK
|
|
// and enable the beta features
|
|
|
|
// Latest GA version of the SDK
|
|
azure_calling_sdk_version_ga = '2.12.0-beta.1'
|
|
|
|
// Newest version of the SDK, can be beta
|
|
azure_calling_sdk_version_beta = '2.12.0-beta.1'
|
|
}
|
|
|
|
// Initialize the SDK Version based on the calling SDK Beta flag
|
|
Properties localProps = new Properties()
|
|
if (project.rootProject.file('local.properties').canRead()) {
|
|
localProps.load(project.rootProject.file('local.properties').newDataInputStream())
|
|
}
|
|
|
|
// Select GA first, but if that isn't right then BETA
|
|
ext.azure_calling_sdk_version = ext.azure_calling_sdk_version_ga
|
|
isUsingBetaSdk=false
|
|
if (localProps.getProperty('USE_CALLING_SDK_BETA', 'false').toBoolean()) {
|
|
ext.azure_calling_sdk_version = ext.azure_calling_sdk_version_beta
|
|
isUsingBetaSdk=true
|
|
}
|
|
|
|
|
|
|
|
// while modifying this version, make sure to modify in ChatContainer
|
|
azure_chat_sdk_version = '2.0.1'
|
|
azure_common_sdk_version = '1.0.2'
|
|
|
|
jetbrains_kotlinx_coroutines_test_version = '1.6.0-native-mt'
|
|
|
|
microsoft_dualscreen_layout_version = '1.0.0-alpha01'
|
|
microsoft_fluent_ui_version = '0.0.21'
|
|
microsoft_fluent_ui_version_v2 = '0.1.2'
|
|
microsoft_fluent_ui_drawer_version_v2 = '0.1.3'
|
|
|
|
mockito_inline_version = '4.3.1'
|
|
mockito_kotlin_version = '4.0.0'
|
|
|
|
shouldNotCheckTaskRoot = {
|
|
return rootProject.hasProperty("disableTaskRootCheck") && rootProject.getProperty("disableTaskRootCheck")
|
|
}
|
|
|
|
androidx_activity_compose_version = '1.5.1'
|
|
compose_version = '1.2.1'
|
|
kotlin_compiler_extension_version = '1.3.2'
|
|
shouldByPassMavenPublish = {
|
|
return rootProject.hasProperty("bypassMavenPublish") && rootProject.getProperty("bypassMavenPublish")
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
google()
|
|
}
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle:7.4.2'
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
|
|
classpath 'com.google.gms:google-services:4.4.1'
|
|
// NOTE: Do not place your application dependencies here; they belong
|
|
// in the individual module build.gradle files
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
|
|
id "org.jlleitschuh.gradle.ktlint" version "10.2.1" apply(true)
|
|
}
|
|
|
|
allprojects {
|
|
apply plugin: 'jacoco'
|
|
|
|
jacoco {
|
|
toolVersion = "$jacoco_version"
|
|
}
|
|
|
|
Properties localProps = new Properties()
|
|
if (project.rootProject.file('local.properties').canRead()) {
|
|
localProps.load(project.rootProject.file('local.properties').newDataInputStream())
|
|
}
|
|
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
maven {
|
|
url "https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1"
|
|
}
|
|
if (localProps.containsKey('GITHUB_MAVEN_REPO_URL')) {
|
|
maven {
|
|
name = 'privateGitHubRepo'
|
|
url = localProps.getProperty('GITHUB_MAVEN_REPO_URL', '""')
|
|
credentials {
|
|
username localProps.getProperty('GITHUB_MAVEN_REPO_USERNAME', '""')
|
|
password localProps.getProperty('GITHUB_MAVEN_REPO_PASSWORD', '""')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
apply plugin: "org.jlleitschuh.gradle.ktlint"
|
|
apply from: "../checkstyle.gradle"
|
|
afterEvaluate {
|
|
preBuild.dependsOn 'checkstyle'
|
|
check.dependsOn 'checkstyle'
|
|
}
|
|
}
|
|
|
|
tasks.register("combinedCoverageReport", JacocoReport) {
|
|
group = "Reporting"
|
|
description = "Generate a Jacoco coverage report for debug unit tests in all subprojects"
|
|
|
|
def excludeFiles = [
|
|
'**/R.class',
|
|
'**/R$*.class',
|
|
'**/*$ViewInjector*.*',
|
|
'**/*$ViewBinder*.*',
|
|
'**/BuildConfig.*',
|
|
'**/Manifest*.*'
|
|
]
|
|
|
|
def coverageSourceDirs = subprojects.collect {
|
|
"$it.projectDir/src/main/java"
|
|
}
|
|
|
|
def javaClasses = subprojects.collect {
|
|
"$it.buildDir/intermediates/javac/debug"
|
|
}.collect { path ->
|
|
fileTree(dir: path, excludes: excludeFiles)
|
|
}
|
|
|
|
def kc = subprojects.collect {
|
|
"$it.buildDir/tmp/kotlin-classes/debug"
|
|
}
|
|
|
|
def kotlinClasses = kc.collect { path ->
|
|
fileTree(dir: path, excludes: excludeFiles)
|
|
}
|
|
|
|
classDirectories.setFrom(files([javaClasses], [kotlinClasses]))
|
|
sourceDirectories.setFrom(files(coverageSourceDirs))
|
|
|
|
def coverageExecPath = "outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec"
|
|
executionData.setFrom(files(subprojects.findAll { proj ->
|
|
def path = "$proj.buildDir/$coverageExecPath"
|
|
(new File(path)).exists()
|
|
}.collect { proj ->
|
|
"$proj.buildDir/$coverageExecPath"
|
|
}))
|
|
|
|
reports {
|
|
xml.required = true
|
|
html.required = true
|
|
html.outputLocation = layout.buildDirectory.dir("reports/coverage/test/debug")
|
|
xml.outputLocation = layout.buildDirectory.file("reports/coverage/test/debug/report.xml")
|
|
}
|
|
}
|
|
|
|
tasks.register("clean", Delete) {
|
|
delete rootProject.buildDir
|
|
}
|
|
|
|
apply from: file('java_compile_flags.gradle') |