-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact.gradle
31 lines (27 loc) · 906 Bytes
/
react.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* Register HTML asset source folder
*/
android.sourceSets.main.assets.srcDirs += file("$buildDir/intermediates/ReactNativeMechanicMap")
/**
* Task to copy HTML files
*/
afterEvaluate {
def mapsDir = "../../node_modules/react-native-mechanic-map/assets";
def iconFontNames = [ "*.html" ];
def mapCopyTask = tasks.create(
name: "copyReactNativeMechanicMap",
type: Copy) {
description = "copy mechanic map HTML file."
into "$buildDir/intermediates/ReactNativeMechanicMap/assets"
iconFontNames.each { mapName ->
from(mapsDir) {
include(mapName)
}
}
}
android.applicationVariants.all { def variant ->
def targetName = variant.name.capitalize()
def generateAssetsTask = tasks.findByName("generate${targetName}Assets")
generateAssetsTask.dependsOn(mapCopyTask)
}
}