mirror of
https://github.com/OMGeeky/andors-trail.git
synced 2025-12-26 16:07:57 +01:00
improves the gradle tasks for copying the maps and translations
Instead of copying the files to the normal res folder they get copied to the build folder, which gives the user the hint that they are generated and should not be edited in this location. > **Warning** After pulling this commit both folders '/app/src/main/res' and 'app/src/main/assets' should be deleted if they exist, since they are no longer ignored (since they don't get used anymore)!
This commit is contained in:
3
AndorsTrail/.gitignore
vendored
3
AndorsTrail/.gitignore
vendored
@@ -1,6 +1,3 @@
|
||||
# Android ignores
|
||||
app/src/main/res
|
||||
app/src/main/assets
|
||||
gen/
|
||||
bin/
|
||||
target/
|
||||
|
||||
@@ -21,6 +21,12 @@ android {
|
||||
applicationIdSuffix 'beta2'
|
||||
}
|
||||
}
|
||||
sourceSets {
|
||||
main {
|
||||
res.srcDirs = ['build/gen-res', 'src/main/res']
|
||||
assets.srcDirs = ['build/gen-assets', 'src/main/assets']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -30,23 +36,31 @@ dependencies {
|
||||
task copyRes(type: Copy) {
|
||||
description "Copies the res folder to the modules res folder (& renames .tmx to .xml)"
|
||||
from "${rootDir}/res"
|
||||
into "${projectDir}/src/main/res"
|
||||
into "${projectDir}/build/gen-res"
|
||||
rename "(.*)\\.tmx", "\$1.xml"
|
||||
}
|
||||
|
||||
task copyTranslation(type: Copy) {
|
||||
description("Copies the translation files to the modules translations folder")
|
||||
from "${rootDir}/assets/translation"
|
||||
into "${projectDir}/src/main/assets/translation"
|
||||
into "${projectDir}/build/gen-assets/translation"
|
||||
}
|
||||
|
||||
task cleanup(type: Delete) {
|
||||
description("Deletes the assets/translation and the res folder from the modules folder")
|
||||
delete "${projectDir}/src/main/res", "${projectDir}/src/main/assets/translation"
|
||||
delete "${projectDir}/build/gen-res", "${projectDir}/build/gen-assets/translation"
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
preBuild.dependsOn project.tasks.copyRes
|
||||
preBuild.dependsOn project.tasks.copyTranslation
|
||||
mergeDebugResources.dependsOn project.tasks.copyRes
|
||||
extractDeepLinksDebug.dependsOn project.tasks.copyRes
|
||||
mergeReleaseResources.dependsOn project.tasks.copyRes
|
||||
extractDeepLinksRelease.dependsOn project.tasks.copyRes
|
||||
|
||||
mergeDebugAssets.dependsOn project.tasks.copyTranslation
|
||||
mergeReleaseAssets.dependsOn project.tasks.copyTranslation
|
||||
extractDeepLinksDebug.dependsOn project.tasks.copyTranslation
|
||||
extractDeepLinksRelease.dependsOn project.tasks.copyTranslation
|
||||
|
||||
clean.dependsOn project.tasks.cleanup
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user