build.gradle 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. buildscript {
  2. repositories {
  3. mavenCentral()
  4. maven { url 'https://s01.oss.sonatype.org' }
  5. gradlePluginPortal()
  6. mavenLocal()
  7. google()
  8. maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
  9. maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
  10. }
  11. dependencies {
  12. classpath "com.android.tools.build:gradle:8.5.2"
  13. classpath "io.freefair.gradle:lombok-plugin:8.3"
  14. }
  15. }
  16. allprojects {
  17. apply plugin: 'eclipse'
  18. apply plugin: 'idea'
  19. // This allows you to "Build and run using IntelliJ IDEA", an option in IDEA's Settings.
  20. idea {
  21. module {
  22. outputDir file('build/classes/java/main')
  23. testOutputDir file('build/classes/java/test')
  24. }
  25. }
  26. }
  27. configure(subprojects - project(':android')) {
  28. apply plugin: 'java-library'
  29. apply plugin: 'io.freefair.lombok'
  30. sourceCompatibility = 8
  31. // From https://lyze.dev/2021/04/29/libGDX-Internal-Assets-List/
  32. // The article can be helpful when using assets.txt in your project.
  33. tasks.register('generateAssetList') {
  34. inputs.dir("${project.rootDir}/assets/")
  35. // projectFolder/assets
  36. File assetsFolder = new File("${project.rootDir}/assets/")
  37. // projectFolder/assets/assets.txt
  38. File assetsFile = new File(assetsFolder, "assets.txt")
  39. // delete that file in case we've already created it
  40. assetsFile.delete()
  41. // iterate through all files inside that folder
  42. // convert it to a relative path
  43. // and append it to the file assets.txt
  44. fileTree(assetsFolder).collect { assetsFolder.relativePath(it) }.sort().each {
  45. assetsFile.append(it + "\n")
  46. }
  47. }
  48. processResources.dependsOn 'generateAssetList'
  49. compileJava {
  50. options.incremental = true
  51. }
  52. }
  53. subprojects {
  54. version = '$projectVersion'
  55. ext.appName = 'OPCAI'
  56. repositories {
  57. mavenCentral()
  58. maven { url 'https://s01.oss.sonatype.org' }
  59. // You may want to remove the following line if you have errors downloading dependencies.
  60. mavenLocal()
  61. maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
  62. maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
  63. maven { url 'https://jitpack.io' }
  64. }
  65. }
  66. eclipse.project.name = 'OPCAI' + '-parent'