2
0

build.gradle.kts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * Copyright (c) Milan Jurkulák 2024.
  3. * Contact:
  4. * e: mimoccc@gmail.com
  5. * e: mj@mjdev.org
  6. * w: https://mjdev.org
  7. */
  8. import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
  9. plugins {
  10. alias(libs.plugins.gradle.ksp) apply false
  11. alias(libs.plugins.gradle.ktlint) apply false
  12. alias(libs.plugins.gradle.versions) apply true
  13. alias(libs.plugins.gradle.catalogs.update) apply true
  14. alias(libs.plugins.compose.screenshot) apply false
  15. }
  16. buildscript {
  17. repositories {
  18. google()
  19. mavenCentral()
  20. maven("https://storage.googleapis.com/r8-releases/raw")
  21. maven("https://mvn.dailymotion.com/repository/releases/")
  22. }
  23. dependencies {
  24. classpath(libs.gradle)
  25. classpath(libs.gradle.api)
  26. classpath(libs.gradle.kotlin.plugin)
  27. classpath(libs.gradle.tools.r8)
  28. classpath(libs.gradle.detekt.plugin)
  29. classpath(libs.gradle.objectbox.plugin)
  30. classpath(libs.gradle.paparazzi.plugin)
  31. classpath(libs.gradle.kotlinter)
  32. classpath(libs.gradle.dokka.plugin)
  33. // classpath(libs.gradle.markdown.plugin)
  34. // classpath(libs.gradle.ospackage.plugin)
  35. }
  36. configurations.classpath {
  37. resolutionStrategy.activateDependencyLocking()
  38. }
  39. }
  40. versionCatalogUpdate {
  41. sortByKey = true
  42. pin {
  43. // versions = ["my-version-name", "other-version"]
  44. // libraries = [libs.my.library.reference, libs.my.other.library.reference]
  45. // plugins = [libs.plugins.my.plugin, libs.plugins.my.other.plugin]
  46. // groups = ["com.somegroup", "com.someothergroup"]
  47. }
  48. keep {
  49. // versions = ["my-version-name", "other-version"]
  50. // libraries = [libs.my.library.reference, libs.my.other.library.reference]
  51. // plugins = [libs.plugins.my.plugin, libs.plugins.my.other.plugin]
  52. // groups = ["com.somegroup", "com.someothergroup"]
  53. keepUnusedVersions = false
  54. keepUnusedLibraries = false
  55. keepUnusedPlugins = false
  56. }
  57. }
  58. tasks.register<Delete>("clean") {
  59. delete(rootProject.layout.buildDirectory)
  60. }
  61. subprojects {
  62. pluginManager.withPlugin("java") {
  63. configure<JavaPluginExtension> {
  64. toolchain {
  65. languageVersion.set(JavaLanguageVersion.of(17))
  66. }
  67. }
  68. tasks.withType<JavaCompile>().configureEach {
  69. options.release.set(8)
  70. }
  71. }
  72. pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
  73. tasks.withType<KotlinCompile>().configureEach {
  74. compilerOptions {
  75. // jvmTarget.set(17)
  76. progressiveMode.set(true)
  77. }
  78. }
  79. }
  80. if (JavaVersion.current() >= JavaVersion.VERSION_16) {
  81. tasks.withType<Test>().configureEach {
  82. jvmArgs(
  83. "--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
  84. "--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
  85. "--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
  86. "--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
  87. "--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED",
  88. "--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
  89. "--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
  90. "--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED",
  91. "--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
  92. "--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
  93. )
  94. }
  95. }
  96. // pluginManager.withPlugin("com.vanniktech.maven.publish") {
  97. // apply(plugin = "org.jetbrains.dokka")
  98. //
  99. // tasks.withType<DokkaTask>().configureEach {
  100. // outputDirectory.set(rootDir.resolve("../docs/0.x"))
  101. // dokkaSourceSets.configureEach {
  102. // skipDeprecated.set(true)
  103. // }
  104. // }
  105. // configure<MavenPublishBaseExtension> {
  106. // publishToMavenCentral(automaticRelease = true)
  107. // signAllPublications()
  108. // }
  109. // }
  110. }