mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
354 lines
12 KiB
Groovy
354 lines
12 KiB
Groovy
import org.gradle.api.tasks.wrapper.Wrapper.DistributionType
|
|
|
|
buildscript {
|
|
ext.kotlin_version = '1.3.11'
|
|
repositories {
|
|
google()
|
|
jcenter()
|
|
}
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle:3.4.1'
|
|
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
}
|
|
}
|
|
|
|
tasks {
|
|
wrapper {
|
|
gradleVersion = "5.3.1"
|
|
distributionType = DistributionType.ALL
|
|
}
|
|
}
|
|
|
|
final String SUPPORT_LIBS_VERSION = '28.0.0-alpha1'
|
|
|
|
Properties localProps = new Properties()
|
|
File localPropsFile = project.rootProject.file('local.properties')
|
|
if (localPropsFile.exists()) {
|
|
localProps.load(localPropsFile.newDataInputStream())
|
|
}
|
|
|
|
def isPublicBuild = System.getenv("CI_BUILD") == "true" && System.getenv("DRONE_BRANCH") == "alpha"
|
|
|
|
apply plugin: 'com.android.application'
|
|
apply plugin: 'kotlin-android'
|
|
apply plugin: 'com.google.protobuf'
|
|
|
|
android {
|
|
compileSdkVersion 28
|
|
buildToolsVersion '28.0.3'
|
|
|
|
signingConfigs {
|
|
ci {
|
|
storeFile file("debug.jks")
|
|
storePassword System.getenv("STORE_PASSWORD")
|
|
keyAlias "Lawnchair"
|
|
keyPassword System.getenv("KEY_PASSWORD")
|
|
}
|
|
}
|
|
defaultConfig {
|
|
minSdkVersion 21
|
|
targetSdkVersion 28
|
|
|
|
if (System.getenv("CI_BUILD") == "true") {
|
|
versionCode = Integer.valueOf(System.getenv("CI_BUILD_NUMBER"))
|
|
versionName = System.getenv("MAJOR_MINOR") + (System.getenv("DRONE") ? "-" : ".") + System.getenv("CI_BUILD_NUMBER")
|
|
} else {
|
|
versionCode 1
|
|
versionName "2.0"
|
|
}
|
|
|
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
vectorDrawables.useSupportLibrary = true
|
|
|
|
buildConfigField "boolean", "FEATURE_QUINOA", "true"
|
|
buildConfigField "boolean", "FEATURE_SETTINGS_SEARCH", "true"
|
|
buildConfigField "boolean", "DEBUG_STRICT_MODE", isPublicBuild ? "false" : "true"
|
|
buildConfigField "boolean", "HAS_LEAKCANARY", "false"
|
|
|
|
def githubToken = localProps.getProperty('githubToken') ?: '"' + System.getenv("GITHUB_TOKEN") + '"'
|
|
buildConfigField "String", "GITHUB_TOKEN", githubToken
|
|
|
|
buildConfigField "boolean", "SIGNATURE_VERIFICATION", "false"
|
|
|
|
def debugMenuCode = System.getenv("DEBUG_MENU_CODE") ?: "veryperu"
|
|
buildConfigField "String", "DEBUG_MENU_CODE_HASH", '"' + debugMenuCode.digest('SHA-1') + '"'
|
|
|
|
def accuWeatherKey = localProps.getProperty('accu_key') ?: '"' + System.getenv("ACCU_KEY") + '"'
|
|
buildConfigField "String", "ACCUWEATHER_KEY", accuWeatherKey
|
|
|
|
ndk {
|
|
abiFilters "armeabi-v7a", "x86", "arm64-v8a"
|
|
}
|
|
}
|
|
buildTypes {
|
|
debug {
|
|
minifyEnabled false
|
|
if (System.getenv("CI_BUILD") == "true") {
|
|
if (System.getenv("CI_EVENT_TYPE") != "pull_request") {
|
|
signingConfig signingConfigs.ci
|
|
}
|
|
}
|
|
|
|
dexOptions {
|
|
matchingFallbacks = ['debug']
|
|
}
|
|
|
|
buildConfigField "boolean", "HAS_LEAKCANARY", isPublicBuild ? "false" : "true"
|
|
}
|
|
|
|
optimized {
|
|
initWith debug
|
|
minifyEnabled true
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
|
|
'proguard.flags'
|
|
if (System.getenv("CI_BUILD") == "true") {
|
|
if (System.getenv("CI_EVENT_TYPE") != "pull_request") {
|
|
signingConfig signingConfigs.ci
|
|
}
|
|
}
|
|
}
|
|
|
|
release {
|
|
minifyEnabled true
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
|
|
'proguard.flags'
|
|
if (System.getenv("CI_BUILD") == "true") {
|
|
if (System.getenv("CI_EVENT_TYPE") != "pull_request") {
|
|
signingConfig signingConfigs.ci
|
|
}
|
|
}
|
|
|
|
dexOptions {
|
|
matchingFallbacks = ['release']
|
|
}
|
|
}
|
|
}
|
|
|
|
lintOptions {
|
|
checkReleaseBuilds false
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = '1.8'
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
flavorDimensions "default", "custom", "build"
|
|
|
|
productFlavors {
|
|
aosp {
|
|
dimension "default"
|
|
applicationId 'ch.deletescape.lawnchair'
|
|
testApplicationId 'com.android.launcher3.tests'
|
|
}
|
|
|
|
l3go {
|
|
dimension "default"
|
|
applicationId 'com.android.launcher3'
|
|
testApplicationId 'com.android.launcher3.tests'
|
|
}
|
|
|
|
quickstep {
|
|
dimension "default"
|
|
applicationId 'ch.deletescape.lawnchair'
|
|
testApplicationId 'com.android.launcher3.tests'
|
|
}
|
|
|
|
lawnchair {
|
|
dimension "custom"
|
|
}
|
|
|
|
dev {
|
|
dimension "build"
|
|
// Use v1 dev package name for compatibility testing
|
|
if (localProps.getProperty("v1compat") != "true") {
|
|
applicationIdSuffix ".dev"
|
|
}
|
|
versionNameSuffix "-dev"
|
|
}
|
|
|
|
ci {
|
|
dimension "build"
|
|
applicationIdSuffix ".ci"
|
|
versionNameSuffix "-ci-" + System.getenv("DRONE_BRANCH")
|
|
|
|
buildConfigField "boolean", "SIGNATURE_VERIFICATION", "true"
|
|
}
|
|
|
|
plah {
|
|
dimension "build"
|
|
applicationIdSuffix ".plah"
|
|
|
|
buildConfigField "boolean", "SIGNATURE_VERIFICATION", "true"
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
res.srcDirs = ['res']
|
|
java.srcDirs = ['src']
|
|
aidl.srcDirs = ['src']
|
|
assets.srcDirs = ['assets']
|
|
manifest.srcFile 'AndroidManifest-common.xml'
|
|
proto {
|
|
srcDir 'protos/'
|
|
srcDir 'proto_overrides/'
|
|
srcDir 'proto_pixel/'
|
|
}
|
|
}
|
|
|
|
debug {
|
|
manifest.srcFile "AndroidManifest.xml"
|
|
}
|
|
|
|
optimized {
|
|
manifest.srcFile "AndroidManifest.xml"
|
|
}
|
|
|
|
release {
|
|
manifest.srcFile "AndroidManifest.xml"
|
|
}
|
|
|
|
androidTest {
|
|
res.srcDirs = ['tests/res']
|
|
java.srcDirs = ['tests/src']
|
|
manifest.srcFile "tests/AndroidManifest-common.xml"
|
|
}
|
|
|
|
androidTestDebug {
|
|
manifest.srcFile "tests/AndroidManifest.xml"
|
|
}
|
|
|
|
aosp {
|
|
java.srcDirs = ['src_flags', "src_ui_overrides"]
|
|
}
|
|
|
|
l3go {
|
|
res.srcDirs = ['go/res']
|
|
java.srcDirs = ['go/src_flags', "src_ui_overrides"]
|
|
manifest.srcFile "go/AndroidManifest.xml"
|
|
}
|
|
|
|
quickstep {
|
|
res.srcDirs = ['quickstep/res']
|
|
java.srcDirs = ['src_flags', 'quickstep/src']
|
|
manifest.srcFile "quickstep/AndroidManifest.xml"
|
|
}
|
|
|
|
lawnchair {
|
|
res.srcDirs = ['lawnchair/res']
|
|
java.srcDirs = ['lawnchair/src']
|
|
manifest.srcFile "lawnchair/AndroidManifest.xml"
|
|
}
|
|
}
|
|
|
|
gradle.projectsEvaluated {
|
|
tasks.withType(JavaCompile) {
|
|
options.compilerArgs.add('-Xbootclasspath/p:lawnchair/libs/framework.jar')
|
|
}
|
|
}
|
|
}
|
|
|
|
afterEvaluate {
|
|
android.applicationVariants.all { variant ->
|
|
variant.resValue 'string', 'application_id', variant.applicationId
|
|
}
|
|
}
|
|
|
|
apply from: 'lawnchair/smali.gradle'
|
|
|
|
allprojects {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
jcenter()
|
|
maven { url 'https://jitpack.io' }
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation "com.android.support:appcompat-v7:${SUPPORT_LIBS_VERSION}"
|
|
implementation "com.android.support:cardview-v7:${SUPPORT_LIBS_VERSION}"
|
|
implementation "com.android.support:design:${SUPPORT_LIBS_VERSION}"
|
|
implementation "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}"
|
|
implementation "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}"
|
|
implementation "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
|
|
implementation "com.android.support:palette-v7:${SUPPORT_LIBS_VERSION}"
|
|
implementation "com.android.support:preference-v7:${SUPPORT_LIBS_VERSION}"
|
|
implementation "com.android.support:preference-v14:${SUPPORT_LIBS_VERSION}"
|
|
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
|
|
|
|
implementation 'com.github.florent37:fiftyshadesof:1.0.0'
|
|
implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
implementation 'com.github.KwabenBerko:OpenWeatherMap-Android-Library:2.0.1'
|
|
implementation 'com.github.LawnchairLauncher:chroma:1.2.6'
|
|
implementation 'com.github.LawnchairLauncher:hoko-lite:0e21db9ae5'
|
|
implementation('com.github.LawnchairLauncher:attribouter-y:0.1.6') {
|
|
// The "MaterialButton" styleable defines an attr named iconSize which breaks compatibility with our source base
|
|
exclude group: 'com.android.support', module: 'design'
|
|
}
|
|
implementation 'com.github.bumptech.glide:glide:4.8.0'
|
|
|
|
implementation 'eu.chainfire:libsuperuser:1.0.0.201704021214'
|
|
implementation 'eu.chainfire:librootjava:1.3.0'
|
|
implementation 'com.luckycatlabs:SunriseSunsetCalculator:1.2'
|
|
implementation 'me.mvdw.recyclerviewmergeadapter:recyclerviewmergeadapter:2.1.0'
|
|
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
|
|
implementation 'com.squareup.okhttp3:okhttp:4.0.0-RC1'
|
|
implementation 'com.squareup.okhttp3:logging-interceptor:4.0.0-RC1'
|
|
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
|
|
|
|
quickstepImplementation project(':systemui-shared')
|
|
lawnchairImplementation files('lawnchair/libs/sesame-lib.aar')
|
|
|
|
if (!isPublicBuild) {
|
|
// TODO: update to 2.x when we're on AndroidX
|
|
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
|
|
debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.3'
|
|
optimizedImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
|
|
optimizedImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.3'
|
|
} else {
|
|
implementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
|
|
}
|
|
|
|
testImplementation 'junit:junit:4.12'
|
|
androidTestImplementation "org.mockito:mockito-core:1.9.5"
|
|
androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
|
|
androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
|
|
androidTestImplementation 'com.android.support.test:runner:1.0.0'
|
|
androidTestImplementation 'com.android.support.test:rules:1.0.0'
|
|
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
|
|
androidTestImplementation "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}"
|
|
}
|
|
|
|
protobuf {
|
|
// Configure the protoc executable
|
|
protoc {
|
|
artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
|
|
|
|
generateProtoTasks {
|
|
all().each { task ->
|
|
task.builtins {
|
|
remove java
|
|
javanano {
|
|
option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
|
|
option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
|
|
option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
|
|
option "java_package=search.proto|com.google.android.apps.nexuslauncher.search.nano"
|
|
option "java_package=smartspace.proto|com.google.android.apps.nexuslauncher.smartspace.nano"
|
|
option "enum_style=java"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
apply plugin: 'kotlin-android-extensions'
|