Skip to content

Commit

Permalink
chore: add Kalium project as a git Submodule within Android Reloaded …
Browse files Browse the repository at this point in the history
…realm (#299)

* Added Kalium as a git submodule

* Bumped kalium module

* Added comment

* Added readme comments

* Initialising kalium repo submodule on Jenkins

* Extract git submodules command on different stage

* replaced ssh url path with https

* Only executing the detektAll script on the main app project

* Update README.md

Co-authored-by: Vitor Hugo Schwaab <[email protected]>

Co-authored-by: Marco <[email protected]>
Co-authored-by: Vitor Hugo Schwaab <[email protected]>
  • Loading branch information
3 people authored Dec 22, 2021
1 parent 88610c4 commit fd1d99b
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "kalium"]
path = kalium
url = https://github.com/wireapp/kalium.git
8 changes: 6 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ pipeline {

stage('Spawn Wrapper and Emulators') {
parallel {
stage('Fetch submodules') {
steps {
sh 'git submodule update --init --recursive'
}
}

stage('Spawn Gradle Wrapper') {
steps {
withGradle() {
Expand Down Expand Up @@ -140,11 +146,9 @@ pipeline {
script {
last_started = env.STAGE_NAME
}

withGradle() {
sh './gradlew clean'
}

}
}

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,12 @@ These are the available `gradle` tasks via command line:

Import the project as a gradle project by browsing the ```build.gradle.kt``` file.


## Typical Build issues

It might be that after cloning the Android Reloaded project, some build issues appear on your IDE (IntelliJ or Android studio). To avoid most of these, make sure that:
- After cloning the Android Reloaded project, you have run `git submodule update --init --recursive` (to init any needed configuration within the embedded Kalium submodule project)
- There is a valid SDK path on your `local.properties` AND `kalium/local.properties` files pointing to the Android SDK folder. In Mac, that folder can be usually found under `sdk.dir=/Users/YOUR_USER_FOLDER/Library/Android/sdk`. The IDE **will not** create `kalium/local.properties` automatically, so you might want to copy/paste the one in the project root.

## Happy coding!!!

5 changes: 4 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ android {
}
}

sourceSets { map { it.java.srcDir("src/${it.name}/kotlin") } }
sourceSets {
map { it.java.srcDir("src/${it.name}/kotlin") }
}
fun AndroidSourceSet.includeCommonTestSourceDir() = java {
srcDir("src/commonTest/kotlin")
}
Expand All @@ -56,6 +58,7 @@ android {
}

dependencies {
implementation("com.wire.kalium:kalium-network")

// Application dependencies
implementation(Libraries.Kotlin.stdLib)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.wire.android.R
import com.wire.android.feature.conversation.ConversationID
import kotlinx.android.synthetic.main.fragment_conversation.conversationRecyclerView
import kotlinx.android.synthetic.main.fragment_conversation.*
import org.koin.android.ext.android.inject
import org.koin.android.viewmodel.ext.android.sharedViewModel

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
private object Dependencies {
const val androidBuildTools = "com.android.tools.build:gradle:4.2.2"
const val androidBuildTools = "com.android.tools.build:gradle:7.0.3"
const val kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
const val detektGradlePlugin = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.14.1"
const val junit = "junit:junit:4.13"
Expand Down
Empty file removed buildSrc/settings.gradle.kts
Empty file.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/scripts/quality.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ val detektAll by tasks.registering(Detekt::class) {

val outputFile = "${project.buildDir}/staticAnalysis/index.html"

setSource(files(rootProject.projectDir))
setSource(files(project.projectDir))
config.setFrom("${project.rootDir}/config/detekt/detekt.yml")

include("**/*.kt")
Expand Down
1 change: 1 addition & 0 deletions kalium
Submodule kalium added at 602806
11 changes: 9 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ rootDir
.walk()
.maxDepth(1)
.filter {
it.name != "buildSrc" && it.isDirectory &&
it.name != "buildSrc" && it.name != "kalium" && it.isDirectory &&
file("${it.absolutePath}/build.gradle.kts").exists()
}
.forEach {
include(":${it.name}")
}
}

includeBuild("kalium") {
// This dependency substitution should not be done on release mode once the Kalium library has been published to Maven repo
dependencySubstitution {
substitute(module("com.wire.kalium:kalium-network")).using(project(":network"))
}
}

0 comments on commit fd1d99b

Please sign in to comment.