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 {
|
plugins {
|
||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
}
|
}
|
||||||
|
@ -16,6 +18,8 @@ android {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets.main.assets.srcDirs += new File(project.buildDir, 'assets')
|
||||||
|
|
||||||
if(project.hasProperty("RELEASE_STORE_FILE")) {
|
if(project.hasProperty("RELEASE_STORE_FILE")) {
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
// this uses a file ~/.gradle/gradle.properties
|
// this uses a file ~/.gradle/gradle.properties
|
||||||
|
@ -82,6 +86,9 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
applicationVariants.all {
|
||||||
|
variant -> tasks["merge${variant.name.capitalize()}Assets"].dependsOn(generateProfilesZip)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -94,3 +101,23 @@ dependencies {
|
||||||
implementation project(':brouter-util')
|
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