Skip to content

Commit 0190d2e

Browse files
authored
feat: AndroidShowDeprecations preference flag (#1822)
1 parent df36c7a commit 0190d2e

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/prepare.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ function getUserGradleConfig (configXml) {
113113
{ xmlKey: 'GradlePluginKotlinEnabled', gradleKey: 'IS_GRADLE_PLUGIN_KOTLIN_ENABLED', type: Boolean },
114114
{ xmlKey: 'AndroidJavaSourceCompatibility', gradleKey: 'JAVA_SOURCE_COMPATIBILITY', type: Number },
115115
{ xmlKey: 'AndroidJavaTargetCompatibility', gradleKey: 'JAVA_TARGET_COMPATIBILITY', type: Number },
116-
{ xmlKey: 'AndroidKotlinJVMTarget', gradleKey: 'KOTLIN_JVM_TARGET', type: String }
116+
{ xmlKey: 'AndroidKotlinJVMTarget', gradleKey: 'KOTLIN_JVM_TARGET', type: String },
117+
{ xmlKey: 'AndroidShowDeprecations', gradleKey: 'JAVA_SHOW_DEPRECATIONS', type: Boolean }
117118
];
118119

119120
return configXmlToGradleMapping.reduce((config, mapping) => {

templates/project/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ allprojects {
4040
}
4141

4242
repositories repos
43+
44+
subprojects {
45+
afterEvaluate {
46+
tasks.withType(JavaCompile).tap {
47+
configureEach {
48+
if (cordovaConfig.JAVA_SHOW_DEPRECATIONS == true) {
49+
options.compilerArgs += "-Xlint:deprecation"
50+
}
51+
}
52+
}
53+
}
54+
}
4355
}
4456

4557
task clean(type: Delete) {

0 commit comments

Comments
 (0)