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 Aug 8, 2022
2 parents 37e2b0a + 7d10230 commit 0666535
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 22 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ Open CCC folder with Android Studio and select `android` from configurations and
### iOS

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

Then open `CCC/ios/CCC.xcworkspace` with XCode and run the build
Then open `CCC/ios/CCC.xcworkspace` with XCode after the packages are resolved you can run the project, please not XCode version should be bigger than `13.2.1`

### Backend

Expand Down
24 changes: 17 additions & 7 deletions buildSrc/src/main/kotlin/ProjectSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,26 @@ object ProjectSettings {
const val MIN_SDK_VERSION = 21
const val TARGET_SDK_VERSION = 31

fun getVersionCode(project: Project) = gitCommitCount(project).toInt() + BASE_VERSION_CODE
@Suppress("TooGenericExceptionCaught", "SwallowedException")
fun getVersionCode(project: Project) = try {
gitCommitCount(project).toInt() + BASE_VERSION_CODE
} catch (e: Exception) {
1
}

@Suppress("TooGenericExceptionCaught", "SwallowedException")
fun getVersionName(
project: Project
): String = if (isMaster(project)) {
"$MAYOR_VERSION.$MINOR_VERSION.${getVersionCode(project) - VERSION_DIF - BASE_VERSION_CODE}"
} else {
"0.0.${getVersionCode(project)}" // testing build
}.also {
if (isCI()) project.setIOSVersion(it)
): String = try {
if (isMaster(project)) {
"$MAYOR_VERSION.$MINOR_VERSION.${getVersionCode(project) - VERSION_DIF - BASE_VERSION_CODE}"
} else {
"0.0.${getVersionCode(project)}" // testing build
}.also {
if (isCI()) project.setIOSVersion(it)
}
} catch (e: Exception) {
"0.0.1"
}

private fun gitCommitCount(project: Project): String {
Expand Down
12 changes: 8 additions & 4 deletions ios/CCC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@
5C693EBA25C4AFF800C9373E /* SelectCurrenciesBottomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C693EB925C4AFF800C9373E /* SelectCurrenciesBottomView.swift */; };
5C6E674025C5A711001CC0D6 /* SliderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6E673F25C5A711001CC0D6 /* SliderView.swift */; };
5C6E674D25C602BE001CC0D6 /* SnackBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6E674C25C602BE001CC0D6 /* SnackBar.swift */; };
5C8EB4A9260CB5E200DC4A90 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5C8EB4A8260CB5E200DC4A90 /* GoogleService-Info.plist */; };
5C8FDBDD25BF3FBE00F280FF /* ObservableSEED.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C8FDBDC25BF3FBE00F280FF /* ObservableSEED.swift */; };
5C94AC32282FA4B2004C9B3D /* CurrencyImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C94AC31282FA4B2004C9B3D /* CurrencyImageView.swift */; };
5C9645D628A137FE001DC24E /* EnvironmentUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C9645D528A137FE001DC24E /* EnvironmentUtil.swift */; };
5C9A59BB25C350DE006745B0 /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C9A59BA25C350DE006745B0 /* MainView.swift */; };
5C9C75C82603A36A00D66FDD /* ToolbarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C9C75C72603A36A00D66FDD /* ToolbarButton.swift */; };
5CB954BF26932408007632DC /* BannerAdView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB954BE26932408007632DC /* BannerAdView.swift */; };
5CDE468425BC3B2000CA0FB1 /* SelectCurrencyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CDE468325BC3B2000CA0FB1 /* SelectCurrencyView.swift */; };
5CEA86F52840CF65001386FB /* NotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CEA86F42840CF65001386FB /* NotificationManager.swift */; };
5CF4DB6628A14B5D00DA24F7 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5CF4DB6528A14B5D00DA24F7 /* GoogleService-Info.plist */; };
5CF57E3A269588060081E4BB /* RewardedAd.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF57E39269588060081E4BB /* RewardedAd.swift */; };
5CF57E3C2695A3B20081E4BB /* InterstitialAd.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF57E3B2695A3B20081E4BB /* InterstitialAd.swift */; };
5CF898D42823C1F900712580 /* WatcherItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CF898D32823C1F900712580 /* WatcherItem.swift */; };
Expand Down Expand Up @@ -95,16 +96,17 @@
5C693EB925C4AFF800C9373E /* SelectCurrenciesBottomView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectCurrenciesBottomView.swift; sourceTree = "<group>"; };
5C6E673F25C5A711001CC0D6 /* SliderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SliderView.swift; sourceTree = "<group>"; };
5C6E674C25C602BE001CC0D6 /* SnackBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnackBar.swift; sourceTree = "<group>"; };
5C8EB4A8260CB5E200DC4A90 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
5C8FDBDC25BF3FBE00F280FF /* ObservableSEED.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObservableSEED.swift; sourceTree = "<group>"; };
5C94AC31282FA4B2004C9B3D /* CurrencyImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrencyImageView.swift; sourceTree = "<group>"; };
5C9645D528A137FE001DC24E /* EnvironmentUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnvironmentUtil.swift; sourceTree = "<group>"; };
5C9A59BA25C350DE006745B0 /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
5C9C75C72603A36A00D66FDD /* ToolbarButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolbarButton.swift; sourceTree = "<group>"; };
5CB954BE26932408007632DC /* BannerAdView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BannerAdView.swift; sourceTree = "<group>"; };
5CB954C526934EFC007632DC /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
5CB954CD269362E2007632DC /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
5CDE468325BC3B2000CA0FB1 /* SelectCurrencyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectCurrencyView.swift; sourceTree = "<group>"; };
5CEA86F42840CF65001386FB /* NotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationManager.swift; sourceTree = "<group>"; };
5CF4DB6528A14B5D00DA24F7 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
5CF57E39269588060081E4BB /* RewardedAd.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RewardedAd.swift; sourceTree = "<group>"; };
5CF57E3B2695A3B20081E4BB /* InterstitialAd.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InterstitialAd.swift; sourceTree = "<group>"; };
5CF898D32823C1F900712580 /* WatcherItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatcherItem.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -247,7 +249,7 @@
children = (
7555FF84242A565B00829871 /* Assets.xcassets */,
7555FF8C242A565B00829871 /* Info.plist */,
5C8EB4A8260CB5E200DC4A90 /* GoogleService-Info.plist */,
5CF4DB6528A14B5D00DA24F7 /* GoogleService-Info.plist */,
5CB954C526934EFC007632DC /* Release.xcconfig */,
5CB954CD269362E2007632DC /* Debug.xcconfig */,
5C31E43E28145D32008C42B9 /* Launch Screen.storyboard */,
Expand All @@ -264,6 +266,7 @@
5CF57E39269588060081E4BB /* RewardedAd.swift */,
5CF57E3B2695A3B20081E4BB /* InterstitialAd.swift */,
5CEA86F42840CF65001386FB /* NotificationManager.swift */,
5C9645D528A137FE001DC24E /* EnvironmentUtil.swift */,
);
path = Util;
sourceTree = "<group>";
Expand Down Expand Up @@ -401,8 +404,8 @@
files = (
7555FF88242A565B00829871 /* Preview Assets.xcassets in Resources */,
7555FF85242A565B00829871 /* Assets.xcassets in Resources */,
5CF4DB6628A14B5D00DA24F7 /* GoogleService-Info.plist in Resources */,
5C31E43F28145D32008C42B9 /* Launch Screen.storyboard in Resources */,
5C8EB4A9260CB5E200DC4A90 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -497,6 +500,7 @@
5C9A59BB25C350DE006745B0 /* MainView.swift in Sources */,
5C5D09362562EBDE00DA9C4A /* Koin.swift in Sources */,
5C31E42D28142058008C42B9 /* SelectionView.swift in Sources */,
5C9645D628A137FE001DC24E /* EnvironmentUtil.swift in Sources */,
5C5D093C2562EC2D00DA9C4A /* CalculatorView.swift in Sources */,
5CF8BE4627DE334100E441F5 /* WebView.swift in Sources */,
5C31E42228141CC9008C42B9 /* KeyboardView.swift in Sources */,
Expand Down
12 changes: 4 additions & 8 deletions ios/CCC/Application.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@
import SwiftUI
import Res
import Client
import Firebase
import FirebaseCore
import GoogleMobileAds
import BackgroundTasks

#if RELEASE
let logger = LoggerKt.doInitLogger(enableCrashlytics: true)
#else
let logger = LoggerKt.doInitLogger(enableCrashlytics: false)
#endif
let logger = LoggerKt.doInitLogger(enableCrashlytics: EnvironmentUtil.isRelease)

@main
struct Application: App {
Expand All @@ -33,9 +29,9 @@ struct Application: App {
init() {
logger.i(message: {"Application init"})

#if RELEASE
if EnvironmentUtil.isRelease {
FirebaseApp.configure()
#endif
}

// GADMobileAds.sharedInstance().start(completionHandler: nil)

Expand Down
19 changes: 19 additions & 0 deletions ios/CCC/Util/EnvironmentUtil.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// EnvironmentUtil.swift
// CCC
//
// Created by Mustafa Ozhan on 08.08.22.
// Copyright © 2022 orgName. All rights reserved.
//

import Foundation

public struct EnvironmentUtil {
public static var isRelease: Bool {
#if RELEASE
return true
#else
return false
#endif
}
}
1 change: 1 addition & 0 deletions ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ platform :ios do
build_app(
workspace: "CCC.xcworkspace",
scheme: "CCC",
configuration: "Release",
xcargs: "-allowProvisioningUpdates",
codesigning_identity: options[:identity],
export_options: {
Expand Down

0 comments on commit 0666535

Please sign in to comment.