From 688f6f6f89fde756ed3b687f556bf42f90b37f16 Mon Sep 17 00:00:00 2001 From: Adolfo Santiago Date: Fri, 18 Feb 2022 21:08:45 +0100 Subject: [PATCH] Try Groovy --- husky/app/build.gradle | 208 ++++++++++++ husky/app/build.gradle.kts | 313 ------------------ husky/build.gradle | 34 ++ husky/build.gradle.kts | 50 --- husky/buildSrc/build.gradle.kts | 7 - husky/buildSrc/src/main/kotlin/AppLibs.kt | 183 ---------- .../buildSrc/src/main/kotlin/Dependencies.kt | 103 ------ husky/buildSrc/src/main/kotlin/TestLibs.kt | 20 -- husky/dependencies.gradle | 137 ++++++++ husky/instance.gradle | 19 ++ .../{settings.gradle.kts => settings.gradle} | 2 +- husky/versions.gradle | 80 +++++ 12 files changed, 479 insertions(+), 677 deletions(-) create mode 100644 husky/app/build.gradle delete mode 100644 husky/app/build.gradle.kts create mode 100644 husky/build.gradle delete mode 100644 husky/build.gradle.kts delete mode 100644 husky/buildSrc/build.gradle.kts delete mode 100644 husky/buildSrc/src/main/kotlin/AppLibs.kt delete mode 100644 husky/buildSrc/src/main/kotlin/Dependencies.kt delete mode 100644 husky/buildSrc/src/main/kotlin/TestLibs.kt create mode 100644 husky/dependencies.gradle create mode 100644 husky/instance.gradle rename husky/{settings.gradle.kts => settings.gradle} (63%) create mode 100644 husky/versions.gradle diff --git a/husky/app/build.gradle b/husky/app/build.gradle new file mode 100644 index 0000000..19ecc6c --- /dev/null +++ b/husky/app/build.gradle @@ -0,0 +1,208 @@ +plugins { + id "com.android.application" + + id "kotlin-android" + id "kotlin-kapt" + + id "kotlin-android-extensions" + //id "kotlin-parcelize" +} + +android { + compileSdkVersion buildVersions.compileSdk + buildToolsVersion buildVersions.buildTools + + defaultConfig { + applicationId buildVersions.applicationId + + minSdkVersion buildVersions.minSdk + targetSdkVersion buildVersions.targetSdk + + versionCode buildVersions.versionCode + versionName buildVersions.versionName + + testInstrumentationRunner deps.testinstrunner + + buildConfigField("String", "APPLICATION_NAME", "\"$APP_NAME\"") + buildConfigField("String", "CUSTOM_LOGO_URL", "\"$CUSTOM_LOGO_URL\"") + buildConfigField("String", "CUSTOM_INSTANCE", "\"$CUSTOM_INSTANCE\"") + buildConfigField("String", "SUPPORT_ACCOUNT_URL", "\"$SUPPORT_ACCOUNT_URL\"") + } + + kapt { + arguments { + arg("room.schemaLocation", "$projectDir/schemas") + arg("room.incremental", "true") + } + } + + buildTypes { + debug { + debuggable true + + minifyEnabled false + shrinkResources false + zipAlignEnabled false + + // TODO: signing debug key + } + + release { + debuggable false + + minifyEnabled true + shrinkResources true + zipAlignEnabled true + + proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" + } + } + + flavorDimensions "husky", "release" + productFlavors { + husky { + dimension "husky" + } + + beta { + dimension "release" + } + } + + compileOptions { + sourceCompatibility = buildVersions.javaCompat + targetCompatibility = buildVersions.javaCompat + } + + kotlinOptions { + jvmTarget = buildVersions.javaCompat.toString() + } + + androidExtensions { + experimental = true + } + buildFeatures { + viewBinding true + } + + testOptions { + unitTests { + returnDefaultValues = true + includeAndroidResources = true + } + } + + sourceSets { + androidTest.assets.srcDirs += files("$projectDir/schemas".toString()) + } + + packagingOptions { + exclude "META-INF/DEPENDENCIES" + exclude "META-INF/LICENSE" + exclude "META-INF/LICENSE.txt" + exclude "META-INF/license.txt" + exclude "META-INF/NOTICE" + exclude "META-INF/NOTICE.txt" + exclude "META-INF/notice.txt" + exclude "META-INF/ASL2.0" + exclude "META-INF/*.kotlin_module" + exclude "LICENSE_OFL" + exclude "LICENSE_UNICODE" + } + + bundle { + language { + // bundle all languages in every apk so the dynamic language switching works + enableSplit = false + } + } +} + +dependencies { + implementation fileTree(dir: "libs", include: ["*.jar"]) + + implementation deps.androidx.appCompat + implementation deps.androidx.browser + implementation deps.androidx.cardView + implementation deps.androidx.constraintLayout + implementation deps.androidx.coreKtx + implementation deps.androidx.emoji + implementation deps.androidx.emojiAppCompat + implementation deps.androidx.emojiBundled + implementation deps.androidx.exifInterface + implementation deps.androidx.fragmentKtx + implementation deps.androidx.pagingRuntimeKtx + implementation deps.androidx.preferenceKtx + implementation deps.androidx.recyclerView + kapt deps.androidx.roomCompiler + implementation deps.androidx.roomRuntime + implementation deps.androidx.roomRxJava + implementation deps.androidx.shareTarget + implementation deps.androidx.swipeRefreshLayout + implementation deps.androidx.viewpager2 + implementation deps.androidx.workRuntime + implementation deps.androidx.lifecycle.commonJava + implementation deps.androidx.lifecycle.liveDataKtx + implementation deps.androidx.lifecycle.reactiveStreamsKtx + implementation deps.androidx.lifecycle.viewmodelKtx + + implementation deps.dagger.dagger + implementation deps.dagger.daggerAndroid + kapt deps.dagger.daggerCompiler + kapt deps.dagger.daggerProcessor + implementation deps.dagger.daggerSupport + + implementation deps.glide.glide + kapt deps.glide.glideCompiler + implementation deps.glide.glideImage + implementation deps.glide.glideImageViewFactory + implementation deps.glide.glideOkhttp + + implementation deps.google.flexbox + implementation deps.google.exoplayer + implementation deps.google.materialDesign + + implementation deps.kotlin.stdlib + implementation deps.kotlin.stdlibJdk + + implementation deps.rxjava.rxAndroid + implementation deps.rxjava.rxJava + implementation deps.rxjava.rxKotlin + + implementation deps.simplestack.ext + implementation deps.simplestack.lib + + implementation deps.square.retrofit + implementation deps.square.retrofitAdapterRxJ2 + implementation deps.square.retrofitConvGson + implementation deps.square.logginInterceptor + implementation deps.square.okhttp + implementation deps.square.okhttpBrotli + + implementation deps.acraMail + implementation deps.acraNotification + implementation deps.androidImageCropper + implementation deps.androidSvg + implementation deps.autodispose + implementation deps.autodisposeAndroidArchComp + implementation deps.bigImageViewer + implementation deps.conscryptAndroid + implementation deps.filemojiCompat + implementation deps.fragmentviewbindingdelegateKt + implementation deps.markdownEdit + implementation deps.materialDrawer + implementation deps.materialDrawerIconics + implementation deps.materialDrawerTypeface + implementation deps.sparkButton + implementation deps.timber + + testImplementation deps.testing.extJunit + testImplementation deps.testing.junit + testImplementation deps.testing.mockitoInline + testImplementation deps.testing.mockitoKotlin + testImplementation deps.testing.roboelectric + + androidTestImplementation deps.testing.espresso + androidTestImplementation deps.testing.junit + androidTestImplementation deps.testing.roomTesting +} diff --git a/husky/app/build.gradle.kts b/husky/app/build.gradle.kts deleted file mode 100644 index e211e30..0000000 --- a/husky/app/build.gradle.kts +++ /dev/null @@ -1,313 +0,0 @@ -import com.android.build.gradle.internal.api.BaseVariantOutputImpl -import com.project.starter.easylauncher.filter.ColorRibbonFilter - -plugins { - id(AppPlugins.androidApplication) - - kotlin(AppPlugins.androidBase) - kotlin(AppPlugins.kapt) - id(AppPlugins.kotlinExtensions) - // id(AppPlugins.kotlinParcelize) - - id(AppPlugins.easylauncher) version (AppPlugins.Versions.easylauncher) -} - -android { - compileSdk = AndroidSDK.compileSdk - buildToolsVersion = AndroidSDK.buildTools - - defaultConfig { - applicationId = DefaultConfig.applicationID - - minSdk = DefaultConfig.minSdk - targetSdk = DefaultConfig.targetSdk - - versionCode = DefaultConfig.versionCodeRel - versionName = DefaultConfig.versionNameRel - - testInstrumentationRunner = DefaultConfig.instrumentationRunner - - vectorDrawables.useSupportLibrary = true - - kapt { - arguments { - arg("room.schemaLocation", "$projectDir/schemas") - arg("room.incremental", true) - } - } - - // TODO: remove, just for compiling - buildConfigField( - "String", "APPLICATION_NAME", - "\"${CustomHuskyBuild.applicationName}\"" - ) - buildConfigField( - "String", "CUSTOM_LOGO_URL", - "\"${CustomHuskyBuild.customLogo}\"" - ) - buildConfigField( - "String", "CUSTOM_INSTANCE", - "\"${CustomHuskyBuild.customInstance}\"" - ) - buildConfigField( - "String", "SUPPORT_ACCOUNT_URL", - "\"${CustomHuskyBuild.supportAccountUrl}\"" - ) - } - - signingConfigs { - getByName(DefaultConfig.DebugSign.signingDebug) { - storeFile = file("$rootDir/${DefaultConfig.DebugSign.keystoreFile}") - storePassword = DefaultConfig.DebugSign.keystorePassword - keyAlias = DefaultConfig.DebugSign.keyAlias - keyPassword = DefaultConfig.DebugSign.keyPassword - } - } - - buildTypes { - getByName(BuildTypes.debug) { - isDebuggable = true - isMinifyEnabled = false - isShrinkResources = false - - signingConfig = signingConfigs.getByName(DefaultConfig.DebugSign.signingDebug) - } - - getByName(BuildTypes.release) { - isDebuggable = false - isMinifyEnabled = true - isShrinkResources = true - - proguardFiles( - getDefaultProguardFile(ProguardFile.defaultFile), - ProguardFile.defaultRules - ) - } - } - - flavorDimensions.addAll( - listOf( - Flavors.Dimensions.husky, - Flavors.Dimensions.release - ) - ) - productFlavors { - create(Flavors.newhusky) { - dimension = Flavors.Dimensions.release - - applicationId = DefaultConfig.NewHusky.applicationID - - minSdk = DefaultConfig.minSdk - targetSdk = DefaultConfig.targetSdk - - versionCode = DefaultConfig.NewHusky.versionCode - versionName = DefaultConfig.NewHusky.versionName - } - - create(Flavors.husky) { - dimension = Flavors.Dimensions.husky - } - - create(Flavors.dev) { - dimension = Flavors.Dimensions.release - - applicationId = DefaultConfig.Dev.applicationID - - minSdk = DefaultConfig.minSdk - targetSdk = DefaultConfig.targetSdk - - versionCode = DefaultConfig.Dev.versionCode - versionName = DefaultConfig.Dev.versionName - } - - create(Flavors.beta) { - dimension = Flavors.Dimensions.release - - versionNameSuffix = "-${BetaConfig.betaSuffix}${BetaConfig.betaSuffixVersion}" - } - - create(Flavors.stable) { - dimension = Flavors.Dimensions.release - } - } - - applicationVariants.all { - outputs.forEach { output -> - if(output is BaseVariantOutputImpl) { - output.outputFileName = - "husky_${versionName}.${output.outputFile.extension}" - } - } - } - - lint { - // abortOnError = true - disable.addAll( - listOf( - "MissingTranslation", - "ExtraTranslation", - "AppCompatCustomView", - "UseRequireInsteadOfGet" - ) - ) - } - - compileOptions { - sourceCompatibility = DefaultConfig.javaVersion - targetCompatibility = DefaultConfig.javaVersion - } - - kotlinOptions { - jvmTarget = DefaultConfig.jvmTarget - } - - buildFeatures { - viewBinding = true - } - - // TODO: remove this, only for compiling - androidExtensions { - isExperimental = true - } - - testOptions { - unitTests { - isReturnDefaultValues = true - isIncludeAndroidResources = true - } - } - - sourceSets { - getByName("androidTest").assets.srcDirs("$projectDir/schemas") - } - - packagingOptions { - resources.excludes.addAll( - listOf( - "LICENSE_OFL", - "LICENSE_UNICODE" - ) - ) - } - - bundle { - language { - enableSplit = true - } - } -} - -dependencies { - implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar")))) - - implementation(ApplicationLibs.AndroidX.appCompat) - implementation(ApplicationLibs.AndroidX.browser) - implementation(ApplicationLibs.AndroidX.cardView) - implementation(ApplicationLibs.AndroidX.constraintLayout) - implementation(ApplicationLibs.AndroidX.coreKtx) - implementation(ApplicationLibs.AndroidX.emoji) - implementation(ApplicationLibs.AndroidX.emojiAppCompat) - implementation(ApplicationLibs.AndroidX.emojiBundled) - implementation(ApplicationLibs.AndroidX.exifInterface) - implementation(ApplicationLibs.AndroidX.fragmentKtx) - implementation(ApplicationLibs.AndroidX.pagingRuntimeKtx) - implementation(ApplicationLibs.AndroidX.preferenceKtx) - implementation(ApplicationLibs.AndroidX.recyclerView) - kapt(ApplicationLibs.AndroidX.roomCompiler) - implementation(ApplicationLibs.AndroidX.roomRuntime) - implementation(ApplicationLibs.AndroidX.roomRxJava) - implementation(ApplicationLibs.AndroidX.shareTarget) - implementation(ApplicationLibs.AndroidX.swipeRefreshLayout) - implementation(ApplicationLibs.AndroidX.viewpager2) - implementation(ApplicationLibs.AndroidX.workRuntime) - implementation(ApplicationLibs.AndroidX.Lifecycle.commonJava) - implementation(ApplicationLibs.AndroidX.Lifecycle.liveDataKtx) - implementation(ApplicationLibs.AndroidX.Lifecycle.reactiveStreamsKtx) - implementation(ApplicationLibs.AndroidX.Lifecycle.viewmodelKtx) - - implementation(ApplicationLibs.Dagger.dagger) - implementation(ApplicationLibs.Dagger.daggerAndroid) - kapt(ApplicationLibs.Dagger.daggerCompiler) - kapt(ApplicationLibs.Dagger.daggerProcessor) - implementation(ApplicationLibs.Dagger.daggerSupport) - - implementation(ApplicationLibs.Glide.glide) - kapt(ApplicationLibs.Glide.glideCompiler) - implementation(ApplicationLibs.Glide.glideImage) - implementation(ApplicationLibs.Glide.glideImageViewFactory) - implementation(ApplicationLibs.Glide.glideOkhttp) - - implementation(ApplicationLibs.Google.flexbox) - implementation(ApplicationLibs.Google.exoplayer) - implementation(ApplicationLibs.Google.materialDesign) - - implementation(ApplicationLibs.Kotlin.stdlib) - implementation(ApplicationLibs.Kotlin.stdlibJdk) - - implementation(ApplicationLibs.RxJava.rxAndroid) - implementation(ApplicationLibs.RxJava.rxJava) - implementation(ApplicationLibs.RxJava.rxKotlin) - - implementation(ApplicationLibs.SimpleStack.ext) - implementation(ApplicationLibs.SimpleStack.lib) - - implementation(ApplicationLibs.Square.retrofit) - implementation(ApplicationLibs.Square.retrofitAdapterRxJ2) - implementation(ApplicationLibs.Square.retrofitConvGson) - implementation(ApplicationLibs.Square.logginInterceptor) - implementation(ApplicationLibs.Square.okhttp) - implementation(ApplicationLibs.Square.okhttpBrotli) - - implementation(ApplicationLibs.acraMail) - implementation(ApplicationLibs.acraNotification) - implementation(ApplicationLibs.androidImageCropper) - implementation(ApplicationLibs.androidSvg) - implementation(ApplicationLibs.autodispose) - implementation(ApplicationLibs.autodisposeAndroidArchComp) - implementation(ApplicationLibs.bigImageViewer) - implementation(ApplicationLibs.conscryptAndroid) - implementation(ApplicationLibs.filemojiCompat) - implementation(ApplicationLibs.fragmentviewbindingdelegateKt) - implementation(ApplicationLibs.markdownEdit) - implementation(ApplicationLibs.materialDrawer) - implementation(ApplicationLibs.materialDrawerIconics) - implementation(ApplicationLibs.materialDrawerTypeface) - implementation(ApplicationLibs.sparkButton) - implementation(ApplicationLibs.timber) - - testImplementation(TestLibs.extJunit) - testImplementation(TestLibs.junit) - testImplementation(TestLibs.mockitoInline) - testImplementation(TestLibs.mockitoKotlin) - testImplementation(TestLibs.roboelectric) - - androidTestImplementation(TestLibs.espresso) - androidTestImplementation(TestLibs.junit) - androidTestImplementation(TestLibs.roomTesting) -} - -easylauncher { - productFlavors { - register(Flavors.beta) { - filters( - customRibbon( - label = "Beta", - gravity = ColorRibbonFilter.Gravity.TOPRIGHT, - ribbonColor = "#DCDCDC", - labelColor = "#000000" - ) - ) - } - - register(Flavors.newhusky) { - filters( - customRibbon( - label = "NEW", - gravity = ColorRibbonFilter.Gravity.TOPRIGHT, - ribbonColor = "#DCDCDC", - labelColor = "#000000" - ) - ) - } - } -} diff --git a/husky/build.gradle b/husky/build.gradle new file mode 100644 index 0000000..9492bb8 --- /dev/null +++ b/husky/build.gradle @@ -0,0 +1,34 @@ +buildscript { + apply from: "versions.gradle" + apply from: "dependencies.gradle" + + apply from: "instance.gradle" + + addRepos(repositories) + + dependencies { + classpath deps.androidGradlePlugin + classpath deps.kotlinGradlePlugin + } +} + +allprojects { + addRepos(repositories) + + tasks.withType(JavaCompile) { + options.encoding(buildVersions.encoding) + options.compilerArgs += [ + "-Xlint:all", + "-Xlint:unchecked", + "-Xlint:-deprecation", + ] + } +} + +task clean(type: Delete) { + delete(rootProject.buildDir) + delete("${rootProject.buildDir}/app/huskyBeta") + delete("${rootProject.buildDir}/app/huskyStable") + delete("${rootProject.buildDir}/app/huskyDev") + delete("${rootProject.buildDir}/app/huskyNewhusky") +} diff --git a/husky/build.gradle.kts b/husky/build.gradle.kts deleted file mode 100644 index 13c140f..0000000 --- a/husky/build.gradle.kts +++ /dev/null @@ -1,50 +0,0 @@ -import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask - -buildscript { - addRepos(repositories) - - dependencies { - // Base - classpath(GradlePlugins.android) - classpath(GradlePlugins.kotlin) - - // Plugins - classpath(GradlePlugins.gradleVersions) - } -} - -allprojects { - addRepos(repositories) - - tasks.withType { - options.encoding = DefaultConfig.encoding - options.compilerArgs.addAll( - listOf( - "-Xlint:all", - "-Xlint:unchecked", - "-Xlint:-deprecation" - ) - ) - } - - apply { - plugin(AppPlugins.manesVersions) - } - - tasks.withType { - gradleReleaseChannel = "current" - - rejectVersionIf { - !isNonStable(candidate.version) - } - } -} - -tasks.register(BuildTasks.taskTypeClean) { - delete(buildDir) - delete("${projectDir}/buildSrc/build") - delete("${projectDir}/app/huskyBeta") - delete("${projectDir}/app/huskyStable") - delete("${projectDir}/app/huskyDev") - delete("${projectDir}/app/huskyNewhusky") -} diff --git a/husky/buildSrc/build.gradle.kts b/husky/buildSrc/build.gradle.kts deleted file mode 100644 index b6413e3..0000000 --- a/husky/buildSrc/build.gradle.kts +++ /dev/null @@ -1,7 +0,0 @@ -plugins { - `kotlin-dsl` -} - -repositories { - mavenCentral() -} diff --git a/husky/buildSrc/src/main/kotlin/AppLibs.kt b/husky/buildSrc/src/main/kotlin/AppLibs.kt deleted file mode 100644 index 1657c45..0000000 --- a/husky/buildSrc/src/main/kotlin/AppLibs.kt +++ /dev/null @@ -1,183 +0,0 @@ -object AppPlugins { - object Versions { - const val easylauncher = "5.0.0" - } - - const val androidApplication = "com.android.application" - const val androidBase = "android" - const val easylauncher = "com.starter.easylauncher" - const val kapt = "kapt" - const val kotlinExtensions = "kotlin-android-extensions" - const val kotlinParcelize = "kotlin-parcelize" - const val manesVersions = "com.github.ben-manes.versions" -} - -object ApplicationLibs { - private object Versions { - const val acra = "5.8.4" - const val androidImageCropper = "2.8.0" - const val androidSvg = "1.4" - const val appcompat = "1.3.1" - const val autodispose = "1.4.0" - const val bigImageViewer = "1.7.0" - const val browser = "1.3.0" - const val cardView = "1.0.0" - const val conscryptAndroid = "2.5.2" - const val constraintlayout = "2.1.3" - const val coreKtx = "1.3.2" - const val dagger = "2.38.1" - const val emoji = "1.1.0" - const val exifInterface = "1.3.3" - const val exoplayer = "2.16.0" - const val filemojiCompat = "1.0.17" - const val flexbox = "2.0.1" - const val fragmentKtx = "1.2.5" - const val fragmentviewbindingdelegateKt = "1.0.0" - const val glide = "4.12.0" - const val glideImage = "1.8.1" - const val lifecycle = "2.3.1" - const val markdownEdit = "1.0.0" - const val materialDesign = "1.4.0" - const val materialDrawer = "8.4.5" - const val materialDrawerTypeface = "3.0.1.4.original-kotlin@aar" - const val pagingRuntimeKtx = "2.1.2" - const val preferenceKtx = "1.1.1" - const val okhttpVersion = "4.9.3" - const val recyclerView = "1.2.1" - const val retrofit = "2.9.0" - const val room = "2.2.5" - const val rxAndroid = "2.1.1" - const val rxJava = "2.2.21" - const val rxKotlin = "2.4.0" - const val shareTarget = "1.0.0" - const val simplestack = "2.6.2" - const val simplestackExt = "2.2.2" - const val sparkButton = "4.1.0" - const val swipeRefreshLayout = "1.1.0" - const val timber = "5.0.1" - const val viewpager2 = "1.0.0" - const val workRuntime = "2.4.0" - } - - object AndroidX { - const val appCompat = "androidx.appcompat:appcompat:${Versions.appcompat}" - const val browser = "androidx.browser:browser:${Versions.browser}" - const val cardView = "androidx.cardview:cardview:${Versions.cardView}" - const val constraintLayout = - "androidx.constraintlayout:constraintlayout:${Versions.constraintlayout}" - const val coreKtx = "androidx.core:core-ktx:${Versions.coreKtx}" - const val emoji = "androidx.emoji:emoji:${Versions.emoji}" - const val emojiAppCompat = "androidx.emoji:emoji-appcompat:${Versions.emoji}" - const val emojiBundled = "androidx.emoji:emoji-bundled:${Versions.emoji}" - const val exifInterface = "androidx.exifinterface:exifinterface:${Versions.exifInterface}" - const val fragmentKtx = "androidx.fragment:fragment-ktx:${Versions.fragmentKtx}" - const val pagingRuntimeKtx = - "androidx.paging:paging-runtime-ktx:${Versions.pagingRuntimeKtx}" - const val preferenceKtx = "androidx.preference:preference-ktx:${Versions.preferenceKtx}" - const val recyclerView = "androidx.recyclerview:recyclerview:${Versions.recyclerView}" - const val roomCompiler = "androidx.room:room-compiler:${Versions.room}" - const val roomRuntime = "androidx.room:room-runtime:${Versions.room}" - const val roomRxJava = "androidx.room:room-rxjava2:${Versions.room}" - const val shareTarget = "androidx.sharetarget:sharetarget:${Versions.shareTarget}" - const val swipeRefreshLayout = - "androidx.swiperefreshlayout:swiperefreshlayout:${Versions.swipeRefreshLayout}" - const val viewpager2 = "androidx.viewpager2:viewpager2:${Versions.viewpager2}" - const val workRuntime = "androidx.work:work-runtime:${Versions.workRuntime}" - - object Lifecycle { - const val commonJava = "androidx.lifecycle:lifecycle-common-java8:${Versions.lifecycle}" - const val liveDataKtx = - "androidx.lifecycle:lifecycle-livedata-ktx:${Versions.lifecycle}" - const val reactiveStreamsKtx = - "androidx.lifecycle:lifecycle-reactivestreams-ktx:${Versions.lifecycle}" - const val viewmodelKtx = - "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.lifecycle}" - } - } - - object Dagger { - const val dagger = "com.google.dagger:dagger:${Versions.dagger}" - const val daggerAndroid = "com.google.dagger:dagger-android:${Versions.dagger}" - const val daggerCompiler = "com.google.dagger:dagger-compiler:${Versions.dagger}" - const val daggerProcessor = "com.google.dagger:dagger-android-processor:${Versions.dagger}" - const val daggerSupport = "com.google.dagger:dagger-android-support:${Versions.dagger}" - } - - object Glide { - const val glide = "com.github.bumptech.glide:glide:${Versions.glide}" - const val glideCompiler = "com.github.bumptech.glide:compiler:${Versions.glide}" - const val glideImage = "com.github.piasy:GlideImageLoader:${Versions.glideImage}" - const val glideImageViewFactory = - "com.github.piasy:GlideImageViewFactory:${Versions.glideImage}" - const val glideOkhttp = "com.github.bumptech.glide:okhttp3-integration:${Versions.glide}" - } - - object Google { - const val flexbox = "com.google.android:flexbox:${Versions.flexbox}" - const val exoplayer = "com.google.android.exoplayer:exoplayer:${Versions.exoplayer}" - const val materialDesign = "com.google.android.material:material:${Versions.materialDesign}" - } - - object Kotlin { - const val reflect = "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}" - const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}" - const val stdlibJdk = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}" - } - - object RxJava { - const val rxAndroid = "io.reactivex.rxjava2:rxandroid:${Versions.rxAndroid}" - const val rxJava = "io.reactivex.rxjava2:rxjava:${Versions.rxJava}" - const val rxKotlin = "io.reactivex.rxjava2:rxkotlin:${Versions.rxKotlin}" - } - - object SimpleStack { - const val lib = "com.github.Zhuinden:simple-stack:${Versions.simplestack}" - const val ext = "com.github.Zhuinden:simple-stack-extensions:${Versions.simplestackExt}" - } - - object Square { - const val retrofit = "com.squareup.retrofit2:retrofit:${Versions.retrofit}" - const val retrofitAdapterRxJ2 = - "com.squareup.retrofit2:adapter-rxjava2:${Versions.retrofit}" - const val retrofitConvGson = "com.squareup.retrofit2:converter-gson:${Versions.retrofit}" - - const val logginInterceptor = - "com.squareup.okhttp3:logging-interceptor:${Versions.okhttpVersion}" - const val okhttp = "com.squareup.okhttp3:okhttp:${Versions.okhttpVersion}" - const val okhttpBrotli = "com.squareup.okhttp3:okhttp-brotli:${Versions.okhttpVersion}" - } - - const val acraMail = "ch.acra:acra-mail:${Versions.acra}" - const val acraNotification = "ch.acra:acra-notification:${Versions.acra}" - const val androidSvg = "com.caverock:androidsvg-aar:${Versions.androidSvg}" - const val androidImageCropper = - "com.theartofdev.edmodo:android-image-cropper:${Versions.androidImageCropper}" - const val autodispose = "com.uber.autodispose:autodispose:${Versions.autodispose}" - const val autodisposeAndroidArchComp = - "com.uber.autodispose:autodispose-android-archcomponents:${Versions.autodispose}" - const val bigImageViewer = "com.github.piasy:BigImageViewer:${Versions.bigImageViewer}" - const val conscryptAndroid = "org.conscrypt:conscrypt-android:${Versions.conscryptAndroid}" - const val filemojiCompat = "de.c1710:filemojicompat:${Versions.filemojiCompat}" - const val fragmentviewbindingdelegateKt = - "com.github.Zhuinden:fragmentviewbindingdelegate-kt:${Versions.fragmentviewbindingdelegateKt}" - const val markdownEdit = "com.github.Tunous:MarkdownEdit:${Versions.markdownEdit}" - const val materialDrawer = "com.mikepenz:materialdrawer:${Versions.materialDrawer}" - const val materialDrawerIconics = - "com.mikepenz:materialdrawer-iconics:${Versions.materialDrawer}" - const val materialDrawerTypeface = - "com.mikepenz:google-material-typeface:${Versions.materialDrawerTypeface}" - const val sparkButton = "com.github.connyduck:sparkbutton:${Versions.sparkButton}" - const val timber = "com.jakewharton.timber:timber:${Versions.timber}" -} - -object GradlePlugins { - object Versions { - const val gradle = "7.1.0" - const val gradleVersions = "0.39.0" - } - - const val android = "com.android.tools.build:gradle:${Versions.gradle}" - const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}" - const val gradleVersions = - "com.github.ben-manes:gradle-versions-plugin:${Versions.gradleVersions}" -} diff --git a/husky/buildSrc/src/main/kotlin/Dependencies.kt b/husky/buildSrc/src/main/kotlin/Dependencies.kt deleted file mode 100644 index 86bf355..0000000 --- a/husky/buildSrc/src/main/kotlin/Dependencies.kt +++ /dev/null @@ -1,103 +0,0 @@ -import java.util.Locale -import org.gradle.api.JavaVersion -import org.gradle.api.artifacts.dsl.RepositoryHandler -import org.gradle.kotlin.dsl.maven - -const val kotlinVersion = "1.5.32" - -object AndroidSDK { - const val compileSdk = 30 - const val buildTools = "32.0.0" -} - -object CustomHuskyBuild { - const val applicationName = "Husky" - const val customLogo = "" - const val customInstance = "" - const val supportAccountUrl = "https://huskyapp.dev/users/husky" -} - -object DefaultConfig { - const val applicationID = "su.xash.husky" - const val minSdk = 23 - const val targetSdk = 30 - const val versionCodeRel = 175 - const val versionNameRel = "1.1.0" - - val javaVersion = JavaVersion.VERSION_11 - val jvmTarget = javaVersion.toString() - - const val instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - - const val encoding = "UTF-8" - - object DebugSign { - const val signingDebug = "debug" - const val keystoreFile = "debug.keystore" - const val keystorePassword = "android" - const val keyAlias = "androiddebugkey" - const val keyPassword = "android" - } - - object Dev { - const val applicationID = "su.xash.husky.dev" - - const val versionCode = 1 - const val versionName = "1.0.0" - } - - object NewHusky { - const val applicationID = "su.xash.husky.alpha" - - const val versionCode = 1 - const val versionName = "2.0.0" - } -} - -object BetaConfig { - const val betaSuffix = "beta" - const val betaSuffixVersion = "3" -} - -object BuildTypes { - const val debug = "debug" - const val release = "release" -} - -object Flavors { - object Dimensions { - const val husky = "husky" - const val release = "release" - } - - const val husky = "husky" - const val dev = "dev" - const val beta = "beta" - const val stable = "stable" - - const val newhusky = "newhusky" -} - -object ProguardFile { - const val defaultFile = "proguard-android-optimize.txt" - const val defaultRules = "proguard-rules.pro" -} - -object BuildTasks { - const val taskTypeClean = "clean" -} - -// Function to add repositories to the project. -fun addRepos(handler: RepositoryHandler) { - handler.google() - handler.gradlePluginPortal() - handler.maven(url = "https://jitpack.io") - handler.maven(url = "https://plugins.gradle.org/m2/") -} - -// Function to check stable versions -fun isNonStable(version: String): Boolean { - val stableKeyword = listOf("a", "alpha", "beta", "final", "ga", "m", "release", "rc") - .any { version.toLowerCase(Locale.ROOT).contains(it) } - return stableKeyword.not() -} diff --git a/husky/buildSrc/src/main/kotlin/TestLibs.kt b/husky/buildSrc/src/main/kotlin/TestLibs.kt deleted file mode 100644 index 1338d6f..0000000 --- a/husky/buildSrc/src/main/kotlin/TestLibs.kt +++ /dev/null @@ -1,20 +0,0 @@ -object TestLibs { - - private object Versions { - const val espresso = "3.4.0" - const val extJunit = "1.1.3" - const val junit = "4.13.2" - const val mockitoInline = "3.6.28" - const val mockitoKotlin = "2.1.0" - const val roboelectric = "4.4" - const val roomTesting = "2.2.5" - } - - const val extJunit = "androidx.test.ext:junit:${Versions.extJunit}" - const val espresso = "androidx.test.espresso:espresso-core:${Versions.espresso}" - const val junit = "junit:junit:${Versions.junit}" - const val mockitoInline = "org.mockito:mockito-inline:${Versions.mockitoInline}" - const val mockitoKotlin = "com.nhaarman.mockitokotlin2:mockito-kotlin:${Versions.mockitoKotlin}" - const val roboelectric = "org.robolectric:robolectric:${Versions.roboelectric}" - const val roomTesting = "androidx.room:room-testing:${Versions.roomTesting}" -} diff --git a/husky/dependencies.gradle b/husky/dependencies.gradle new file mode 100644 index 0000000..8b5c69a --- /dev/null +++ b/husky/dependencies.gradle @@ -0,0 +1,137 @@ +ext.deps = [:] + +def deps = [:] +deps.androidGradlePlugin = "com.android.tools.build:gradle:${versions.gradle.androidGradlePlugin}" +deps.kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}" +deps.testinstrunner = "androidx.test.runner.AndroidJUnitRunner" +ext.deps = deps + +def androidx = [:] +androidx.appCompat = "androidx.appcompat:appcompat:${versions.appcompat}" +androidx.browser = "androidx.browser:browser:${versions.browser}" +androidx.cardView = "androidx.cardview:cardview:${versions.cardView}" +androidx.constraintLayout = + "androidx.constraintlayout:constraintlayout:${versions.constraintlayout}" +androidx.coreKtx = "androidx.core:core-ktx:${versions.coreKtx}" +androidx.emoji = "androidx.emoji:emoji:${versions.emoji}" +androidx.emojiAppCompat = "androidx.emoji:emoji-appcompat:${versions.emoji}" +androidx.emojiBundled = "androidx.emoji:emoji-bundled:${versions.emoji}" +androidx.exifInterface = "androidx.exifinterface:exifinterface:${versions.exifInterface}" +androidx.fragmentKtx = "androidx.fragment:fragment-ktx:${versions.fragmentKtx}" +androidx.pagingRuntimeKtx = + "androidx.paging:paging-runtime-ktx:${versions.pagingRuntimeKtx}" +androidx.preferenceKtx = "androidx.preference:preference-ktx:${versions.preferenceKtx}" +androidx.recyclerView = "androidx.recyclerview:recyclerview:${versions.recyclerView}" +androidx.roomCompiler = "androidx.room:room-compiler:${versions.room}" +androidx.roomRuntime = "androidx.room:room-runtime:${versions.room}" +androidx.roomRxJava = "androidx.room:room-rxjava2:${versions.room}" +androidx.shareTarget = "androidx.sharetarget:sharetarget:${versions.shareTarget}" +androidx.swipeRefreshLayout = + "androidx.swiperefreshlayout:swiperefreshlayout:${versions.swipeRefreshLayout}" +androidx.viewpager2 = "androidx.viewpager2:viewpager2:${versions.viewpager2}" +androidx.workRuntime = "androidx.work:work-runtime:${versions.workRuntime}" + +def lifecycle = [:] +lifecycle.commonJava = "androidx.lifecycle:lifecycle-common-java8:${versions.lifecycle}" +lifecycle.liveDataKtx = + "androidx.lifecycle:lifecycle-livedata-ktx:${versions.lifecycle}" +lifecycle.reactiveStreamsKtx = + "androidx.lifecycle:lifecycle-reactivestreams-ktx:${versions.lifecycle}" +lifecycle.viewmodelKtx = + "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycle}" +androidx.lifecycle = lifecycle +deps.androidx = androidx + +def dagger = [:] +dagger.dagger = "com.google.dagger:dagger:${versions.dagger}" +dagger.daggerAndroid = "com.google.dagger:dagger-android:${versions.dagger}" +dagger.daggerCompiler = "com.google.dagger:dagger-compiler:${versions.dagger}" +dagger.daggerProcessor = "com.google.dagger:dagger-android-processor:${versions.dagger}" +dagger.daggerSupport = "com.google.dagger:dagger-android-support:${versions.dagger}" +deps.dagger = dagger + +def glide = [:] +glide.glide = "com.github.bumptech.glide:glide:${versions.glide}" +glide.glideCompiler = "com.github.bumptech.glide:compiler:${versions.glide}" +glide.glideImage = "com.github.piasy:GlideImageLoader:${versions.glideImage}" +glide.glideImageViewFactory = + "com.github.piasy:GlideImageViewFactory:${versions.glideImage}" +glide.glideOkhttp = "com.github.bumptech.glide:okhttp3-integration:${versions.glide}" +deps.glide = glide + +def google = [:] +google.flexbox = "com.google.android:flexbox:${versions.flexbox}" +google.exoplayer = "com.google.android.exoplayer:exoplayer:${versions.exoplayer}" +google.materialDesign = "com.google.android.material:material:${versions.materialDesign}" +deps.google = google + +def kotlin = [:] +kotlin.reflect = "org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}" +kotlin.stdlib = "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}" +kotlin.stdlibJdk = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}" +deps.kotlin = kotlin + +def rxjava = [:] +rxjava.rxAndroid = "io.reactivex.rxjava2:rxandroid:${versions.rxAndroid}" +rxjava.rxJava = "io.reactivex.rxjava2:rxjava:${versions.rxJava}" +rxjava.rxKotlin = "io.reactivex.rxjava2:rxkotlin:${versions.rxKotlin}" +deps.rxjava = rxjava + +def simplestack = [:] +simplestack.lib = "com.github.Zhuinden:simple-stack:${versions.simplestack}" +simplestack.ext = "com.github.Zhuinden:simple-stack-extensions:${versions.simplestackext}" +deps.simplestack = simplestack + +def square = [:] +square.retrofit = "com.squareup.retrofit2:retrofit:${versions.retrofit}" +square.retrofitAdapterRxJ2 = + "com.squareup.retrofit2:adapter-rxjava2:${versions.retrofit}" +square.retrofitConvGson = "com.squareup.retrofit2:converter-gson:${versions.retrofit}" + +square.logginInterceptor = + "com.squareup.okhttp3:logging-interceptor:${versions.okhttpVersion}" +square.okhttp = "com.squareup.okhttp3:okhttp:${versions.okhttpVersion}" +square.okhttpBrotli = "com.squareup.okhttp3:okhttp-brotli:${versions.okhttpVersion}" +deps.square = square + +def testing = [:] +testing.extJunit = "androidx.test.ext:junit:${versions.testing.extJunit}" +testing.espresso = "androidx.test.espresso:espresso-core:${versions.testing.espresso}" +testing.junit = "junit:junit:${versions.testing.junit}" +testing.mockitoInline = "org.mockito:mockito-inline:${versions.testing.mockitoInline}" +testing.mockitoKotlin = "com.nhaarman.mockitokotlin2:mockito-kotlin:${versions.testing.mockitoKotlin}" +testing.roboelectric = "org.robolectric:robolectric:${versions.testing.roboelectric}" +testing.roomTesting = "androidx.room:room-testing:${versions.testing.roomTesting}" +deps.testing = testing + +deps.acraMail = "ch.acra:acra-mail:${versions.acra}" +deps.acraNotification = "ch.acra:acra-notification:${versions.acra}" +deps.androidSvg = "com.caverock:androidsvg-aar:${versions.androidSvg}" +deps.androidImageCropper = + "com.theartofdev.edmodo:android-image-cropper:${versions.androidImageCropper}" +deps.autodispose = "com.uber.autodispose:autodispose:${versions.autodispose}" +deps.autodisposeAndroidArchComp = + "com.uber.autodispose:autodispose-android-archcomponents:${versions.autodispose}" +deps.bigImageViewer = "com.github.piasy:BigImageViewer:${versions.bigImageViewer}" +deps.conscryptAndroid = "org.conscrypt:conscrypt-android:${versions.conscryptAndroid}" +deps.filemojiCompat = "de.c1710:filemojicompat:${versions.filemojiCompat}" +deps.fragmentviewbindingdelegateKt = + "com.github.Zhuinden:fragmentviewbindingdelegate-kt:${versions.fragmentviewbindingdelegateKt}" +deps.markdownEdit = "com.github.Tunous:MarkdownEdit:${versions.markdownEdit}" +deps.materialDrawer = "com.mikepenz:materialdrawer:${versions.materialDrawer}" +deps.materialDrawerIconics = + "com.mikepenz:materialdrawer-iconics:${versions.materialDrawer}" +deps.materialDrawerTypeface = + "com.mikepenz:google-material-typeface:${versions.materialDrawerTypeface}" +deps.sparkButton = "com.github.connyduck:sparkbutton:${versions.sparkButton}" +deps.timber = "com.jakewharton.timber:timber:${versions.timber}" + +// Repository handler +static def addRepos(RepositoryHandler handler) { + handler.google() + handler.jcenter() + handler.maven { url "https://jitpack.io" } + handler.maven { url "https://plugins.gradle.org/m2/" } +} + +ext.addRepos = this.&addRepos diff --git a/husky/instance.gradle b/husky/instance.gradle new file mode 100644 index 0000000..1183d66 --- /dev/null +++ b/husky/instance.gradle @@ -0,0 +1,19 @@ +/** + Edit this file to create a Tusky build that is customized for your Fediverse instance. + Note: Publishing a custom build on Google Play may violate the Google Play developer policy (Repetetive Content) + */ + +// The app name +ext.APP_NAME = "Husky" + +// The application id. Must be unique, e.g. based on your domain +ext.APP_ID = "su.xash.husky" + +// url of a custom app logo. Recommended size at least 600x600. Keep empty to use the Tusky elephant friend. +ext.CUSTOM_LOGO_URL = "" + +// e.g. mastodon.social. Keep empty to not suggest any instance on the signup screen +ext.CUSTOM_INSTANCE = "" + +// link to your support account. Will be linked on the about page when not empty. +ext.SUPPORT_ACCOUNT_URL = "https://huskyapp.dev/users/husky" diff --git a/husky/settings.gradle.kts b/husky/settings.gradle similarity index 63% rename from husky/settings.gradle.kts rename to husky/settings.gradle index 84b6943..d66f4ee 100644 --- a/husky/settings.gradle.kts +++ b/husky/settings.gradle @@ -1,3 +1,3 @@ rootProject.name = "husky" -include(":app") +include ":app" diff --git a/husky/versions.gradle b/husky/versions.gradle new file mode 100644 index 0000000..22be419 --- /dev/null +++ b/husky/versions.gradle @@ -0,0 +1,80 @@ +ext.kotlin_version = "1.6.10" + +def buildVersions = [:] +buildVersions.applicationId = "com.captainepoch.basemvvm" +buildVersions.compileSdk = 30 +buildVersions.minSdk = 23 +buildVersions.targetSdk = 30 +buildVersions.buildTools = "30.0.3" +buildVersions.javaCompat = JavaVersion.VERSION_11 +buildVersions.jdkVersion = 11 + +buildVersions.encoding = "UTF-8" + +buildVersions.versionName = "1.0.0" +buildVersions.versionCode = 1 +ext.buildVersions = buildVersions + +def versions = [:] + +def gradle = [:] +gradle.androidGradlePlugin = "7.1.1" +gradle.gradleVersions = "0.39.0" +versions.gradle = gradle + +versions.acra = "5.8.4" +versions.androidImageCropper = "2.8.0" +versions.androidSvg = "1.4" +versions.appcompat = "1.3.1" +versions.autodispose = "1.4.0" +versions.bigImageViewer = "1.7.0" +versions.browser = "1.3.0" +versions.cardView = "1.0.0" +versions.conscryptAndroid = "2.5.2" +versions.constraintlayout = "2.1.3" +versions.coreKtx = "1.3.2" +versions.dagger = "2.38.1" +versions.emoji = "1.1.0" +versions.exifInterface = "1.3.3" +versions.exoplayer = "2.16.0" +versions.filemojiCompat = "1.0.17" +versions.flexbox = "2.0.1" +versions.fragmentKtx = "1.2.5" +versions.fragmentviewbindingdelegateKt = "1.0.0" +versions.glide = "4.12.0" +versions.glideImage = "1.8.1" +versions.kotlin = "1.6.10" +versions.lifecycle = "2.3.1" +versions.markdownEdit = "1.0.0" +versions.materialDesign = "1.4.0" +versions.materialDrawer = "8.4.5" +versions.materialDrawerTypeface = "3.0.1.4.original-kotlin@aar" +versions.pagingRuntimeKtx = "2.1.2" +versions.preferenceKtx = "1.1.1" +versions.okhttpVersion = "4.9.3" +versions.recyclerView = "1.2.1" +versions.retrofit = "2.9.0" +versions.room = "2.2.5" +versions.rxAndroid = "2.1.1" +versions.rxJava = "2.2.21" +versions.rxKotlin = "2.4.0" +versions.shareTarget = "1.0.0" +versions.simplestack = "2.6.2" +versions.simplestackext = "2.2.2" +versions.sparkButton = "4.1.0" +versions.swipeRefreshLayout = "1.1.0" +versions.timber = "5.0.1" +versions.viewpager2 = "1.0.0" +versions.workRuntime = "2.4.0" + +def testing = [:] +testing.espresso = "3.4.0" +testing.extJunit = "1.1.3" +testing.junit = "4.13.2" +testing.mockitoInline = "3.6.28" +testing.mockitoKotlin = "2.1.0" +testing.roboelectric = "4.4" +testing.roomTesting = "2.2.5" +versions.testing = testing + +ext.versions = versions