-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
66 lines (57 loc) · 2.01 KB
/
build.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
apply plugin: 'java'
repositories {
maven {
url 'https://dxfeed.jfrog.io/artifactory/maven-open'
}
}
def native_version = '2.2.1'
def name = 'graal-native-sdk'
dependencies {
implementation(group: 'com.dxfeed', name: "${name}", version: "${native_version}", classifier: 'aarch64-osx', ext: 'zip')
implementation(group: 'com.dxfeed', name: "${name}", version: "${native_version}", classifier: 'x86_64-osx', ext: 'zip')
implementation(group: 'com.dxfeed', name: "${name}", version: "${native_version}", classifier: 'aarch64-ios', ext: 'zip')
implementation(group: 'com.dxfeed', name: "${name}", version: "${native_version}", classifier: 'ios-simulator', ext: 'zip')
}
task fetchDependencies(type: Copy) {
outputs.upToDateWhen { false }
doFirst {
new File('downloads').mkdirs()
}
println "Downloaded dep:"
sourceSets.main.runtimeClasspath.each {
println it
}
from sourceSets.main.runtimeClasspath
into 'downloads'
new File('graal_builds').deleteDir()
doLast {
println "fetch dep:"
ext.frameworkName = { zipFileName ->
switch(zipFileName) {
case ~/.*aarch64-osx.*/:
return 'graal_builds/osx_arm'
break
case ~/.*x86_64-osx.*/:
return 'graal_builds/osx_x86'
break
case ~/.*aarch64-ios.*/:
return 'graal_builds/ios'
break
case ~/.*ios-simulator.zip.*/:
return 'graal_builds/ios_simulator'
break
default:
return 'graal_builds/$zipFileName'
break
}
}
fileTree(dir: 'downloads', includes: ['*.zip']).each { zipFile ->
copy {
from zipTree(zipFile)
into frameworkName(zipFile.name)
}
}
new File('downloads').deleteDir()
}
}
defaultTasks 'fetchDependencies'