Skip to content

Commit

Permalink
Merge pull request #667 from splendo/develop
Browse files Browse the repository at this point in the history
1.0
  • Loading branch information
Daeda88 authored Feb 28, 2023
2 parents d42b060 + fc402eb commit 2a764d5
Show file tree
Hide file tree
Showing 2,031 changed files with 58,491 additions and 26,687 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/emulator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: pull_request
env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=\"-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false\" -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.daemon.jvm.options=-Xmx8G,-XX:MaxMetaspaceSize=512m,-Dorg.gradle.daemon=false,-Dkotlin.incremental=false"
JAVA_OPTS: "-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 120

jobs:
build:
Expand Down Expand Up @@ -54,7 +55,7 @@ jobs:
strategy:
fail-fast: false
matrix:
api-level: [23, 32]
api-level: [23, 33]
# some custom gradle magic makes tests run grouped for `$module-*` and `*-$module` on CI so there is no need to add these to the matrix
module: [
"base",
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ projectFilesBackup*/
google-services.json

*.framework

example/ios/Generated/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "example/ios/Kaluga-SwiftUI"]
path = example/ios/Kaluga-SwiftUI
url = https://github.com/splendo/kaluga-swiftui.git
34 changes: 19 additions & 15 deletions DEVELOP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Build instructions

