Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaozhan committed Oct 17, 2021
2 parents cad472c + 3696777 commit dc414a6
Show file tree
Hide file tree
Showing 18 changed files with 67 additions and 49 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ env:
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
BASE_URL_BACKEND: ${{ secrets.BASE_URL_BACKEND }}
BASE_URL_API: ${{ secrets.BASE_URL_API }}
BASE_URL_DEV: ${{ secrets.BASE_URL_DEV }}

jobs:

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ env:
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
BASE_URL_BACKEND: ${{ secrets.BASE_URL_BACKEND }}
BASE_URL_API: ${{ secrets.BASE_URL_API }}
BASE_URL_DEV: ${{ secrets.BASE_URL_DEV }}

jobs:

Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ env:
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
BASE_URL_BACKEND: ${{ secrets.BASE_URL_BACKEND }}
BASE_URL_API: ${{ secrets.BASE_URL_API }}
BASE_URL_DEV: ${{ secrets.BASE_URL_DEV }}

jobs:
Distribute:

runs-on: ubuntu-latest

outputs:
status: ${{ steps.status.outputs.status }}
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
Expand Down Expand Up @@ -65,14 +65,18 @@ jobs:
groups: QA
file: android/build/outputs/apk/google/release/android-google-release.apk

- name: Set Job Status
id: status
run: echo "::set-output name=status::success"

Notify:
runs-on: ubuntu-latest
needs: [ Distribute ]
needs: Distribute
if: always()
steps:

- name: Notify slack fail
if: false == (needs.GradleBuild.outputs.status == 'success')
if: false == (needs.Distribute.outputs.status == 'success')
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
Expand Down
37 changes: 31 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<p align="center"><a href="https://www.codacy.com/gh/CurrencyConverterCalculator/CCC?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=CurrencyConverterCalculator/CCC&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/2196f4447c32431b80d582a21ad749db"/></a> <img src="https://github.com/CurrencyConverterCalculator/CCC/workflows/CCC%20CI/badge.svg"> <img src="https://img.shields.io/github/last-commit/CurrencyConverterCalculator/CCC.svg"> <img src="https://img.shields.io/github/issues/CurrencyConverterCalculator/CCC.svg"> <img src="https://img.shields.io/github/issues-closed/CurrencyConverterCalculator/CCC.svg">
<p align="center"><a href='https://ko-fi.com/B0B2TZMH' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi1.png?v=2' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a></p>

## Included Currencies

