Flatten uhabits-android into a single gradle module

pull/707/head
Alinson S. Xavier 5 years ago
parent 4a4356b72a
commit 68f9b8339f

@ -23,7 +23,7 @@ AVDMANAGER="${ANDROID_HOME}/tools/bin/avdmanager"
AVDNAME="uhabitsTest"
GRADLE="./gradlew --stacktrace --quiet"
PACKAGE_NAME=org.isoron.uhabits
ANDROID_OUTPUTS_DIR="uhabits-android/uhabits-android/build/outputs"
ANDROID_OUTPUTS_DIR="uhabits-android/build/outputs"
VERSION=$(cat uhabits-android/gradle.properties | grep VERSION_NAME | sed -e 's/.*=//g;s/ //g')
if [ ! -f "${ANDROID_HOME}/platform-tools/adb" ]; then
@ -94,14 +94,14 @@ build_apk() {
log_info "Building release APK..."
$GRADLE assembleRelease
cp -v \
uhabits-android/build/outputs/apk/release/uhabits-android-release.apk \
build/outputs/apk/release/uhabits-android-release.apk \
build/loop-$VERSION-release.apk
fi
log_info "Building debug APK..."
$GRADLE assembleDebug --stacktrace || fail
cp -v \
uhabits-android/build/outputs/apk/debug/uhabits-android-debug.apk \
build/outputs/apk/debug/uhabits-android-debug.apk \
build/loop-$VERSION-debug.apk
cd ..
@ -242,16 +242,21 @@ parse_opts() {
}
remove_build_dir() {
rm -rfv uhabits-core/build
rm -rfv uhabits-web/node_modules/upath/build
rm -rfv uhabits-web/node_modules/core-js/build
rm -rfv uhabits-web/build
rm -rfv uhabits-core-legacy/build
rm -rfv uhabits-server/build
rm -rfv uhabits-android/build
rm -rfv uhabits-android/uhabits-android/build
rm -rfv uhabits-android/android-pickers/build
rm -rfv uhabits-web/node_modules
rm -rfv ./uhabits-core/build
rm -rfv ./uhabits-web/node_modules/upath/build
rm -rfv ./uhabits-web/node_modules/core-js/build
rm -rfv ./uhabits-web/build
rm -rfv ./uhabits-core-legacy/build
rm -rfv ./uhabits-server/build
rm -rfv ./uhabits-android/build
rm -rfv ./uhabits-android/uhabits-android/build
rm -rfv ./uhabits-android/android-pickers/build
rm -rfv ./uhabits-web/node_modules
rm -rfv ./uhabits-core/.gradle
rm -rfv ./uhabits-core-legacy/.gradle
rm -rfv ./uhabits-server/.gradle
rm -rfv ./uhabits-android/.gradle
rm -rfv ./.gradle
}
main() {

@ -1,3 +1,3 @@
# Dummy settings.gradle file that helps F-Droid locate the Android project
# metadata (app description and screenshots). See #670 for more details.
include ':android:uhabits-android'
include ':uhabits-android'

@ -1,24 +0,0 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion COMPILE_SDK_VERSION as Integer
defaultConfig {
minSdkVersion MIN_SDK_VERSION as Integer
targetSdkVersion TARGET_SDK_VERSION as Integer
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
}

@ -1,25 +0,0 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /gemini-b/opt/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

@ -1,2 +0,0 @@
<manifest package="com.android"
xmlns:android="http://schemas.android.com/apk/res/android"/>

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="select_hours"/>
<string name="select_minutes"/>
<string name="color_picker_default_title"/>
<string name="clear"/>
<string name="clear_label"/>
<string name="done_label"/>
</resources>

@ -1,26 +1,118 @@
buildscript {
repositories {
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
plugins {
id 'com.github.triplet.play' version '2.6.2'
id "org.jlleitschuh.gradle.ktlint" version "9.4.1"
id 'com.android.application' version "4.1.0"
id "org.jetbrains.kotlin.android" version "$KOTLIN_VERSION"
id "org.jetbrains.kotlin.kapt" version "$KOTLIN_VERSION"
id "org.jetbrains.kotlin.android.extensions" version "$KOTLIN_VERSION"
}
repositories {
google()
jcenter()
}
android {
compileSdkVersion COMPILE_SDK_VERSION as Integer
def secretPropsFile = file(".secret/gradle.properties")
if (secretPropsFile.exists()) {
def secrets = new Properties()
secretPropsFile.withInputStream { secrets.load(it) }
signingConfigs {
release {
storeFile file(secrets.LOOP_KEY_STORE)
storePassword secrets.LOOP_STORE_PASSWORD
keyAlias secrets.LOOP_KEY_ALIAS
keyPassword secrets.LOOP_KEY_PASSWORD
}
}
buildTypes.release.signingConfig signingConfigs.release
}
dependencies {
classpath "com.android.tools.build:gradle:$BUILD_TOOLS_VERSION"
classpath "com.neenbedankt.gradle.plugins:android-apt:1.8"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
classpath "org.ajoberstar:grgit:1.5.0"
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.4.1"
defaultConfig {
versionCode VERSION_CODE as Integer
versionName "$VERSION_NAME"
minSdkVersion MIN_SDK_VERSION as Integer
targetSdkVersion TARGET_SDK_VERSION as Integer
applicationId "org.isoron.uhabits"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
testCoverageEnabled true
}
}
}
allprojects {
repositories {
google()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
lintOptions {
checkReleaseBuilds false
abortOnError false
disable 'GoogleAppIndexingWarning'
}
apply plugin: "org.jlleitschuh.gradle.ktlint"
compileOptions {
coreLibraryDesugaringEnabled true
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
}
dependencies {
androidTestImplementation "androidx.test.espresso:espresso-contrib:$ESPRESSO_VERSION"
androidTestImplementation "androidx.test.espresso:espresso-core:$ESPRESSO_VERSION"
androidTestImplementation "com.google.dagger:dagger:$DAGGER_VERSION"
androidTestImplementation "com.linkedin.dexmaker:dexmaker-mockito:2.28.0"
androidTestImplementation "com.linkedin.testbutler:test-butler-library:1.3.1"
androidTestImplementation "io.ktor:ktor-client-mock:$KTOR_VERSION"
androidTestImplementation "io.ktor:ktor-jackson:$KTOR_VERSION"
androidTestImplementation "org.mockito:mockito-core:2.28.2"
androidTestImplementation 'androidx.annotation:annotation:1.1.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
compileOnly "javax.annotation:jsr250-api:1.0"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.1'
implementation "com.github.paolorotolo:appintro:3.4.0"
implementation "com.google.code.findbugs:jsr305:3.0.2"
implementation "com.google.dagger:dagger:$DAGGER_VERSION"
implementation "com.google.guava:guava:30.0-android"
implementation "io.ktor:ktor-client-android:$KTOR_VERSION"
implementation "io.ktor:ktor-client-core:$KTOR_VERSION"
implementation "io.ktor:ktor-client-jackson:$KTOR_VERSION"
implementation "io.ktor:ktor-client-json:$KTOR_VERSION"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KOTLIN_VERSION"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$KX_COROUTINES_VERSION"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$KX_COROUTINES_VERSION"
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.google.zxing:core:3.4.1'
implementation 'com.opencsv:opencsv:3.10'
implementation files("../uhabits-core/build/libs/uhabits-core-jvm.jar")
kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
kaptAndroidTest "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
testImplementation "com.google.dagger:dagger:$DAGGER_VERSION"
testImplementation "junit:junit:4.12"
testImplementation "org.mockito:mockito-core:2.28.2"
testImplementation "org.mockito:mockito-inline:2.8.9"
}
kapt {
correctErrorTypes = true
}
play {
serviceAccountCredentials = file("../.secret/gcp-key.json")
track = "alpha"
}

@ -6,7 +6,7 @@ TARGET_SDK_VERSION = 29
COMPILE_SDK_VERSION = 29
DAGGER_VERSION = 2.25.4
KOTLIN_VERSION = 1.4.10
KOTLIN_VERSION = 1.4.21
KX_COROUTINES_VERSION = 1.4.2
SUPPORT_LIBRARY_VERSION = 28.0.0
AUTO_FACTORY_VERSION = 1.0-beta6

@ -1 +0,0 @@
uhabits-android/src/main/play/

@ -1 +1,14 @@
include ':uhabits-android', ':android-pickers'
pluginManagement {
repositories {
gradlePluginPortal()
jcenter()
google()
}
resolutionStrategy {
eachPlugin {
if (requested.id.id == "com.android.application") {
useModule("com.android.tools.build:gradle:${requested.version}")
}
}
}
}

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

Loading…
Cancel
Save