-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.gradle
156 lines (133 loc) · 4.32 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
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
147
148
149
150
151
152
153
154
155
156
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.4'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
apply plugin: 'com.android.application'
task "generatePngs"() {
group = 'Custom'
mkdir layout.buildDirectory.dir('generated_resources')
["mipmap-mdpi", "mipmap-hdpi", "mipmap-xhdpi", "mipmap-xxhdpi", "mipmap-xxxhdpi", ].each {
mkdir layout.buildDirectory.dir("generated_resources/${it}")
}
exec {
executable = 'rsvg-convert'
args = [ "wivrn.svg", "-w", "48", "-h", "48", "-o", layout.buildDirectory.file('generated_resources/mipmap-mdpi/ic_wivrn_launcher.png').get().asFile ]
workingDir 'images'
}
exec {
executable = 'rsvg-convert'
args = [ "wivrn.svg", "-w", "72", "-h", "72", "-o", layout.buildDirectory.file('generated_resources/mipmap-hdpi/ic_wivrn_launcher.png').get().asFile ]
workingDir 'images'
}
exec {
executable = 'rsvg-convert'
args = [ "wivrn.svg", "-w", "96", "-h", "96", "-o", layout.buildDirectory.file('generated_resources/mipmap-xhdpi/ic_wivrn_launcher.png').get().asFile ]
workingDir 'images'
}
exec {
executable = 'rsvg-convert'
args = [ "wivrn.svg", "-w", "144", "-h", "144", "-o", layout.buildDirectory.file('generated_resources/mipmap-xxhdpi/ic_wivrn_launcher.png').get().asFile ]
workingDir 'images'
}
exec {
executable = 'rsvg-convert'
args = [ "wivrn.svg", "-w", "192", "-h", "192", "-o", layout.buildDirectory.file('generated_resources/mipmap-xxxhdpi/ic_wivrn_launcher.png').get().asFile ]
workingDir 'images'
}
}
android {
namespace "org.meumeu.wivrn"
ndkVersion "26.1.10909125"
defaultConfig {
applicationId "org.meumeu.wivrn"
// for Vulkan, need at least 24
// for AImage_getHardwareBuffer, API 26
minSdkVersion 29
compileSdkVersion 29
versionName = "1.0"
versionCode = 1
externalNativeBuild {
cmake {
arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_static', '-DCMAKE_ANDROID_NDK_VERSION=' + ndkVersion, '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON', '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON', '-DWIVRN_USE_SYSTEM_FREETYPE=OFF', '-DWIVRN_BUILD_CLIENT=ON', '-DWIVRN_BUILD_SERVER=OFF', '-DWIVRN_WERROR=ON'
resValue "string", "app_name", "WiVRn"
}
}
}
signingConfigs {
if (project.hasProperty("signingKeyPassword")) {
release {
storeFile file("ks.keystore")
keyAlias "default_key"
storePassword signingKeyPassword // Set in gradle.properties
keyPassword signingKeyPassword
enableV2Signing true
}
}
}
buildTypes {
if (project.hasProperty("signingKeyPassword")) {
release {
signingConfig signingConfigs.release
}
}
releaseDebuggable {
initWith release
debuggable true
}
debugWithValidationLayer {
initWith debug
externalNativeBuild {
cmake {
arguments '-DUSE_ANDROID_VALIDATION_LAYER=ON'
}
}
}
}
flavorDimensions "device"
productFlavors {
pico {
dimension "device"
externalNativeBuild {
cmake {
abiFilters 'arm64-v8a'
arguments '-DPICO=ON'
}
}
}
standard {
dimension "device"
externalNativeBuild {
cmake {
abiFilters 'arm64-v8a'//, 'x86_64'
}
}
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
res.srcDirs = [ 'resources', layout.buildDirectory.dir('generated_resources') ]
assets.srcDir 'assets'
}
}
externalNativeBuild {
cmake {
version '3.22.1'
path 'CMakeLists.txt'
}
}
applicationVariants.all { variant ->
tasks["assemble${variant.name.capitalize()}"].finalizedBy "generatePngs"
}
}