Updater: Redo project structure

* Let's be more Android Studio friendly
* While at it match AOSP deps with Gradle ones and update them

Change-Id: Ib8829e3d954ce43fbf19280d1db2bc43c6fc89e0
This commit is contained in:
Sebastiano Barezzi 2023-01-03 01:46:25 +01:00 committed by Nolen Johnson
parent ae11300ff0
commit 755560bbcd
124 changed files with 430 additions and 96 deletions

8
.gitignore vendored
View File

@ -1,13 +1,13 @@
*.iml
.gradle
/local.properties
.idea
/.idea
.DS_Store
/build
/captures
/gradle
/gradlew
/gradlew.bat
/system_libs/*.jar
/keystore.properties
.externalNativeBuild
.cxx
*.jks
local.properties

1
app/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

View File

@ -1,17 +1,7 @@
//
// Copyright (C) 2022 The LineageOS Project
// Copyright (C) 2022-2023 The LineageOS Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// SPDX-License-Identifier: Apache-2.0
//
android_app {
@ -20,23 +10,26 @@ android_app {
// Include SettingsLib and its dependencies
defaults: ["SettingsLibDefaults"],
srcs: ["src/**/*.java"],
resource_dirs: ["res"],
static_libs: [
"com.google.android.material_material",
"androidx.core_core",
"androidx.appcompat_appcompat",
"androidx.cardview_cardview",
"androidx.localbroadcastmanager_localbroadcastmanager",
"androidx.preference_preference",
"androidx.recyclerview_recyclerview",
],
srcs: ["src/main/java/**/*.java"],
resource_dirs: ["src/main/res"],
manifest: "src/main/AndroidManifest.xml",
platform_apis: true,
privileged: true,
certificate: "platform",
system_ext_specific: true,
static_libs: [
"androidx.core_core-ktx",
"androidx.appcompat_appcompat",
"androidx.cardview_cardview",
"androidx.lifecycle_lifecycle-viewmodel-ktx",
"androidx.localbroadcastmanager_localbroadcastmanager",
"androidx.preference_preference",
"androidx.recyclerview_recyclerview",
"com.google.android.material_material",
],
optimize: {
proguard_flags_files: ["proguard.flags"],
},

80
app/build.gradle.kts Normal file
View File

@ -0,0 +1,80 @@
import java.util.Properties
plugins {
id("com.android.application")
id("kotlin-android")
}
val keystorePropertiesFile = rootProject.file("keystore.properties")
val keystoreProperties = Properties().apply {
if (keystorePropertiesFile.exists()) {
load(keystorePropertiesFile.inputStream())
}
}
android {
compileSdk = 33
defaultConfig {
applicationId = "org.lineageos.updater"
minSdk = 27
targetSdk = 33
versionCode = 1
versionName = "1.0"
}
buildTypes {
getByName("release") {
// Includes the default ProGuard rules files.
setProguardFiles(
listOf(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
)
}
getByName("debug") {
// Append .dev to package name so we won't conflict with AOSP build.
applicationIdSuffix = ".dev"
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
signingConfigs {
create("release") {
(keystoreProperties["keyAlias"] as String?)?.let {
keyAlias = it
}
(keystoreProperties["keyPassword"] as String?)?.let {
keyPassword = it
}
(keystoreProperties["storeFile"] as String?)?.let {
storeFile = file(it)
}
(keystoreProperties["storePassword"] as String?)?.let {
storePassword = it
}
}
}
}
dependencies {
compileOnly(fileTree(mapOf("dir" to "../system_libs", "include" to listOf("*.jar"))))
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.cardview:cardview:1.0.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1")
implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.1.0")
implementation("androidx.preference:preference:1.2.0")
implementation("androidx.recyclerview:recyclerview:1.2.1")
implementation("com.google.android.material:material:1.9.0-alpha01")
}

Some files were not shown because too many files have changed in this diff Show More