build.gradle.kts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. // JSON
  39. implementation(libs.kotlinx.serialization.json)
  40. // Testing
  41. testImplementation(libs.junit)
  42. testImplementation(libs.mockk)
  43. testImplementation(libs.kotlinx.coroutines.test)
  44. testImplementation(libs.kotlin.test)
  45. testImplementation(libs.turbine)
  46. testImplementation(project(":test-helpers"))
  47. }
  48. tasks.withType<Test> {
  49. useJUnitPlatform()
  50. }
  51. tasks.withType<JacocoReport> {
  52. reports {
  53. xml.required = true
  54. html.required = false
  55. }
  56. }
  57. sonarqube {
  58. properties {
  59. property("sonar.projectKey", "android-client")
  60. property("sonar.projectName", "Threema for Android")
  61. property("sonar.sources", "src/main/")
  62. property("sonar.tests", "src/test/")
  63. property("sonar.sourceEncoding", "UTF-8")
  64. property("sonar.verbose", "true")
  65. property(
  66. "sonar.coverage.jacoco.xmlReportPaths",
  67. "${projectDir.parentFile.path}/build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml",
  68. )
  69. }
  70. }
  71. java {
  72. sourceCompatibility = JavaVersion.VERSION_11
  73. targetCompatibility = JavaVersion.VERSION_11
  74. }
  75. kotlin {
  76. compilerOptions {
  77. jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
  78. }
  79. }