build.gradle.kts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* _____ _
  2. * |_ _| |_ _ _ ___ ___ _ __ __ _
  3. * | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. * |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. *
  6. * Threema for Android
  7. * Copyright (c) 2025 Threema GmbH
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License, version 3,
  11. * as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. */
  21. plugins {
  22. alias(libs.plugins.java.library)
  23. alias(libs.plugins.kotlin.jvm)
  24. alias(libs.plugins.jacoco)
  25. }
  26. dependencies {
  27. // Standard libraries
  28. api(libs.kotlin.stdlib)
  29. api(libs.kotlinx.coroutines.core)
  30. // Dependency injection
  31. api(project.dependencies.platform(libs.koin.bom))
  32. api(libs.koin.core)
  33. // HTTP
  34. api(platform(libs.okhttp3.bom))
  35. api(libs.okhttp3)
  36. api(libs.okhttp3.coroutines)
  37. api(libs.okhttp3.loggingInterceptor)
  38. // Testing
  39. testImplementation(libs.junit)
  40. testImplementation(libs.mockk)
  41. testImplementation(libs.kotlinx.coroutines.test)
  42. testImplementation(libs.kotlin.test)
  43. testImplementation(libs.turbine)
  44. testImplementation(project(":test-helpers"))
  45. }
  46. tasks.withType<Test> {
  47. useJUnitPlatform()
  48. }
  49. tasks.withType<JacocoReport> {
  50. reports {
  51. xml.required = true
  52. html.required = false
  53. }
  54. }
  55. sonarqube {
  56. properties {
  57. property("sonar.projectKey", "android-client")
  58. property("sonar.projectName", "Threema for Android")
  59. property("sonar.sources", "src/main/")
  60. property("sonar.tests", "src/test/")
  61. property("sonar.sourceEncoding", "UTF-8")
  62. property("sonar.verbose", "true")
  63. property(
  64. "sonar.coverage.jacoco.xmlReportPaths",
  65. "${projectDir.parentFile.path}/build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml",
  66. )
  67. }
  68. }
  69. java {
  70. sourceCompatibility = JavaVersion.VERSION_11
  71. targetCompatibility = JavaVersion.VERSION_11
  72. }
  73. kotlin {
  74. compilerOptions {
  75. jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
  76. }
  77. }