[![currencies.png](https://github.com/CurrencyConverterCalculator/CCC/raw/master/art/currencies.png)](https://github.com/CurrencyConverterCalculator/CCC/raw/master/art/currencies.png)

## Main modules

* [x] ![badge-android][badge-android] in production :muscle:
Expand All @@ -14,7 +18,7 @@
* [x] ![badge-client][badge-client] shared between FE targets :recycle:
* [x] ![badge-common][badge-common] shared between all targets :recycle:

### :warning: How to clone
## How to clone

The project uses submodules, please clone it as below:

Expand All @@ -24,21 +28,42 @@ cd CCC &&
git submodule update --init --recursive
```

## Included Currencies
## How to run

[![currencies.png](https://github.com/CurrencyConverterCalculator/CCC/raw/master/art/currencies.png)](https://github.com/CurrencyConverterCalculator/CCC/raw/master/art/currencies.png)
Be sure that you have latest Android Studio Canary build installed and XCode 13.0 or later.

#### Android
Open CCC folder with Android Studio and select `android` from configurations and run

#### iOS

```shell
./gradlew :client:podspec &&
cd ios/CCC
pod install --repo-update
```

Then open CCC/ios/CCC.xcworkspace with XCode and run the build

#### Backend

```shell
./gradlew :backend:run
```

## Screenshots

## Android
### Android

<img src="https://raw.githubusercontent.com/CurrencyConverterCalculator/CCC/master/art/android/1.png" width="400px"/><img src="https://raw.githubusercontent.com/CurrencyConverterCalculator/CCC/master/art/android/2.png" width="320px"/><img src="https://raw.githubusercontent.com/CurrencyConverterCalculator/CCC/master/art/android/3.png" width="400px"/><img src="https://raw.githubusercontent.com/CurrencyConverterCalculator/CCC/master/art/android/4.png" width="400px"/>

<img src="https://raw.githubusercontent.com/CurrencyConverterCalculator/CCC/master/art/android/5.png" width="400px"/><img src="https://raw.githubusercontent.com/CurrencyConverterCalculator/CCC/master/art/android/6.png" width="400px"/><img src="https://raw.githubusercontent.com/CurrencyConverterCalculator/CCC/master/art/android/7.png" width="400px"/><img src="https://raw.githubusercontent.com/CurrencyConverterCalculator/CCC/master/art/android/6.png" width="400px"/>

## iOS
### iOS

<img src="https://github.com/CurrencyConverterCalculator/CCC/blob/master/art/ios/dark.gif?raw=true" width="400px"/> <img src="https://github.com/CurrencyConverterCalculator/CCC/blob/master/art/ios/light.gif?raw=true" width="400px"/>

### License
## License
```markdown
Copyright 2017 Mustafa Ozhan

Expand Down
2 changes: 1 addition & 1 deletion ad/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ dependencies {
DeviceType.googleImplementation(Dependencies.Android.GOOGLE.ADMOB)

implementation(project(Modules.LOG_MOB))
}
}
1 change: 0 additions & 1 deletion android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ dependencies {

implementation(Dependencies.Android.GOOGLE.PLAY_CORE)


with(Dependencies.Common) {
implementation(KOTLIN_X_DATE_TIME)
}
Expand Down
2 changes: 1 addition & 1 deletion basemob
2 changes: 1 addition & 1 deletion billing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ dependencies {
implementation(project(SCOPE_MOB))
implementation(project(LOG_MOB))
}
}
}
1 change: 0 additions & 1 deletion buildSrc/src/main/kotlin/Keys.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
object Keys {
const val BASE_URL_BACKEND = "BASE_URL_BACKEND"
const val BASE_URL_API = "BASE_URL_API"
const val BASE_URL_DEV = "BASE_URL_DEV"

object Release {
const val ADMOB_APP_ID = "ANDROID_RELEASE_ADMOB_APP_ID"
Expand Down
15 changes: 14 additions & 1 deletion buildSrc/src/main/kotlin/ProjectSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ object ProjectSettings {

fun getVersionName(
project: Project
) = "$MAYOR_VERSION.$MINOR_VERSION.${gitCommitCount(project).toInt() - VERSION_DIF}"
) = if (isMaster(project)) {
"$MAYOR_VERSION.$MINOR_VERSION.${gitCommitCount(project).toInt() - VERSION_DIF}"
} else {
gitCommitCount(project) // testing build
}

private fun gitCommitCount(project: Project): String {
val os = ByteArrayOutputStream()
Expand All @@ -32,4 +36,13 @@ object ProjectSettings {
}
return String(os.toByteArray()).trim()
}

private fun isMaster(project: Project): Boolean {
val os = ByteArrayOutputStream()
project.exec {
commandLine = "git rev-parse --abbrev-ref HEAD".split(" ")
standardOutput = os
}
return String(os.toByteArray()) == "master"
}
}
8 changes: 4 additions & 4 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@Suppress("SpellCheckingInspection")
object Versions {
const val KOTLIN = "1.5.31"
const val ANDROID_GRADLE_PLUGIN = "7.1.0-alpha13"
const val ANDROID_GRADLE_PLUGIN = "7.2.0-alpha01"
const val ANDROID_MATERIAL = "1.4.0"
const val CONSTRAINT_LAYOUT = "2.1.1"
const val KTOR = "1.6.4"
Expand All @@ -22,16 +22,16 @@ object Versions {
const val ADMOB = "20.4.0"
const val NAVIGATION = "2.3.5"
const val PLAY_CORE = "1.10.2"
const val KOTLIN_X_DATE_TIME = "0.3.0"
const val KOTLIN_X_DATE_TIME = "0.2.1"
const val COROUTINES = "1.5.2-native-mt"
const val BILLING = "4.0.0"
const val LEAK_CANARY = "2.7"
const val SQL_DELIGHT = "1.5.1"
const val SQL_DELIGHT = "1.5.2"
const val LIFECYCLE = "2.4.0-rc01"
const val MOKO_RESOURCES = "0.17.2"
const val DEPENDENCY_UPDATES = "0.39.0"
const val BUILD_HEALTH = "0.78.0"
const val BUILD_KONFIG = "0.10.2"
const val WORK_RUNTIME = "2.7.0-rc01"
const val WORK_RUNTIME = "2.7.0"
const val SPLASH_SCREEN = "1.0.0-alpha02"
}
1 change: 0 additions & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ configure<BuildKonfigExtension> {
getSecret(Keys.BASE_URL_BACKEND, Fakes.PRIVATE_URL)
)
buildConfigField(STRING, Keys.BASE_URL_API, getSecret(Keys.BASE_URL_API, Fakes.PRIVATE_URL))
buildConfigField(STRING, Keys.BASE_URL_DEV, getSecret(Keys.BASE_URL_DEV, Fakes.PRIVATE_URL))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ import kotlinx.coroutines.runBlocking
actual val platformCoroutineContext: CoroutineContext = Dispatchers.IO

actual fun runTest(block: suspend () -> Unit) = runBlocking { block() }

actual fun isDebug() = BuildConfig.DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ import kotlin.coroutines.CoroutineContext
expect val platformCoroutineContext: CoroutineContext

expect fun runTest(block: suspend () -> Unit)

expect fun isDebug(): Boolean
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package com.github.mustafaozhan.ccc.common.api

import com.github.mustafaozhan.ccc.common.BuildKonfig
import com.github.mustafaozhan.ccc.common.entity.CurrencyResponseEntity
import com.github.mustafaozhan.ccc.common.isDebug
import io.ktor.client.HttpClient
import io.ktor.client.request.get
import io.ktor.client.request.parameter
Expand All @@ -15,25 +14,17 @@ internal class ApiService(private val client: HttpClient) {

suspend fun getRatesViaBackend(base: String) = client.get<CurrencyResponseEntity> {
url {
if (isDebug()) {
takeFrom(BuildKonfig.BASE_URL_DEV)
} else {
takeFrom(BuildKonfig.BASE_URL_BACKEND)
path(PATH_CURRENCY_BY_BASE_BACKEND)
parameter(QUERY_KEY_BASE, base)
}
takeFrom(BuildKonfig.BASE_URL_BACKEND)
path(PATH_CURRENCY_BY_BASE_BACKEND)
parameter(QUERY_KEY_BASE, base)
}
}

suspend fun getRatesViaApi(base: String) = client.get<CurrencyResponseEntity> {
url {
if (isDebug()) {
takeFrom(BuildKonfig.BASE_URL_DEV)
} else {
takeFrom(BuildKonfig.BASE_URL_API)
path(PATH_CURRENCY_BY_BASE_API)
parameter(QUERY_KEY_BASE, base)
}
takeFrom(BuildKonfig.BASE_URL_API)
path(PATH_CURRENCY_BY_BASE_API)
parameter(QUERY_KEY_BASE, base)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ actual fun runTest(block: suspend () -> Unit) {
block()
}
}

actual fun isDebug() = Platform.isDebugBinary
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@ import kotlinx.coroutines.runBlocking
actual val platformCoroutineContext: CoroutineContext = Dispatchers.IO

actual fun runTest(block: suspend () -> Unit) = runBlocking { block() }

// todo need to find correct implementation for JVM
@Suppress("FunctionOnlyReturningConstant")
actual fun isDebug() = false
2 changes: 1 addition & 1 deletion logmob

0 comments on commit dc414a6

Please sign in to comment.