Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/refactoring #48

Open
wants to merge 12 commits into
base: baseproject
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.{kt,kts}]
twitter_compose_allowed_composition_locals = LocalPraxisCloneColor
90 changes: 90 additions & 0 deletions .github/workflows/androidworkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Build and Deploy
on:
push:
branches:
- master

jobs:
build_and_deploy_release:
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

steps:
- name: Send CI/CD start message on slack
uses: act10ns/slack@v1
id: slack_message_start
with:
status: starting
message: Starting to generate Release build for `build number {{ env.GITHUB_RUN_NUMBER }}` on branch `{{env.GITHUB_HEAD_REF}}`
if: always()

- name: Checkout code
id: checkout_code
uses: actions/checkout@v2

- name: Setup JDK 11
id: setup_jdk
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: 11

- name: Decode Keystore
id: decode_keystore
env:
APP_CENTER_SECRET_DEVELOPMENT: ${{ secrets.APP_CENTER_SECRET_DEVELOPMENT }}
run: |
touch ./local.properties
echo APP_CENTER_SECRET_DEVELOPMENT=\"$APP_CENTER_SECRET_DEVELOPMENT\" >> ./local.properties
cat ./local.properties

- uses: actions/cache@v3
name: Cache Gradle for quicker builds
id: caching_gradle
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Generate Build
id: generate_build
if: always()
run: ./gradlew assembleRelease --stacktrace --info

- name: Sign APK
id: sign_app
if: always()
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/release/
signingKeyBase64: ${{ secrets.RELEASE_KEYSTORE_BASE64 }}
alias: ${{ secrets.RELEASE_KEY_ALIAS }}
keyStorePassword: ${{ secrets.RELEASE_STORE_PASSWORD }}
keyPassword: ${{ secrets.RELEASE_KEY_PASSWORD }}

- name: Upload to App Center and distribute
id: upload_to_app_center_and_distribute
if: always()
uses: wzieba/AppCenter-Github-Action@v1
with:
appName: Mutual-Mobile-Organization/MM-Praxis
token: ${{ secrets.APP_CENTER_TOKEN_SECRET }}
group: Internal
file: ${{ steps.sign_app.outputs.signedReleaseFile }}
notifyTesters: true
debug: true

- name: Send CI/CD end message on slack
uses: act10ns/slack@v1
id: slack_message_end
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: always()
37 changes: 0 additions & 37 deletions .github/workflows/build.yml

This file was deleted.

46 changes: 20 additions & 26 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
id(BuildPlugins.KOTLIN_KAPT)
id(BuildPlugins.DAGGER_HILT)
id(BuildPlugins.ktLint)
id(BuildPlugins.SECRETS_GRADLE_PLUGIN)
}

// def preDexEnabled = "true" == System.getProperty("pre-dex", "true")
Expand Down Expand Up @@ -34,23 +35,6 @@ android {
}
}

signingConfigs {

getByName("debug") {
keyAlias = "praxis-debug"
keyPassword = "utherNiC"
storeFile = file("keystore/praxis-debug.jks")
storePassword = "uRgeSCIt"
}

create("release") {
keyAlias = "praxis-release"
keyPassword = "ITHOmptI"
storeFile = file("keystore/praxis-release.jks")
storePassword = "PoTHatHR"
}

}
buildTypes {
getByName("release") {
isDebuggable = false
Expand All @@ -63,14 +47,20 @@ android {
getDefaultProguardFile("proguard-android.txt"), "proguard-common.txt",
"proguard-specific.txt"
)
signingConfig = signingConfigs.getByName("release")
//signingConfig = signingConfigs.getByName("release")
}
getByName("debug") {
isDebuggable = true
versionNameSuffix = "-debug"
applicationIdSuffix = ".debug"
signingConfig = signingConfigs.getByName("debug")
}
create("benchmark") {
initWith(getByName("release"))
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("release")
isDebuggable = false
}
}

