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

Add Support Secrets Gradle plugin #2093

Merged
merged 4 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ mifosng-android/src/main/assets/crashlytics-build.properties
android-client.iml
mifosng-android/mifosng-android.iml
*.hprof
android-client.iml
android-client.iml
/secrets.properties
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ plugins {
alias(libs.plugins.hilt) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.androidx.navigation) apply false
alias(libs.plugins.secrets) apply false
}
9 changes: 9 additions & 0 deletions core/common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.secrets)
}

android {
Expand Down Expand Up @@ -32,6 +33,14 @@ android {
kotlinOptions {
jvmTarget = "17"
}

buildFeatures {
buildConfig = true
}
}

secrets {
defaultPropertiesFileName = "secrets.defaults.properties"
}

dependencies {
Expand Down
12 changes: 7 additions & 5 deletions core/common/src/main/java/com/mifos/core/common/utils/BaseUrl.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package com.mifos.core.common.utils

import com.mifos.core.common.BuildConfig

object BaseUrl {

// "/" in the last of the base url always

const val PROTOCOL_HTTPS = "https://"
const val PROTOCOL_HTTPS = BuildConfig.PROTOCOL_HTTPS

const val API_ENDPOINT = "demo.mifos.community"
const val API_ENDPOINT = BuildConfig.API_ENDPOINT

const val API_PATH = "/fineract-provider/api/v1/"
const val API_PATH = BuildConfig.API_PATH

const val PORT = "80"
const val PORT = BuildConfig.PORT

const val TENANT = "default"
const val TENANT = BuildConfig.TENANT
}
11 changes: 11 additions & 0 deletions core/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.kotlin.android)
alias(libs.plugins.hilt)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.secrets)
id(libs.plugins.kotlin.parcelize.get().pluginId)
id(libs.plugins.kotlin.kapt.get().pluginId)
}
Expand All @@ -27,13 +28,23 @@ android {
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}

buildFeatures {
buildConfig = true
}
}

secrets {
defaultPropertiesFileName = "secrets.defaults.properties"
}

dependencies {
Expand Down
8 changes: 4 additions & 4 deletions core/network/src/main/java/com/mifos/core/network/BaseUrl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ package com.mifos.core.network
class BaseUrl {
// "/" in the last of the base url always
companion object {
const val PROTOCOL_HTTPS = "https://"
const val API_ENDPOINT = "demo.mifos.community"
const val API_PATH = "/fineract-provider/api/v1/"
const val PORT = "80"
const val PROTOCOL_HTTPS = BuildConfig.PROTOCOL_HTTPS
therajanmaurya marked this conversation as resolved.
Show resolved Hide resolved
const val API_ENDPOINT = BuildConfig.API_ENDPOINT
const val API_PATH = BuildConfig.API_PATH
const val PORT = BuildConfig.PORT
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
5 changes: 5 additions & 0 deletions mifosng-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.hilt)
alias(libs.plugins.secrets)
id(libs.plugins.kotlin.parcelize.get().pluginId)
id(libs.plugins.kotlin.kapt.get().pluginId)
}
Expand Down Expand Up @@ -118,6 +119,10 @@ android {
}
}

secrets {
defaultPropertiesFileName = "secrets.defaults.properties"
}

dependencies {

implementation(project(":feature:auth"))
Expand Down
2 changes: 1 addition & 1 deletion mifosng-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
android:value="${GEO_API_KEY}" />

<activity
android:name=".activity.splashscreen.SplashScreenActivity"
Expand Down
16 changes: 16 additions & 0 deletions secrets.defaults.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

# Default values for the Mifos API
# You can override these values by creating secrets.properties file in the root directory of the project

PROTOCOL_HTTPS = https://
therajanmaurya marked this conversation as resolved.
Show resolved Hide resolved

API_ENDPOINT = demo.mifos.community

API_PATH = /fineract-provider/api/v1/

PORT = 80

TENANT = default

# Provide GEO API Key
GEO_API_KEY = AIzaSyAZTZqvDGyyw21z2Ee7N-dE_WuZQwKL0bs
Loading