Skip to content

Commit 872b323

Browse files
authored
Merge pull request #337 from hannesa2/kts
Move from gradle to Kts
2 parents 93a94bc + b2bf2b5 commit 872b323

11 files changed

Lines changed: 81 additions & 60 deletions

File tree

.github/workflows/Android-CI-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
name: Publish release
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v6
13+
- uses: actions/checkout@v6
1514
with:
1615
fetch-depth: 0
16+
submodules: true
1717
- name: Install JDK ${{ matrix.java_version }}
1818
uses: actions/setup-java@v5
1919
with:

.github/workflows/Android-CI.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ jobs:
3434
run: |
3535
sudo apt-get update && sudo apt-get install -y exiftool imagemagick xdg-utils libimage-exiftool-perl zsh jq xorg
3636
- uses: actions/checkout@v6
37+
with:
38+
fetch-depth: 0
39+
submodules: true
3740
- name: set up JDK
3841
uses: actions/setup-java@v5
3942
with:

.github/workflows/update-gradle-wrapper.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ jobs:
1010

1111
steps:
1212
- uses: actions/checkout@v6
13+
with:
14+
fetch-depth: 0
15+
submodules: true
1316
- name: Install JDK
1417
uses: actions/setup-java@v5
1518
with:

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "buildSrc"]
2+
path = buildSrc
3+
url = git@github.com:hannesa2/KotlinBuildSource.git

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies {
4242
implementation "androidx.legacy:legacy-support-v4:1.0.0"
4343
implementation "androidx.appcompat:appcompat:1.7.1"
4444
implementation "com.google.android.material:material:1.13.0"
45-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
45+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.3.10"
4646

4747
androidTestImplementation "androidx.test.ext:junit-ktx:1.2.1"
4848
androidTestUtil "androidx.test.services:test-services:1.6.0"

build.gradle renamed to build.gradle.kts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import org.gradle.internal.jvm.Jvm
22

33
buildscript {
4-
ext.kotlin_version = "2.3.20"
54
repositories {
65
google()
76
mavenCentral()
87
}
98

109
dependencies {
11-
classpath "com.android.tools.build:gradle:8.13.0"
12-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10+
classpath("com.android.tools.build:gradle:8.13.0")
11+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.10")
1312
}
1413
}
1514

16-
println "Gradle uses Java ${Jvm.current()}"
15+
println("Gradle uses Java ${Jvm.current()}")
1716

1817
allprojects {
1918
repositories {

buildSrc

Submodule buildSrc added at 17e5844

githubAppUpdate/build.gradle

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

githubAppUpdate/build.gradle.kts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
3+
plugins {
4+
id("com.android.library")
5+
id("kotlin-android")
6+
id("maven-publish")
7+
}
8+
9+
android {
10+
namespace = "info.hannes.github"
11+
compileSdk = 36
12+
defaultConfig {
13+
minSdk = 23
14+
}
15+
compileOptions {
16+
sourceCompatibility = JavaVersion.VERSION_17
17+
targetCompatibility = JavaVersion.VERSION_17
18+
}
19+
kotlin {
20+
compilerOptions {
21+
jvmTarget = JvmTarget.JVM_17
22+
}
23+
}
24+
publishing {
25+
singleVariant("release") {}
26+
}
27+
}
28+
29+
base {
30+
archivesName.set("githubAppUpdate")
31+
}
32+
33+
dependencies {
34+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.3.10")
35+
implementation("com.google.code.gson:gson:2.13.2")
36+
implementation("androidx.work:work-runtime-ktx:2.11.1")
37+
38+
implementation("com.squareup.retrofit2:retrofit:3.0.0")
39+
implementation("androidx.appcompat:appcompat:1.7.1")
40+
implementation("com.squareup.retrofit2:converter-gson:3.0.0")
41+
implementation("androidx.preference:preference-ktx:1.2.1")
42+
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2")
43+
api("androidx.lifecycle:lifecycle-runtime-ktx:2.10.0")
44+
implementation("com.squareup.okhttp3:logging-interceptor:5.3.2")
45+
}
46+
47+
afterEvaluate {
48+
publishing {
49+
publications {
50+
create<MavenPublication>("maven") {
51+
from(components["release"])
52+
pom {
53+
licenses {
54+
license {
55+
name = "Apache License Version 2.0"
56+
url = "https://github.com/hannesa2/githubAppUpdate/blob/master/LICENSE"
57+
}
58+
}
59+
}
60+
}
61+
}
62+
}
63+
}

settings.gradle

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

0 commit comments

Comments
 (0)