-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernize build infra + updated nullability from SDK (#74)
- Loading branch information
Showing
27 changed files
with
410 additions
and
366 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,53 @@ | ||
name: CI | ||
|
||
on: | ||
# Only run push on main | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**/*.md' | ||
# Always run on PRs | ||
pull_request: | ||
branches: [ main ] | ||
merge_group: | ||
|
||
concurrency: | ||
group: 'ci-${{ github.head_ref }}-${{ github.workflow }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Gradle Wrapper Validation | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
- name: Install JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '19' | ||
|
||
- name: Build and run tests | ||
id: gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: check | ||
gradle-home-cache-cleanup: true | ||
cache-read-only: false | ||
|
||
- name: (Fail-only) Upload build reports | ||
if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: reports | ||
path: | | ||
**/build/reports/** | ||
- name: Publish snapshot (main branch only) | ||
if: github.repository == 'inflationx/viewpump' && github.ref == 'refs/heads/main' | ||
run: ./gradlew publish -PmavenCentralUsername=${{ secrets.SONATYPEUSERNAME }} -PmavenCentralPassword=${{ secrets.SONATYPEPASSWORD }} --no-configuration-cache |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,55 +1,24 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
buildscript { | ||
repositories { | ||
maven { | ||
url "https://maven.google.com" | ||
content { | ||
includeGroupByRegex "com\\.android.*" | ||
includeGroupByRegex "androidx.*" | ||
} | ||
} | ||
maven { | ||
url "https://repo.maven.apache.org/maven2/" | ||
content { | ||
includeGroupByRegex "org\\.jetbrains.*" | ||
} | ||
} | ||
mavenCentral() | ||
jcenter() | ||
maven { | ||
// For maven publish plugin until 0.9.0 is released | ||
url "https://oss.sonatype.org/content/repositories/snapshots/" | ||
} | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:3.3.2' | ||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21' | ||
classpath 'org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.18' | ||
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.9.0-SNAPSHOT' | ||
} | ||
plugins { | ||
alias(libs.plugins.kotlin.jvm) apply false | ||
alias(libs.plugins.kotlin.android) apply false | ||
alias(libs.plugins.agp.application) apply false | ||
alias(libs.plugins.agp.library) apply false | ||
alias(libs.plugins.dokka) apply false | ||
alias(libs.plugins.mavenPublish) apply false | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
maven { | ||
url "https://maven.google.com" | ||
content { | ||
includeGroupByRegex "com\\.android.*" | ||
includeGroupByRegex "androidx.*" | ||
pluginManager.withPlugin("java") { | ||
java { | ||
toolchain { | ||
languageVersion.set( | ||
JavaLanguageVersion.of(libs.versions.jdk.get().removeSuffix("-ea").toInt()) | ||
) | ||
} | ||
} | ||
maven { | ||
url "https://repo.maven.apache.org/maven2/" | ||
content { | ||
includeGroupByRegex "org\\.jetbrains.*" | ||
includeGroupByRegex "com\\.jakewharton.*" | ||
includeGroupByRegex "com\\.squareup.*" | ||
includeGroupByRegex "junit.*" | ||
includeGroupByRegex "org\\.assertj.*" | ||
includeGroupByRegex "org\\.mockito.*" | ||
} | ||
|
||
tasks.withType(JavaCompile) { | ||
options.release = 8 | ||
} | ||
mavenCentral() | ||
jcenter() | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[versions] | ||
agp = "7.4.2" | ||
dokka = "1.8.10" | ||
jdk = "19" | ||
kotlin = "1.8.10" | ||
leakcanary = "2.10" | ||
mavenPublish = "0.25.1" | ||
|
||
[plugins] | ||
agp-application = { id = "com.android.application", version.ref = "agp" } | ||
agp-library = { id = "com.android.library", version.ref = "agp" } | ||
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } | ||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } | ||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } | ||
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" } | ||
|
||
[libraries] | ||
androidx-annotation="androidx.annotation:annotation:1.6.0" | ||
androidx-appcompat="androidx.appcompat:appcompat:1.6.1" | ||
androidx-test-runner="androidx.test:runner:1.5.2" | ||
assertj="org.assertj:assertj-core:3.24.2" | ||
junit="junit:junit:4.13.2" | ||
leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanary" } | ||
mockito="org.mockito:mockito-core:4.11.0" |
Binary file not shown.
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.