This project uses Android Studio. You might need a canary version at times. Check [gradle/ext.gradle](gradle/ext.gradle) to see which Android gradle plugin is used, as this determines compatability with Android Studio versions. You can check the [Android Gradle plugin release notes](https://developer.android.com/studio/releases/gradle-plugin), the [Android Studio release notes](https://developer.android.com/studio/releases) and the [Android Studio Preview Release Updates](https://androidstudio.googleblog.com/) pages to see which version to use.
This project uses Android Studio. You might need a canary version at times. Check [`kaluga.androidGradlePluginVersion` in gradle.properties](gradle.properties) to see which Android gradle plugin is used, as this determines compatability with Android Studio versions. You can check the [Android Gradle plugin release notes](https://developer.android.com/studio/releases/gradle-plugin), the [Android Studio release notes](https://developer.android.com/studio/releases) and the [Android Studio Preview Release Updates](https://androidstudio.googleblog.com/) pages to see which version to use.

You can also check the Kotlin version, and if needed align this with the Kotlin plugin version for Android Studio under `Android Studio` -> `Preferences` -> `Languages & Frameworks` -> `Kotlin`.

Expand All @@ -20,7 +20,7 @@ If a purely common test does not work, you can make the test's class `open` or `

By extending `BaseTest` you can avoid a lot of boilerplate to make tests behave cross-platform (e.g. enableing the coroutines debugger).

There are specialized test classes in the [`test-utils`](test-utils/) module, e.g. for testings `Flows`, `ViewModel`s etc.
There are specialized test classes in the [`test-utils`](test-utils/) modules, e.g. for testings `Flows`, `ViewModel`s etc.

### Android tests

Expand All @@ -39,7 +39,7 @@ Make sure you have the Simulator setup with a working target device. For now you

The `ioTest` task supports the `--tests` flag like other Gradle tasks to filter which tests to run.

Note that for kaluga iOS tests run on a background thread, in order to have a properly working Main dispatchers (and align better with Android). How this works is described in [`test-utils`](test-utils/)
Note that for Kaluga iOS tests run on a background thread, in order to have a properly working Main dispatchers (and align better with Android). How this works is described in [`test-utils-base`](test-utils-base/)

## Architecture

Expand Down Expand Up @@ -84,22 +84,24 @@ If you want to publish with a specific version string, you can override this val
kaluga.libraryVersion=0.1.0-special-build
```

if this property is not set the version string is a combination of the version number, the current git branch (unless that branch is `master`, `main` or `develop`) and `-SNAPSHOT` (unless the `MAVEN_CENTRAL_RELEASE` environment variable is set to `true`). The exact implementation of this can be found in [gradle/gitBranch.gradle.kts](gradle/gitBranch.gradle.kts).
if this property is not set the version string is a combination of the base version number defined in [kaluga-library-components/src/main/kotlin/Library](kaluga-library-components/src/main/kotlin/Library]), the current git branch (unless that branch is `master`, `main` or `develop`) and `-SNAPSHOT` (unless the `MAVEN_CENTRAL_RELEASE` environment variable is set to `true`). The exact implementation of this can be found in [kaluga-library-components/src/main/kotlin/GitBranch.kt](kaluga-library-components/src/main/kotlin/GitBranch.kt).

For example if the version in `ext.gradle` is `1.1` and `feature/123_fix_bug` is the current branch the resulting version will be `1.1-feature-123_fix_bug-SNAPSHOT`.
For example if the base version is `1.1` and `feature/123_fix_bug` is the current branch the resulting version will be `1.1-feature-123_fix_bug-SNAPSHOT`.

#### Local Testing

Before doing any publishing, make sure that changes are working with the one available in [Nexus Repository Manager](`oss.sonatype.org`).
Just adding the following code inside the `local.properties` file you can test both Android and iOS example app in `kaluga/example/ios/Supporting\ Files`.
Just adding the following code inside the `local.properties` file you can test both Android and iOS example app in `kaluga/example/`.
```
kaluga.exampleEmbeddingMethod=composite
kaluga.exampleMavenRepo=https://oss.sonatype.org/service/local/repositories/comsplendo-REPO_NUMBER/content/
kaluga.exampleEmbeddingMethod=repo
kaluga.exampleMavenRepo=https://oss.sonatype.org/service/local/repositories/comsplendo-REPO_NUMBER/
kaluga.libraryVersion=LIBRARY_VERSION
```
Where
`REPO_NUMBER` is the last one created after merging to master
`LIBRARY_VERSION` is the one that we want to publish
`REPO_NUMBER` is the id of the staging repository created to do the release (normally done automatically by GitHub Actions upon a `master` commit, the number can be found on the https://oss.sonatype.org console under "staging repositories")
`LIBRARY_VERSION` is the version of the library that we are publish

Don't forget to remove these when you are done.

#### Publishing locally

Expand All @@ -125,20 +127,22 @@ If these values are present as environment variables they will also be picked up

#### Publishing via CI

Bitrise automatically publishes every branch to the Sonatype snapshot repository (`https://oss.sonatype.org/content/repositories/snapshots/`). This is done using a (private) Bitrise project. A Maven Central release can be done by manually starting the `publisMavenCentralRelease` workflow for the appropriate release branch.
GitHub Actions automatically publishes every branch (except `master`) to the Sonatype snapshot repository (`https://oss.sonatype.org/content/repositories/snapshots/`). Commits on `master` are send to the Sonatype staging repository as the first step of a Maven Central release.

#### Releasing to Maven Central

Projects publishing to Sonatype's release repository need to be manually closed and released before they will appear on Maven Central. This can only be done by people with access.
Projects publishing to Sonatype's staging repository need to be manually closed and released (promoted) before they will appear on Maven Central. This can only be done by people with access to https://oss.sonatype.org.

#### Increase version after publishing

In case this has not been done yet, bump the version at [gradle/ext.gradle](gradle/ext.gradle) in the `develop` branch to start the next development iteration.
In case this has not been done yet, bump the base version at [kaluga-library-components/src/main/kotlin/Library](kaluga-library-components/src/main/kotlin/Library]) in the `develop` branch to start the next development iteration.

```sh
library_version = 'X.X.X'
```kotlin
private val baseVersion = "X.X.X"
```

Also update the version numbers in the README to the just released version and the next version.

## Code conventions

The project uses regular Kotlin code conventions. This includes not creating `com/splendo/kaluga` directories, since they are common to all other folders.
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2019 Splendo Consulting B.V. The Netherlands
Copyright 2022 Splendo Consulting B.V. The Netherlands

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 2a764d5

Please sign in to comment.