Fix Android Manifest hack for new AGP versions (#10076)
* Fix Android Manifest hack for new AGP versions * Minor changes
This commit is contained in:
parent
95e98fd5f1
commit
45f31c3b75
@ -17,7 +17,7 @@ android {
|
|||||||
namespace "eu.kanade.tachiyomi.extension"
|
namespace "eu.kanade.tachiyomi.extension"
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
manifest.srcFile "AndroidManifest.xml"
|
manifest.srcFile layout.buildDirectory.file('tempAndroidManifest.xml')
|
||||||
java.srcDirs = ['src']
|
java.srcDirs = ['src']
|
||||||
res.srcDirs = ['res']
|
res.srcDirs = ['res']
|
||||||
assets.srcDirs = ['assets']
|
assets.srcDirs = ['assets']
|
||||||
@ -105,17 +105,20 @@ dependencies {
|
|||||||
compileOnly(libs.bundles.common)
|
compileOnly(libs.bundles.common)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register("copyManifestFile", Copy) {
|
||||||
|
from 'AndroidManifest.xml'
|
||||||
|
rename { 'tempAndroidManifest.xml' }
|
||||||
|
into layout.buildDirectory
|
||||||
|
}
|
||||||
|
|
||||||
tasks.register("writeManifestFile") {
|
tasks.register("writeManifestFile") {
|
||||||
|
dependsOn(copyManifestFile)
|
||||||
doLast {
|
doLast {
|
||||||
def manifest = android.sourceSets.getByName("main").manifest
|
File tempFile = android.sourceSets.getByName('main').manifest.srcFile
|
||||||
if (!manifest.srcFile.exists()) {
|
if (!tempFile.exists()) {
|
||||||
File tempFile = layout.buildDirectory.get().file("tempAndroidManifest.xml").getAsFile()
|
tempFile.withWriter {
|
||||||
if (!tempFile.exists()) {
|
it.write('<?xml version="1.0" encoding="utf-8"?>\n<manifest />\n')
|
||||||
tempFile.withWriter {
|
|
||||||
it.write('<?xml version="1.0" encoding="utf-8"?>\n<manifest />\n')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
manifest.srcFile(tempFile.path)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user