Skip to content

Commit f2fd742

Browse files
authored
Merge pull request #203 from caarmen/fix-license-assets-bundling
Fix a bug where the license assets weren't included in the apk on a clean build.
2 parents d9e0888 + 79ed3d4 commit f2fd742

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

app/build.gradle

+9-10
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,16 @@ jacoco {
171171
toolVersion '0.8.12'
172172
}
173173
android.applicationVariants.all { variant ->
174-
variant.getMergeAssetsProvider().get().doLast {
175-
copy {
176-
from project.rootDir
177-
into "${project.buildDir}/generated/license_assets/"
178-
include 'LICENSE.txt'
179-
include 'LICENSE-rhyming-dictionary.txt'
180-
include 'LICENSE-thesaurus-wordnet.txt'
181-
include 'LICENSE-dictionary-wordnet.txt'
182-
include 'LICENSE-google-ngram-dataset.txt'
183-
}
174+
def copyLicenseFilesTask = tasks.register("copyLicenseFilesFor${variant.name.capitalize()}", Copy) {
175+
from project.rootDir
176+
into "${project.buildDir}/generated/license_assets/"
177+
include 'LICENSE.txt'
178+
include 'LICENSE-rhyming-dictionary.txt'
179+
include 'LICENSE-thesaurus-wordnet.txt'
180+
include 'LICENSE-dictionary-wordnet.txt'
181+
include 'LICENSE-google-ngram-dataset.txt'
184182
}
183+
variant.mergeAssetsProvider.configure { dependsOn copyLicenseFilesTask }
185184
}
186185

187186
project.gradle.taskGraph.whenReady {

0 commit comments

Comments
 (0)