-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathbuild.gradle
111 lines (94 loc) · 3.29 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
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.8.0'
}
}
repositories {
google()
mavenCentral()
maven { url = 'https://jitpack.io' }
}
apply plugin: qtGradlePluginType
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
//noinspection GradleDependency
implementation 'androidx.core:core:1.13.1'
implementation 'com.github.mik3y:usb-serial-for-android:3.8.1'
}
def getTimestampStr() { return new Date().format('yyyyMMddHHmmss') }
def timestampInt = (int)(new Date().getTime() / 1000 / 1)
android {
/*******************************************************
* The following variables:
* - androidBuildToolsVersion,
* - androidCompileSdkVersion
* - qtAndroidDir - holds the path to qt android files
* needed to build any Qt application
* on Android.
* - qtGradlePluginType - whether to build an app or a library
*
* are defined in gradle.properties file. This file is
* updated by QtCreator and androiddeployqt tools.
* Changing them manually might break the compilation!
*******************************************************/
// namespace = androidPackageName
namespace = "org.mavlink.qgroundcontrol"
compileSdkVersion androidCompileSdkVersion
buildToolsVersion androidBuildToolsVersion
ndkVersion = androidNdkVersion
// Extract native libraries from the APK
packagingOptions.jniLibs.useLegacyPackaging = true
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = [qtAndroidDir + '/src', 'src', 'java']
aidl.srcDirs = [qtAndroidDir + '/src', 'src', 'aidl']
res.srcDirs = [qtAndroidDir + '/res', 'res']
resources.srcDirs = ['resources']
renderscript.srcDirs = ['src']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
}
tasks.withType(JavaCompile) {
options.incremental = true
// options.compilerArgs += ['-Xlint:deprecation']
}
buildFeatures {
buildConfig = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
lintOptions {
abortOnError = false
}
// Do not compress Qt binary resources file
aaptOptions {
noCompress 'rcc'
}
defaultConfig {
resConfig "en"
minSdkVersion qtMinSdkVersion
targetSdkVersion qtTargetSdkVersion
ndk.abiFilters = qtTargetAbiList.split(",")
// println "applicationId: ${applicationId}"
println "minSdkVersion: ${minSdkVersion}"
println "targetSdkVersion: ${targetSdkVersion}"
println "ndk.abiFilters: ${ndk.abiFilters}"
println "versionCode: ${versionCode}"
println "versionName: ${versionName}"
}
println "timestamp: " + getTimestampStr()
println "androidPackageName: ${namespace}"
println "androidCompileSdkVersion: ${compileSdkVersion}"
println "androidBuildToolsVersion: ${buildToolsVersion}"
println "androidNdkVersion: ${ndkVersion}"
println "project.name: ${project.name}"
println "qtAndroidDir: ${qtAndroidDir}"
}