-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into location-access
* main: (63 commits) Update to the latest gradle plugin Include Turbo Native Android in the user agent substring for backwards compatibilty with existing apps Change Turbo Native to Hotwire Native in user agent. Update HotwireNavigation.kt Remove old docs Update README.md Revert "Add repositories to each build script" Add repositories to each build script Disable the gradle configuration cache due to incompatibility with the signing plugin Add the signing plugin Add Sonatype (Maven Central) publishing support Readme updates Add publishing build script for the navigation-fragments module Remove Strada references Update demo site url Update android plugin dependencies Update CI workflow actions Update logo filename Update raster launcher icon Update vector launcher icon ... # Conflicts: # demo/src/main/kotlin/dev/hotwire/demo/features/web/WebFragment.kt
- Loading branch information
Showing
195 changed files
with
2,876 additions
and
3,088 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Publish to Sonatype | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
publish-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Publish artifact to Sonatype | ||
env: | ||
SONATYPE_USER: ${{ secrets.SONATYPE_USER }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | ||
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | ||
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | ||
run: ./gradlew -Psonatype -Pversion=${{ github.event.release.tag_name }} clean build -x test publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run lint | ||
run: ./gradlew core:lint | ||
|
||
- name: Run tests | ||
run: ./gradlew testRelease | ||
|
||
- name: Archive test results | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: test-results-report | ||
path: core/build/reports/tests/testReleaseUnitTest |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Contributing to Hotwire Native Android | ||
|
||
Note that we have a [code of conduct](/CODE_OF_CONDUCT.md). Please follow it in your interactions with this project. | ||
|
||
## Developing locally | ||
|
||
Hotwire Native for Android is built using Kotlin and Android SDK 28+ as its minimum version. To set up your development environment: | ||
|
||
1. Clone the repo | ||
1. Open the directory in the latest version of Android Studio | ||
|
||
To run the test suite: | ||
|
||
1. Open the directory in Terminal | ||
1. Run the `./gradlew testRelease` command | ||
|
||
## Sending a Pull Request | ||
|
||
The core team is monitoring for pull requests. We will review your pull request and either merge it, request changes to it, or close it with an explanation. | ||
|
||
Before submitting a pull request, please: | ||
|
||
1. Fork the repository and create your branch. | ||
2. Follow the setup instructions in this file. | ||
3. If you’re fixing a bug or adding code that should be tested, add tests! | ||
4. Ensure the test suite passes. | ||
|
||
## Feature parity with Android | ||
|
||
New features will not be merged until also added to [Hotwire Native iOS](https://github.com/hotwired/hotwire-native-ios). | ||
|
||
This does not apply to bugs that only appear on Android. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,11 @@ plugins { | |
id("org.jetbrains.kotlin.android") | ||
id("org.jetbrains.kotlin.plugin.serialization") | ||
id("maven-publish") | ||
id("signing") | ||
} | ||
|
||
val libVersionName by extra(version as String) | ||
val libraryName by extra("Hotwire Native for Android") | ||
val libraryName by extra("Hotwire Native for Android - Core") | ||
val libraryDescription by extra("Android framework for making Hotwire Native apps") | ||
|
||
val publishedGroupId by extra("dev.hotwire") | ||
|
@@ -21,15 +22,18 @@ val licenseUrl by extra("https://github.com/hotwired/hotwire-native-android/blob | |
val developerId by extra("basecamp") | ||
val developerEmail by extra("[email protected]") | ||
|
||
val isSonatypeRelease by extra(project.hasProperty("sonatype")) | ||
|
||
android { | ||
namespace = "dev.hotwire.core" | ||
compileSdk = 34 | ||
|
||
testOptions.unitTests.isIncludeAndroidResources = true | ||
testOptions.unitTests.isReturnDefaultValues = true | ||
testOptions.targetSdk = 34 | ||
|
||
defaultConfig { | ||
minSdk = 28 | ||
targetSdk = 34 | ||
} | ||
|
||
buildTypes { | ||
|
@@ -71,56 +75,73 @@ android { | |
|
||
dependencies { | ||
// Kotlin | ||
implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.22") | ||
implementation("org.jetbrains.kotlin:kotlin-reflect:1.9.23") | ||
|
||
// Material | ||
implementation("com.google.android.material:material:1.11.0") | ||
implementation("com.google.android.material:material:1.12.0") | ||
|
||
// AndroidX | ||
implementation("androidx.constraintlayout:constraintlayout:2.1.4") | ||
implementation("androidx.lifecycle:lifecycle-common:2.7.0") | ||
implementation("androidx.lifecycle:lifecycle-common:2.8.1") | ||
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") | ||
|
||
// JSON | ||
implementation("com.google.code.gson:gson:2.10.1") | ||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3") | ||
|
||
// Networking/API | ||
implementation("com.squareup.okhttp3:okhttp:4.11.0") | ||
implementation("com.squareup.okhttp3:logging-interceptor:4.11.0") | ||
implementation("com.squareup.okhttp3:okhttp:4.12.0") | ||
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") | ||
|
||
// Coroutines | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") | ||
|
||
// Browser | ||
implementation("androidx.browser:browser:1.7.0") | ||
|
||
// Exported AndroidX dependencies | ||
api("androidx.appcompat:appcompat:1.6.1") | ||
api("androidx.core:core-ktx:1.12.0") | ||
api("androidx.webkit:webkit:1.8.0") | ||
api("androidx.activity:activity-ktx:1.8.1") | ||
api("androidx.fragment:fragment-ktx:1.6.2") | ||
api("androidx.navigation:navigation-fragment-ktx:2.7.5") | ||
api("androidx.navigation:navigation-ui-ktx:2.7.5") | ||
api("androidx.appcompat:appcompat:1.7.0") | ||
api("androidx.core:core-ktx:1.13.1") | ||
api("androidx.webkit:webkit:1.11.0") | ||
|
||
// Tests | ||
testImplementation("androidx.test:core:1.5.0") // Robolectric | ||
testImplementation("androidx.navigation:navigation-testing:2.7.5") | ||
testImplementation("androidx.navigation:navigation-testing:2.7.7") | ||
testImplementation("androidx.arch.core:core-testing:2.2.0") | ||
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") | ||
testImplementation("org.assertj:assertj-core:3.24.2") | ||
testImplementation("org.robolectric:robolectric:4.11.1") | ||
testImplementation("org.mockito:mockito-core:5.2.0") | ||
testImplementation("org.assertj:assertj-core:3.25.3") | ||
testImplementation("org.robolectric:robolectric:4.12.1") | ||
testImplementation("org.mockito:mockito-core:5.11.0") | ||
testImplementation("com.nhaarman:mockito-kotlin:1.6.0") | ||
testImplementation("com.squareup.okhttp3:mockwebserver:4.11.0") | ||
testImplementation("com.squareup.okhttp3:mockwebserver:4.12.0") | ||
testImplementation("junit:junit:4.13.2") | ||
} | ||
|
||
tasks { | ||
// Only sign Sonatype release artifacts | ||
withType<Sign>().configureEach { | ||
onlyIf { isSonatypeRelease } | ||
} | ||
} | ||
|
||
// Sign Sonatype published release artifacts | ||
if (isSonatypeRelease) { | ||
signing { | ||
val keyId = System.getenv("GPG_KEY_ID") | ||
val secretKey = System.getenv("GPG_SECRET_KEY") | ||
val password = System.getenv("GPG_PASSWORD") | ||
|
||
useInMemoryPgpKeys(keyId, secretKey, password) | ||
|
||
setRequired({ gradle.taskGraph.hasTask("publish") }) | ||
sign(publishing.publications) | ||
} | ||
} | ||
|
||
// Publish to GitHub Packages via: | ||
// ./gradlew -Pversion=<version> clean build publish | ||
// https://github.com/orgs/hotwired/packages?repo_name=hotwire-native-android | ||
// Publish to Maven Central via: | ||
// ./gradlew -Psonatype -Pversion=<version> clean build publish | ||
// https://search.maven.org/artifact/dev.hotwire/core | ||
publishing { | ||
publications { | ||
register<MavenPublication>("release") { | ||
|
@@ -158,13 +179,24 @@ publishing { | |
} | ||
} | ||
repositories { | ||
maven { | ||
name = "GitHubPackages" | ||
url = uri("https://maven.pkg.github.com/hotwired/hotwire-native-android") | ||
if (isSonatypeRelease) { | ||
maven { | ||
url = uri("https://s01.oss.sonatype.org/content/repositories/releases/") | ||
|
||
credentials { | ||
username = System.getenv("GITHUB_ACTOR") | ||
password = System.getenv("GITHUB_TOKEN") | ||
credentials { | ||
username = System.getenv("SONATYPE_USER") | ||
password = System.getenv("SONATYPE_PASSWORD") | ||
} | ||
} | ||
} else { | ||
maven { | ||
name = "GitHubPackages" | ||
url = uri("https://maven.pkg.github.com/hotwired/hotwire-native-android") | ||
|
||
credentials { | ||
username = System.getenv("GITHUB_ACTOR") | ||
password = System.getenv("GITHUB_TOKEN") | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.