-
Notifications
You must be signed in to change notification settings - Fork 0
/
include.gradle
43 lines (37 loc) · 1.64 KB
/
include.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
32
33
34
35
36
37
38
39
40
41
42
43
apply plugin: 'de.undercouch.download'
import groovy.json.JsonSlurper
def getCaramlConsoleVersionFromNpm() {
def inputFile = new File(buildscript.getSourceFile().getParent(), "package.json")
def packageJson = new JsonSlurper().parseText(inputFile.text)
return packageJson["version"]
}
if (!project.hasProperty('caraml_console_include_gradle')) {
project.ext.set('caraml_console_include_gradle', true)
def _caraml_console_aar = "caraml-console-lib-" + getCaramlConsoleVersionFromNpm() + ".aar"
def downloadsDir_caraml_console = new File(rootProject.projectDir, ".liquidcore")
task createDownloadsDir_caraml_console {
downloadsDir_caraml_console.mkdirs()
}
dependencies {
if (findProject(':caraml-console-lib') != null) {
implementation project(':caraml-console-lib')
} else {
implementation fileTree(include:[_caraml_console_aar], dir:downloadsDir_caraml_console)
}
}
if (findProject(':caraml-console-lib') == null) {
android { tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn download_caraml_console_lib }}
task download_caraml_console_lib(dependsOn: createDownloadsDir_caraml_console, type: Download) {
src 'https://liquidplayer.github.io/packages/' + _caraml_console_aar
onlyIfNewer true
overwrite false
dest new File(downloadsDir_caraml_console, _caraml_console_aar)
}
}
try {
apply from: new File(rootProject.projectDir, 'node_modules/@liquidcore/caraml-core/include.gradle')
} catch (Exception e) {
apply from: new File(buildscript.getSourceFile(), '../node_modules/@liquidcore/caraml-core/include.gradle')
}
}