Skip to content

Commit 094372d

Browse files
committed
fix: more android app gradle file fixes
1 parent 4abb7d9 commit 094372d

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

vendor/gradle-app/build.gradle

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ task buildMetadata(type: BuildToolTask) {
718718
}
719719

720720
dependsOn copyMetadataFilters
721+
dependsOn collectAllJars
721722

722723
// As some external gradle plugins can reorder the execution order of the tasks it may happen that buildMetadata is executed after merge{Debug/Release}Assets
723724
// in that case the metadata won't be included in the result apk and it will crash, so to avoid this we are adding the copyMetadata task which will manually copy
@@ -735,7 +736,9 @@ task buildMetadata(type: BuildToolTask) {
735736
inputs.files(project.fileTree(dir: "$rootDir", include: "**/*.mdg"))
736737

737738
def classesDir = "$buildDir/intermediates/javac"
738-
inputs.dir(classesDir)
739+
if (file(classesDir).exists()) {
740+
inputs.dir(classesDir)
741+
}
739742

740743
def kotlinClassesDir = "$buildDir/tmp/kotlin-classes"
741744
if (file(kotlinClassesDir).exists()) {
@@ -828,9 +831,6 @@ task buildMetadata(type: BuildToolTask) {
828831
}
829832

830833
args paramz.toArray()
831-
832-
logger.info("Task buildMetadata: Call android-metadata-generator.jar with arguments: " + paramz.toString().replaceAll(',', ''))
833-
outLogger.withStyle(Style.SuccessHeader).println "Task buildMetadata: Call android-metadata-generator.jar with arguments: " + paramz.toString().replaceAll(',', '')
834834
}
835835
}
836836

@@ -976,7 +976,8 @@ project.tasks.configureEach {
976976
}
977977

978978
// added because of a error with gradle 8 telling us to add this
979-
// could we do it another way?
979+
// because buildMetadata uses the output of those
980+
// TODO: there must be a way to make it simpler
980981
if (!(name =~ /AndroidTest/) &&
981982
(name =~ /merge(Debug|Release)Shaders/ ||
982983
name =~ /desugar(Debug|Release)FileDependencies/ ||
@@ -993,7 +994,20 @@ project.tasks.configureEach {
993994
name =~ /bundle(Debug|Release)Resources/ ||
994995
name =~ /extract(Debug|Release)NativeSymbolTables/ ||
995996
name =~ /extractProguardFiles/ ||
996-
name =~ /validateSigning(Debug|Release)/
997+
name =~ /desugarBenchmarkFileDependencies/ ||
998+
name =~ /mergeExtDexBenchmark/ ||
999+
name =~ /mergeDexBenchmark/ ||
1000+
name =~ /mergeBenchmarkShaders/ ||
1001+
name =~ /mergeBenchmarkJavaResource/ ||
1002+
name =~ /mergeBenchmarkJniLibFolders/ ||
1003+
name =~ /checkBenchmarkDuplicateClasses/ ||
1004+
name =~ /bundleBenchmarkResources/ ||
1005+
name =~ /extractBenchmarkNativeSymbolTables/ ||
1006+
// name =~ /compressBenchmarkAssets/ ||
1007+
name =~ /mergeBenchmarkNativeLibs/ ||
1008+
name =~ /stripBenchmark(Debug|Release)Symbols/ ||
1009+
name =~ /buildKotlinToolingMetadata/ ||
1010+
name =~ /validateSigning/
9971011
)) {
9981012
it.finalizedBy(buildMetadata)
9991013
}

0 commit comments

Comments
 (0)