Skip to content

Commit 3108256

Browse files
authored
Merge pull request NordicSemiconductor#371 from NordicSemiconductor/migration/kts
Migration to Kotlin Script
2 parents b12e2e8 + af5c872 commit 3108256

37 files changed

+318
-756
lines changed

.github/workflows/deploy-all.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
generateReadme:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
with:
1313
ref: main
1414
fetch-depth: 0
@@ -28,20 +28,19 @@ jobs:
2828
needs: generateReadme
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v3
3232
with:
3333
ref: main
3434
fetch-depth: 0
3535
- shell: bash
3636
env:
37-
# The following env variables are used by gradle/publish-module.gradle
37+
# The following env variables are used by Nexus plugin
3838
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
3939
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
40-
# The following env variables are used by gradle/publish-root.gradle
4140
OSSR_USERNAME: ${{ secrets.OSSR_USERNAME }}
4241
OSSR_PASSWORD: ${{ secrets.OSSR_PASSWORD }}
4342
SONATYPE_STATING_PROFILE_ID: ${{ secrets.SONATYPE_STATING_PROFILE_ID }}
44-
# The script generates sec.gpg file that is required by gradle/publish-module.gradle
43+
# The script generates sec.gpg file that is required by Nexus plugin
4544
# and starts :deployNexus lane using fastlane.
4645
run: |
4746
echo "${{ secrets.GPG_FILE }}" > sec.gpg.asc
@@ -50,7 +49,7 @@ jobs:
5049
deployInternal:
5150
runs-on: ubuntu-latest
5251
steps:
53-
- uses: actions/checkout@v2
52+
- uses: actions/checkout@v3
5453
with:
5554
fetch-depth: 0
5655
- shell: bash

.github/workflows/deploy-to-nexus.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@ jobs:
55
deployAarsToNexus:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
8+
- uses: actions/checkout@v3
99
with:
1010
fetch-depth: 0
1111
- shell: bash
1212
env:
13-
# The following env variables are used by gradle/publish-module.gradle
13+
# The following env variables are used by Nexus plugin
1414
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
1515
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
16-
# The following env variables are used by gradle/publish-root.gradle
1716
OSSR_USERNAME: ${{ secrets.OSSR_USERNAME }}
1817
OSSR_PASSWORD: ${{ secrets.OSSR_PASSWORD }}
1918
SONATYPE_STATING_PROFILE_ID: ${{ secrets.SONATYPE_STATING_PROFILE_ID }}
20-
# The script generates sec.gpg file that is required by gradle/publish-module.gradle
19+
# The script generates sec.gpg file that is required by Nexus plugin
2120
# and starts :deployNexus lane using fastlane.
2221
run: |
2322
echo "${{ secrets.GPG_FILE }}" > sec.gpg.asc

.github/workflows/deploy-to-play-store.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
deployInternal:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
8+
- uses: actions/checkout@v3
99
with:
1010
fetch-depth: 0
1111
- shell: bash

.github/workflows/generate-readme.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
generateReadme:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
8+
- uses: actions/checkout@v3
99
with:
1010
fetch-depth: 0
1111
- shell: bash

app/build.gradle

Lines changed: 0 additions & 74 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
plugins {
2+
// https://github.com/NordicSemiconductor/Android-Gradle-Plugins/blob/main/plugins/src/main/kotlin/AndroidApplicationComposeConventionPlugin.kt
3+
alias(libs.plugins.nordic.application.compose)
4+
// https://github.com/NordicSemiconductor/Android-Gradle-Plugins/blob/main/plugins/src/main/kotlin/AndroidHiltConventionPlugin.kt
5+
alias(libs.plugins.nordic.hilt)
6+
}
7+
8+
if (gradle.startParameter.taskRequests.toString().contains("Release")) {
9+
apply(plugin = "com.google.gms.google-services")
10+
apply(plugin = "com.google.firebase.crashlytics")
11+
}
12+
13+
android {
14+
namespace = "no.nordicsemi.android.dfu.app"
15+
defaultConfig {
16+
applicationId = "no.nordicsemi.android.dfu"
17+
resourceConfigurations.add("en")
18+
}
19+
}
20+
21+
dependencies {
22+
implementation(project(":lib:analytics"))
23+
implementation(project(":lib:storage")) // Deep link support
24+
implementation(project(":profile:navigation"))
25+
26+
implementation(libs.nordic.theme)
27+
implementation(libs.nordic.navigation)
28+
29+
implementation(libs.androidx.activity.compose)
30+
}

