-
Notifications
You must be signed in to change notification settings - Fork 54
/
thirdparty_build.gradle
146 lines (125 loc) · 3.53 KB
/
thirdparty_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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/*CHANGE necessary properties in project.gradle*/
apply from: 'project.gradle'
defaultTasks 'buildNativeLibs'
buildscript {
repositories { mavenCentral() }
}
/*DJVU CHAIN*/
task downloadDjvu {
doLast {
def djvuFolder = new File(djvu)
if (djvuFolder.exists()) {
// Switch to master so we can properly pull if it was
// detached.
exec {
commandLine = ['git', '-C', djvu, 'checkout', '-f', 'master']
}
// Fetch
exec {
commandLine = ['git', '-C', djvu, 'fetch', 'origin']
}
}
else {
exec {
//origin at git://git.code.sf.net/p/djvu/djvulibre-git
commandLine = ['git', 'clone', 'https://github.com/max-kammerer/djvulibre.git', djvu]
}
}
exec {
workingDir file(djvu)
commandLine = ['git', 'checkout', 'a8ae572254a6cf5c0f036e655daf3517a0452e07']
}
}
}
//Keep until migration
task downloadAndPatchDjvu(dependsOn: [downloadDjvu])
task buildDjvu() {
doLast {
exec {
workingDir file(djvuModule)
commandLine ndkDir + "/ndk-build"
}
}
}
task djvuChain(dependsOn: [buildDjvu])
buildDjvu.mustRunAfter downloadDjvu
/*MUPDF CHAIN*/
task downloadLibArchive {
def version = "v3.7.6"
doLast {
def folder = new File(libarchive)
if (folder.exists()) {
exec {
commandLine = ['git', '-C', mupdf, 'checkout', '-f', 'master']
}
// Fetch
exec {
commandLine = ['git', '-C', mupdf, 'fetch', 'origin']
}
}
else {
exec {
commandLine = ['git', 'clone', 'https://github.com/libarchive/libarchive.git', libarchive]
}
}
exec {
workingDir file(folder)
commandLine = ['git', 'checkout', version]
}
}
}
task downloadMupdf {
def version = "1.24.9"
doLast {
def mupdfFolder = new File(mupdf)
if (mupdfFolder.exists()) {
// Switch to master so we can properly pull if it was
// detached.
exec {
commandLine = ['git', '-C', mupdf, 'checkout', '-f', 'master']
}
// Fetch
exec {
commandLine = ['git', '-C', mupdf, 'fetch', 'origin']
}
}
else {
exec {
commandLine = ['git', 'clone', 'https://github.com/ArtifexSoftware/mupdf.git', mupdf]
}
}
exec {
workingDir file(mupdf)
commandLine = ['git', 'checkout', version]
}
exec {
workingDir file(mupdf)
commandLine 'git', 'submodule', 'init'
}
exec {
workingDir file(mupdf)
commandLine 'git', 'submodule', 'update'
}
}
}
task downloadAndMakeMupdf(dependsOn: [downloadMupdf, downloadLibArchive]) {
doLast {
/*For more details see mupdf/platform/android/viewer/ReadMe.txt*/
exec {
workingDir file(mupdf)
commandLine 'make', 'generate'
}
}
}
task buildMupdf() {
doLast {
exec {
workingDir file(mupdfModule)
commandLine ndkDir + "/ndk-build"
}
}
}
task mupdfChain(dependsOn: [downloadAndMakeMupdf, buildMupdf])
mupdfChain.mustRunAfter djvuChain
/*!!!!!!!!!!RUN ME!!!!!!!!*/
task buildNativeLibs(dependsOn: [djvuChain, mupdfChain])