110 lines
3.5 KiB
Groovy
110 lines
3.5 KiB
Groovy
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url 'https://s01.oss.sonatype.org' }
|
|
maven { url 'https://repo.openeggbert.com' }
|
|
gradlePluginPortal()
|
|
mavenLocal()
|
|
google()
|
|
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
|
|
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
|
|
maven { url 'https://repo.openeggbert.com/releases/' }
|
|
maven { url 'https://repo.openeggbert.com/snapshots/' }
|
|
}
|
|
dependencies {
|
|
classpath "com.android.tools.build:gradle:8.1.4"
|
|
classpath "io.freefair.gradle:lombok-plugin:8.3"
|
|
classpath "org.docstr:gwt-gradle-plugin:$gwtPluginVersion"
|
|
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
apply plugin: 'eclipse'
|
|
apply plugin: 'idea'
|
|
|
|
// This allows you to "Build and run using IntelliJ IDEA", an option in IDEA's Settings.
|
|
idea {
|
|
module {
|
|
outputDir file('build/classes/java/main')
|
|
testOutputDir file('build/classes/java/test')
|
|
}
|
|
}
|
|
}
|
|
|
|
configure(subprojects - project(':android')) {
|
|
apply plugin: 'java-library'
|
|
apply plugin: 'io.freefair.lombok'
|
|
sourceCompatibility = 11
|
|
compileJava {
|
|
options.incremental = true
|
|
}
|
|
// From https://lyze.dev/2021/04/29/libGDX-Internal-Assets-List/
|
|
// The article can be helpful when using assets.txt in your project.
|
|
tasks.register('generateAssetList') {
|
|
inputs.dir("${project.rootDir}/assets/")
|
|
// projectFolder/assets
|
|
File assetsFolder = new File("${project.rootDir}/assets/")
|
|
// projectFolder/assets/assets.txt
|
|
File assetsFile = new File(assetsFolder, "assets.txt")
|
|
File assets_File = new File(assetsFolder, "assets_.txt")
|
|
// delete that file in case we've already created it
|
|
assetsFile.delete()
|
|
assets_File.delete()
|
|
|
|
// iterate through all files inside that folder
|
|
// convert it to a relative path
|
|
// and append it to the file assets.txt
|
|
fileTree(assetsFolder).collect { assetsFolder.relativePath(it) }.each {
|
|
assetsFile.append(it + "\n")
|
|
assets_File.append(it + "\n")
|
|
}
|
|
|
|
}
|
|
processResources.dependsOn 'generateAssetList'
|
|
|
|
task copyAssetsTxt {
|
|
doLast {
|
|
def sourceFile = file('assets/assets.txt')
|
|
def targetFile = file('assets/assets_.txt')
|
|
|
|
if (sourceFile.exists()) {
|
|
targetFile.text = sourceFile.text
|
|
println "Successfully copied assets.txt to assets_.txt"
|
|
} else {
|
|
println "Source file assets.txt does not exist"
|
|
}
|
|
}
|
|
}
|
|
|
|
processResources.dependsOn generateAssetList
|
|
|
|
|
|
compileJava {
|
|
options.incremental = true
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
version = '0.0.0-SNAPSHOT'
|
|
ext.appName = 'open-eggbert'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url 'https://s01.oss.sonatype.org' }
|
|
// You may want to remove the following line if you have errors downloading dependencies.
|
|
mavenLocal()
|
|
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
|
|
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
|
|
maven { url 'https://jitpack.io' }
|
|
maven { url 'https://teavm.org/maven/repository/' }
|
|
|
|
maven { url 'https://repo.openeggbert.com' }
|
|
maven { url 'https://repo.openeggbert.com/releases/' }
|
|
maven { url 'https://repo.openeggbert.com/snapshots/' }
|
|
|
|
}
|
|
}
|
|
|
|
eclipse.project.name = 'open-eggbert' + '-parent'
|