Skip to content

Commit

Permalink
Merge pull request #37 from hotwired/build-gradle-kotlin
Browse files Browse the repository at this point in the history
Convert build files to Kotlin DSL
  • Loading branch information
jayohms authored Feb 29, 2024
2 parents 53efb9f + c9f37df commit 2ff5049
Show file tree
Hide file tree
Showing 7 changed files with 212 additions and 208 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## Requirements

1. Android SDK 26+ is required as the `minSdkVersion` in your build.gradle.
1. Android SDK 26+ is required as the `minSdk` in your `build.gradle.kts` file.
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.
1. This library supports [Turbo Native](https://turbo.hotwired.dev/handbook/native) hybrid apps.
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.
Expand Down
11 changes: 5 additions & 6 deletions build.gradle → build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlinVersion = '1.9.10'

repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath("com.android.tools.build:gradle:8.2.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10")
classpath("org.jetbrains.kotlin:kotlin-serialization:1.9.10")
}
}

Expand All @@ -21,6 +20,6 @@ allprojects {
}
}

task clean(type: Delete) {
delete rootProject.buildDir
tasks.register<Delete>("clean").configure {
delete(rootProject.buildDir)
}
19 changes: 11 additions & 8 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Installation

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

```groovy
```kotlin
dependencies {
implementation 'dev.hotwire:strada:<latest-version>'
implementation("dev.hotwire:strada:<latest-version>")
}
```

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

## Required `minSdkVersion`
Android SDK 26 (or greater) is required as the `minSdkVersion` in your app module's `build.gradle` file:
```groovy
```kotlin
compileSdk = 34

defaultConfig {
minSdkVersion 26
...
minSdk = 26
targetSdk = 34
// ...
}
```

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

```groovy
```kotlin
repositories {
maven {
name = "GitHubPackages"
Expand All @@ -54,6 +57,6 @@ repositories {
}

dependencies {
implementation 'dev.hotwire:strada:<pre-release-version>'
implementation("dev.hotwire:strada:<pre-release-version>")
}
```
192 changes: 0 additions & 192 deletions strada/build.gradle

This file was deleted.

Loading

0 comments on commit 2ff5049

Please sign in to comment.