mirror of
https://github.com/OpenFlutter/fluwx.git
synced 2025-05-17 23:36:13 +08:00
fix #543
This commit is contained in:
@ -76,32 +76,34 @@ Map loadPubspec() {
|
|||||||
|
|
||||||
|
|
||||||
tasks.register("generateFluwxHelperFile") {
|
tasks.register("generateFluwxHelperFile") {
|
||||||
Map config = loadPubspec()
|
doFirst {
|
||||||
Map fluwx = (Map) config.get("fluwx")
|
Map config = loadPubspec()
|
||||||
String enableLogging = "false"
|
Map fluwx = (Map) config.get("fluwx")
|
||||||
String interruptWeChatRequestByFluwx = "true"
|
String enableLogging = "false"
|
||||||
String flutterActivity = ""
|
String interruptWeChatRequestByFluwx = "true"
|
||||||
if (fluwx) {
|
String flutterActivity = ""
|
||||||
Map android = (Map) fluwx.get("android")
|
if (fluwx) {
|
||||||
if (android) {
|
Map android = (Map) fluwx.get("android")
|
||||||
def iwr = android.get("interrupt_wx_request")
|
if (android) {
|
||||||
if (iwr && iwr == "true" || iwr == "false") {
|
def iwr = android.get("interrupt_wx_request")
|
||||||
interruptWeChatRequestByFluwx = (String) iwr
|
if (iwr && iwr == "true" || iwr == "false") {
|
||||||
}
|
interruptWeChatRequestByFluwx = (String) iwr
|
||||||
|
}
|
||||||
|
|
||||||
def activity = android.get("flutter_activity")
|
def activity = android.get("flutter_activity")
|
||||||
if (activity) {
|
if (activity) {
|
||||||
flutterActivity = (String) activity
|
flutterActivity = (String) activity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def logging = fluwx.get("debug_logging")
|
def logging = fluwx.get("debug_logging")
|
||||||
if (logging && logging == "true" || logging == "false") {
|
if (logging && logging == "true" || logging == "false") {
|
||||||
enableLogging = (String) logging
|
enableLogging = (String) logging
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
generateFluwxConfigurations(interruptWeChatRequestByFluwx, flutterActivity, enableLogging)
|
generateFluwxConfigurations(interruptWeChatRequestByFluwx, flutterActivity, enableLogging)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def generateFluwxConfigurations(String interruptWeChatRequestByFluwx, String flutterActivity, String enableLogging) {
|
def generateFluwxConfigurations(String interruptWeChatRequestByFluwx, String flutterActivity, String enableLogging) {
|
||||||
@ -125,8 +127,11 @@ def generateFluwxConfigurations(String interruptWeChatRequestByFluwx, String flu
|
|||||||
file("${generateFolder.absolutePath}/FluwxConfigurations.kt").text = source
|
file("${generateFolder.absolutePath}/FluwxConfigurations.kt").text = source
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) { javaCompile ->
|
//tasks.withType(JavaCompile) { javaCompile ->
|
||||||
javaCompile.configure {
|
// javaCompile.configure {
|
||||||
dependsOn("generateFluwxHelperFile")
|
// dependsOn("generateFluwxHelperFile")
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
|
android.libraryVariants.configureEach {
|
||||||
|
it.registerGeneratedResFolders(project.files(new File("${buildDir}/generated/src/kotlin/com/jarvan/fluwx")).builtBy(generateFluwxHelperFile))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user