Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert build files to Kotlin DSL #37

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading