Merge pull request #348 from zod/gradle-assets
Generate assets with gradle
This commit is contained in:
commit
61e648df0d
2 changed files with 40 additions and 13 deletions
|
@ -1,3 +1,5 @@
|
|||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
@ -16,7 +18,9 @@ android {
|
|||
|
||||
}
|
||||
|
||||
if(project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
sourceSets.main.assets.srcDirs += new File(project.buildDir, 'assets')
|
||||
|
||||
if(project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
signingConfigs {
|
||||
// this uses a file ~/.gradle/gradle.properties
|
||||
// with content:
|
||||
|
@ -38,29 +42,29 @@ android {
|
|||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
debuggable false
|
||||
if(project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
if(project.hasProperty("RELEASE_STORE_FILE")) {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
minifyEnabled false
|
||||
debuggable true
|
||||
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
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
checkReleaseBuilds false //added this line to the build.gradle under the /android/app/build.gradle
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
@ -82,6 +86,9 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
applicationVariants.all {
|
||||
variant -> tasks["merge${variant.name.capitalize()}Assets"].dependsOn(generateProfilesZip)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -94,3 +101,23 @@ dependencies {
|
|||
implementation project(':brouter-util')
|
||||
|
||||
}
|
||||
|
||||
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')
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue