/
build.gradle
151 lines (125 loc) · 4.64 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
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 33
defaultConfig {
namespace 'btools.routingapp'
applicationId "btools.routingapp"
versionCode 47
versionName project.version
resValue('string', 'app_version', defaultConfig.versionName)
setProperty("archivesBaseName", "BRouterApp." + defaultConfig.versionName)
minSdkVersion 14
targetSdkVersion 33
resConfigs "en"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
sourceSets.main.assets.srcDirs += new File(project.buildDir, 'assets')
if (project.hasProperty("RELEASE_STORE_FILE") && RELEASE_STORE_FILE.length() > 0) {
signingConfigs {
// this uses a file ~/.gradle/gradle.properties
// with content:
// RELEASE_STORE_FILE={path to your keystore}
// RELEASE_STORE_PASSWORD=*****
// RELEASE_KEY_ALIAS=*****
// RELEASE_KEY_PASSWORD=*****
//
release {
// enable signingConfig in buildTypes to get a signed apk file
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
// Optional, specify signing versions used
v1SigningEnabled true
v2SigningEnabled true
}
}
}
buildTypes {
release {
minifyEnabled false
debuggable false
if (project.hasProperty("RELEASE_STORE_FILE") && RELEASE_STORE_FILE.length() > 0) {
signingConfig signingConfigs.release
}
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
//added this line to the build.gradle under the /android/app/build.gradle
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
applicationVariants.all {
variant ->
{
tasks["merge${variant.name.capitalize()}Assets"].dependsOn(generateProfilesZip)
tasks["merge${variant.name.capitalize()}Assets"].dependsOn(generateReadmesZip)
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
implementation 'androidx.work:work-runtime:2.8.0'
implementation 'com.google.android.material:material:1.8.0'
implementation project(':brouter-mapaccess')
implementation project(':brouter-core')
implementation project(':brouter-expressions')
implementation project(':brouter-util')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.work:work-testing:2.8.0'
}
gradle.projectsEvaluated {
preBuild.dependsOn(generateProfilesZip, generateReadmesZip)
}
check.dependsOn 'checkstyle'
task checkstyle(type: Checkstyle) {
source 'src'
include '**/*.java'
exclude '**/gen/**'
classpath = files()
}
task generateProfiles(type: Exec) {
commandLine = "../misc/scripts/generate_profile_variants.sh"
}
task generateProfilesZip(type: Zip) {
if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) {
logger.warn("Note: On Windows run script '../misc/scripts/generate_profile_variants.sh' manually to include all profiles")
} else {
dependsOn generateProfiles
}
archiveFileName = "profiles2.zip"
from("../misc/profiles2") {
exclude "all.brf"
exclude "car-traffic_analysis.brf"
exclude "car-vario.brf"
exclude "softaccess.brf"
}
destinationDirectory = layout.buildDirectory.dir("assets")
}
task generateReadmesZip(type: Zip) {
archiveFileName = "readmes.zip"
from("../docs") {
include("users/android_quickstart.md")
include("users/android_advanced.md")
include("developers/profile_developers_guide.md")
include("developers/build_segments.md")
include("privacy_policy.md")
}
destinationDirectory = layout.buildDirectory.dir("assets")
}