Skip to content

Commit 2ff5049

Browse files
authored
Merge pull request #37 from hotwired/build-gradle-kotlin
Convert build files to Kotlin DSL
2 parents 53efb9f + c9f37df commit 2ff5049

File tree

7 files changed

+212
-208
lines changed

7 files changed

+212
-208
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
## Requirements
1313

14-
1. Android SDK 26+ is required as the `minSdkVersion` in your build.gradle.
14+
1. Android SDK 26+ is required as the `minSdk` in your `build.gradle.kts` file.
1515
1. This library is written entirely in [Kotlin](https://kotlinlang.org/), and your app should use Kotlin as well. Compatibility with Java is not provided or supported.
1616
1. This library supports [Turbo Native](https://turbo.hotwired.dev/handbook/native) hybrid apps.
1717
1. Your web app must be running [strada-web](https://github.com/hotwired/strada-web). The `window.Strada` object is automatically exposed on the loaded WebView page, which enables `strada-android` to work.
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlinVersion = '1.9.10'
5-
64
repositories {
75
google()
86
mavenCentral()
97
}
108

119
dependencies {
12-
classpath 'com.android.tools.build:gradle:8.2.2'
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
10+
classpath("com.android.tools.build:gradle:8.2.2")
11+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10")
12+
classpath("org.jetbrains.kotlin:kotlin-serialization:1.9.10")
1413
}
1514
}
1615

@@ -21,6 +20,6 @@ allprojects {
2120
}
2221
}
2322

24-
task clean(type: Delete) {
25-
delete rootProject.buildDir
23+
tasks.register<Delete>("clean").configure {
24+
delete(rootProject.buildDir)
2625
}

docs/INSTALLATION.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Installation
22

33
## Gradle
4-
Add the dependency from Maven Central to your app module's (not top-level) `build.gradle` file:
4+
Add the dependency from Maven Central to your app module's (not top-level) `build.gradle.kts` file:
55

6-
```groovy
6+
```kotlin
77
dependencies {
8-
implementation 'dev.hotwire:strada:<latest-version>'
8+
implementation("dev.hotwire:strada:<latest-version>")
99
}
1010
```
1111

@@ -17,10 +17,13 @@ See the [latest version](https://search.maven.org/artifact/dev.hotwire/strada) a
1717

1818
## Required `minSdkVersion`
1919
Android SDK 26 (or greater) is required as the `minSdkVersion` in your app module's `build.gradle` file:
20-
```groovy
20+
```kotlin
21+
compileSdk = 34
22+
2123
defaultConfig {
22-
minSdkVersion 26
23-
...
24+
minSdk = 26
25+
targetSdk = 34
26+
// ...
2427
}
2528
```
2629

@@ -40,7 +43,7 @@ export GITHUB_ACCESS_TOKEN='<your personal access token>'
4043
## Gradle
4144
Add the GitHub Packages maven repository and the dependency to your app module's `build.gradle` file:
4245

43-
```groovy
46+
```kotlin
4447
repositories {
4548
maven {
4649
name = "GitHubPackages"
@@ -54,6 +57,6 @@ repositories {
5457
}
5558

5659
dependencies {
57-
implementation 'dev.hotwire:strada:<pre-release-version>'
60+
implementation("dev.hotwire:strada:<pre-release-version>")
5861
}
5962
```

strada/build.gradle

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

0 commit comments

Comments
 (0)