app/proguard-rules.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# By default, the flags in this file are appended to flags specified
33
# in C:/Users/alno/AppData/Local/Android/sdk/tools/proguard/proguard-android.txt
44
# You can edit the include path and order by changing the proguardFiles
5-
# directive in build.gradle.
5+
# directive in build.gradle.kts.
66
#
77
# For more details, see
88
# http://developer.android.com/guide/developing/tools/proguard.html

build.gradle

Lines changed: 0 additions & 48 deletions
This file was deleted.

build.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
plugins {
2+
alias(libs.plugins.android.application) apply false
3+
alias(libs.plugins.kotlin.kapt) apply false
4+
alias(libs.plugins.hilt) apply false
5+
6+
// Nordic plugins are defined in https://github.com/NordicSemiconductor/Android-Gradle-Plugins
7+
alias(libs.plugins.nordic.application) apply false
8+
alias(libs.plugins.nordic.application.compose) apply false
9+
alias(libs.plugins.nordic.library) apply false
10+
alias(libs.plugins.nordic.library.compose) apply false
11+
alias(libs.plugins.nordic.feature) apply false
12+
alias(libs.plugins.nordic.kotlin) apply false
13+
alias(libs.plugins.nordic.hilt) apply false
14+
alias(libs.plugins.nordic.nexus) apply false
15+
16+
id("com.google.gms.google-services") version "4.3.14" apply false
17+
id("com.google.firebase.crashlytics") version "2.9.2" apply false
18+
}

fastlane/Fastfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ platform :android do
1919

2020
desc "Deploy libraries to Nexus."
2121
lane :deployNexus do
22-
gradle(task: "publishToSonatype closeAndReleaseSonatypeStagingRepository")
22+
gradle(task: "publish")
2323
end
2424

2525
desc "Deploy a new version to the Google Play"

gradle.properties

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,4 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
4747
# https://developer.android.com/topic/libraries/support-library/androidx-rn
4848
android.useAndroidX=true
4949
# Kotlin code style for this project: "official" or "obsolete":
50-
kotlin.code.style=official
51-
52-
GROUP=no.nordicsemi.android
53-
54-
POM_DESCRIPTION=Device Firmware Update library for Android
55-
POM_URL=https://github.com/NordicSemiconductor/Android-DFU-Library
56-
POM_SCM_URL=https://github.com/NordicSemiconductor/Android-DFU-Library
57-
POM_SCM_CONNECTION=scm:[email protected]:NordicSemiconductor/Android-DFU-Library.git
58-
POM_SCM_DEV_CONNECTION=scm:[email protected]:NordicSemiconductor/Android-DFU-Library.git
59-
POM_LICENCE=BSD 3-Clause
60-
POM_LICENCE_NAME=The BSD 3-Clause License
61-
POM_LICENCE_URL=http://opensource.org/licenses/BSD-3-Clause
62-
POM_DEVELOPER_ID=philips77
63-
POM_DEVELOPER_NAME=Aleksander Nowakowski
64-
POM_DEVELOPER_EMAIL=[email protected]
50+
kotlin.code.style=official

gradle/git-tag-version.gradle

Lines changed: 0 additions & 27 deletions
This file was deleted.

gradle/publish-module.gradle

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)