-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from NordicSemiconductor/kotlin2
Migration to Kotlin 2.0.0
- Loading branch information
Showing
25 changed files
with
269 additions
and
464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,9 @@ out/ | |
.gradle/ | ||
build/ | ||
|
||
# Kotlin | ||
.kotlin | ||
|
||
# Signing files | ||
.signing/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,88 @@ | ||
# Nordic Gradle Plugins for Android | ||
|
||
The repo contains plugins which are shared between Nordic's Android applications. | ||
[Now in Android app](https://github.com/android/nowinandroid) from Google has been an inspiration for writing Nordic's dedicated plugins. | ||
[Now in Android app](https://github.com/android/nowinandroid) from Google has been an inspiration | ||
for writing Nordic's dedicated plugins. | ||
|
||
## Plugins | ||
|
||
List of plugins currently available in the repository: | ||
List of plugins currently available in the repository. | ||
|
||
1. [no.nordicsemi.android.application](plugins/src/main/kotlin/AndroidApplicationConventionPlugin.kt) | ||
2. [no.nordicsemi.android.application.compose](plugins/src/main/kotlin/AndroidApplicationComposeConventionPlugin.kt) | ||
3. [no.nordicsemi.android.library](plugins/src/main/kotlin/AndroidLibraryConventionPlugin.kt) | ||
4. [no.nordicsemi.android.library.compose](plugins/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt) | ||
5. [no.nordicsemi.android.feature](plugins/src/main/kotlin/AndroidFeatureConventionPlugin.kt) | ||
6. [no.nordicsemi.android.kotlin](plugins/src/main/kotlin/AndroidKotlinConventionPlugin.kt) | ||
7. [no.nordicsemi.android.hilt](plugins/src/main/kotlin/AndroidHiltConventionPlugin.kt) | ||
8. [no.nordicsemi.android.gradle.nexus](plugins/src/main/kotlin/AndroidNexusRepositoryPlugin.kt) | ||
9. [no.nordicsemi.kotlin.gradle.nexus](plugins/src/main/kotlin/KotlinNexusRepositoryPlugin.kt) | ||
### Android plugins | ||
|
||
Plugins are released to Nexus repository and are available by their ids and version number. | ||
1. [no.nordicsemi.android.plugin.application](plugins/src/main/kotlin/AndroidApplicationConventionPlugin.kt) | ||
|
||
This plugin does the following: | ||
* applies `com.android.application`, | ||
* defines `compileSdk`, `minSdk` and `targetSdk` to values set in | ||
[`AppConsts`](https://github.com/NordicSemiconductor/Android-Gradle-Plugins/blob/kotlin2/plugins/src/main/kotlin/no/nordicsemi/android/AppConsts.kt), | ||
* sets `buildConfig`, | ||
* configures _debug_ and _release_ build types, | ||
* creates app signing configuration using `../keystore` file which is generated by GitHub actions during build. | ||
|
||
2. [no.nordicsemi.android.plugin.application.compose](plugins/src/main/kotlin/AndroidApplicationComposeConventionPlugin.kt) | ||
|
||
This plugin applies `no.nordicsemi.android.plugin.application` and adds Compose and Material3 dependency. | ||
|
||
Since version 2.1 [`enableStrongSkippingMode`](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compiler.html#enablestrongskippingmode) is | ||
[enabled](https://github.com/NordicSemiconductor/Android-Gradle-Plugins/blob/6ee70d9f2fb2c2c8474067845eac05308740afa8/plugins/src/main/kotlin/no/nordicsemi/android/buildlogic/AndroidCompose.kt#L66). | ||
|
||
3. [no.nordicsemi.android.plugin.library](plugins/src/main/kotlin/AndroidLibraryConventionPlugin.kt) | ||
|
||
This plugin does the following: | ||
* applies `com.android.library`, | ||
* defines `compileSdk` and `minSdk` to values set in | ||
[`AppConsts`](https://github.com/NordicSemiconductor/Android-Gradle-Plugins/blob/kotlin2/plugins/src/main/kotlin/no/nordicsemi/android/AppConsts.kt), | ||
* sets `buildConfig`, | ||
* configures _debug_ and _release_ build types. | ||
|
||
4. [no.nordicsemi.android.plugin.library.compose](plugins/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt) | ||
|
||
This plugin applies `no.nordicsemi.android.plugin.library` and adds Compose and Material3 dependency. | ||
|
||
Since version 2.1 [`enableStrongSkippingMode`](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compiler.html#enablestrongskippingmode) is | ||
[enabled](https://github.com/NordicSemiconductor/Android-Gradle-Plugins/blob/6ee70d9f2fb2c2c8474067845eac05308740afa8/plugins/src/main/kotlin/no/nordicsemi/android/buildlogic/AndroidCompose.kt#L66). | ||
|
||
5. [no.nordicsemi.android.plugin.kotlin](plugins/src/main/kotlin/AndroidNexusRepositoryPlugin.kt) | ||
|
||
This plugin applies `org.jetbrains.kotlin.android` and configures Kotlin compiler. | ||
|
||
7. [no.nordicsemi.android.plugin.hilt](plugins/src/main/kotlin/AndroidHiltConventionPlugin.kt) | ||
|
||
This plugin applies `no.nordicsemi.android.plugin.kotlin` and `org.jetbrains.kotlin.kapt` and | ||
configures [Hilt](https://dagger.dev/hilt/) for the module. | ||
|
||
9. [no.nordicsemi.android.plugin.feature](plugins/src/main/kotlin/AndroidFeatureConventionPlugin.kt) | ||
|
||
This plugin applies: | ||
* `no.nordicsemi.android.plugin.library.compose` | ||
* `no.nordicsemi.android.plugin.hilt` | ||
* `no.nordicsemi.android.plugin.kotlin` | ||
|
||
and adds dependency to `androidx.hilt.navigation.compose`. | ||
|
||
10. [no.nordicsemi.android.plugin.nexus](plugins/src/main/kotlin/AndroidKotlinConventionPlugin.kt) | ||
|
||
Creates `publish` and `releaseStagingRepositories` tasks using `maven-publish`. | ||
|
||
### JVM plugins | ||
|
||
1. [no.nordicsemi.jvm.plugin.kotlin](plugins/src/main/kotlin/JvmKotlinConventionPlugin.kt) (since 2.1) | ||
|
||
This plugin applies `org.jetbrains.kotlin.jvm` and configures Kotlin compiler. | ||
|
||
2. [no.nordicsemi.jvm.plugin.nexus](plugins/src/main/kotlin/JvmNexusRepositoryPlugin.kt) (since 2.0) | ||
|
||
Creates `publish` and `releaseStagingRepositories` tasks using `maven-publish`. | ||
|
||
Plugins are released to [Gradle Plugins](https://plugins.gradle.org/search?term=no.nordicsemi) repository | ||
and are available by their ids and version number. | ||
|
||
> [!Note] | ||
> Version 2.1 altered ids of the plugins by replacing `gradle` with `plugin`. | ||
## Version catalog | ||
|
||
The repository also contains Gradle Version Catalog which consumes [toml](gradle/libs.versions.toml) file. | ||
The file is automatically used by gradle to create libs reference in gradle.kts files because it is located in gradle directory. | ||
No additional set up is required. | ||
The file is automatically used by gradle to create libs reference in gradle.kts files because it | ||
is located in gradle directory. No additional set up is required. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.