buildFeatures {
Expand Down Expand Up @@ -131,18 +121,17 @@ dependencies {
Lib.Google.list.forEach(::api)
Lib.Kotlin.list.forEach(::api)

api(project(":ui-onboarding"))
api(project(":ui-authentication"))
api(project(":navigator"))
api(project(":data"))
api(project(":domain"))
api(project(":common"))
api(project(":commonui"))
api(project(":feature:ui-onboarding"))
api(project(":feature:ui-authentication"))
api(project(":core:navigator"))
api(project(":core:data"))
api(project(":core:domain"))
api(project(":core:common"))
api(project(":feature:commonui"))

/*DI*/
api(Lib.Di.hilt)
api(Lib.Di.hiltNavigationCompose)
api(Lib.Di.viewmodel)
kapt(Lib.Di.hiltCompiler)
kapt(Lib.Di.hiltAndroidCompiler)

Expand All @@ -152,7 +141,12 @@ dependencies {
add("kapt", Lib.Room.roomCompiler)
testApi(Lib.Room.testing)

//App center analytics
api(Lib.Crash.APP_CENTER_CRASHES)
api(Lib.Crash.APP_CENTER_ANALYSIS)

UnitTesting.list.forEach(::testApi)
DevDependencies.debugList.forEach(::debugApi)
DevDependencies.list.forEach(::api)
implementation(UnitTesting.PROFILE_INSTALLER)
}
Binary file removed app/keystore/praxis-debug.jks
Binary file not shown.
Binary file removed app/keystore/praxis-release.jks
Binary file not shown.
12 changes: 5 additions & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
<uses-permission android:name="android.permission.INTERNET" />

<application
android:usesCleartextTraffic="true"
android:name=".PraxisCloneApp"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.App.SplashScreenTheme"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning">
<profileable
android:shell="true"
tools:targetApi="33" />

<activity
android:name=".root.OnboardingActivity"
android:exported="true"
Expand All @@ -24,12 +28,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity-alias
android:name="leakcanary.internal.activity.LeakLauncherActivity"
android:exported="true"
android:targetActivity="leakcanary.internal.activity.LeakActivity"
tools:node="merge" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ import androidx.core.view.WindowCompat
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.rememberNavController
import com.google.accompanist.insets.ProvideWindowInsets
import dagger.hilt.android.AndroidEntryPoint
import com.mutualmobile.praxis.navigator.ComposeNavigator
import com.mutualmobile.praxis.navigator.PraxisRoute
import com.mutualmobile.praxis.uionboarding.nav.onboardingNavigation
import com.praxis.feat.authentication.nav.authNavGraph
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
import com.microsoft.appcenter.AppCenter;
import com.microsoft.appcenter.analytics.Analytics;
import com.microsoft.appcenter.crashes.Crashes;
import com.mutualmobile.praxis.BuildConfig

@AndroidEntryPoint
class OnboardingActivity : AppCompatActivity() {
Expand All @@ -26,6 +30,11 @@ class OnboardingActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)

AppCenter.start(
application, BuildConfig.APP_CENTER_SECRET_DEVELOPMENT,
Analytics::class.java, Crashes::class.java
)

installSplashScreen()
setContent {
val navController = rememberNavController()
Expand Down
24 changes: 22 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id(BuildPlugins.KOTLINTER) version BuildPlugins.KOTLINTER_PLUGIN_VERSION apply true
id(BuildPlugins.JETBRAINS_KOTLIN_ANDROID) version Lib.Kotlin.KOTLIN_VERSION apply false
}

buildscript {
repositories {
Expand All @@ -12,12 +16,17 @@ buildscript {
classpath(BuildPlugins.KOTLIN_GRADLE_PLUGIN)
classpath(kotlin("serialization", version = Lib.Kotlin.KOTLIN_VERSION))
classpath(BuildPlugins.KTLINT_GRADLE_PLUGIN)
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
// NOTE: Do not place your application dependencies here; they belong
classpath(BuildPlugins.TWITTER_COMPOSE_RULES)
classpath(Lib.ThirdParty.SECRETS_GRADLE)
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

subprojects {
apply(plugin = BuildPlugins.KOTLINTER)
}

allprojects {
repositories {
google()
Expand All @@ -35,4 +44,15 @@ apply(from = teamPropsFile("git-hooks.gradle.kts"))
fun teamPropsFile(propsFile: String): File {
val teamPropsDir = file("team-props")
return File(teamPropsDir, propsFile)
}

tasks.register("check").configure {
dependsOn("installKotlinterPrePushHook")
}

kotlinter {
ignoreFailures = false
reporters = arrayOf("checkstyle", "html", "plain")
experimentalRules = true
disabledRules = emptyArray()
}
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/AppVersions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ object AppVersions {
const val versionCode = versionMajor * 10000 + versionMinor * 100 + versionPatch
const val versionName = "$versionMajor.$versionMinor.$versionPatch"

const val COMPILE_SDK = 31
const val COMPILE_SDK = 33
const val MIN_SDK = 21
const val TARGET_SDK = 31
const val TARGET_SDK = 33
const val APPLICATION_ID = "com.mutualmobile.praxis"
}
Loading