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