mirror of
https://github.com/gsantner/dandelion
synced 2025-12-16 01:01:11 +01:00
.
This commit is contained in:
parent
07acb6bd02
commit
d3a2c20515
4 changed files with 39 additions and 1 deletions
30
build.gradle
30
build.gradle
|
|
@ -47,12 +47,42 @@ allprojects {
|
|||
tasks.matching { task -> task.name.matches('.*generate.*Resources') }.all {
|
||||
task -> task.dependsOn copyRepoFiles
|
||||
}
|
||||
|
||||
tasks.matching { task -> task.name.matches('.*generate.*Resources') }.all {
|
||||
task -> task.doLast { markUntranslatableBuildFields() }
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
def markUntranslatableBuildFields() {
|
||||
Set<Project> proc_projects = new HashSet<>(subprojects)
|
||||
proc_projects.add(rootProject)
|
||||
|
||||
proc_projects.each { proc_project ->
|
||||
File mergeDir = new File("${proc_project.buildDir}/intermediates/res/merged")
|
||||
if (!mergeDir.exists()) return
|
||||
mergeDir.eachDir { dir ->
|
||||
println("Resources" + dir)
|
||||
dir.eachFileRecurse { file ->
|
||||
if (file.name.endsWith(".xml")) {
|
||||
println(file)
|
||||
String content = file.getText('UTF-8')
|
||||
if (content != null && content.contains('<string name="bc_notr__')) {
|
||||
println("Replacing app name in " + file)
|
||||
content = content.replace('<string name="bc_notr__', '<string translatable="false" name="bc_notr__')
|
||||
file.write(content, 'UTF-8')
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
final String[] ROOT_TO_RAW_COPYFILES = ["README.md", "CHANGELOG.md", "CONTRIBUTORS.md", "LICENSE.txt", "LICENSE.md", "LICENSE"]
|
||||
task copyRepoFiles(type: Copy) {
|
||||
from rootProject.files(ROOT_TO_RAW_COPYFILES)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue