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

Modernize build #678

Merged
merged 47 commits into from Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
323a2b7
Update AGP to 7.0
ZacSweers Jan 10, 2023
979eb0a
Use lazy configureEach
ZacSweers Jan 13, 2023
59b874c
Update from deprecated with to using
ZacSweers Jan 13, 2023
c8740d4
Gradle 7.6
ZacSweers Jan 13, 2023
127b511
Add version catalog
ZacSweers Jan 13, 2023
6d523cf
Use version catalogs in buildSrc
ZacSweers Jan 13, 2023
6d7c581
Use version catalogs in gradle-plugin
ZacSweers Jan 13, 2023
4a8feec
Use version catalogs in root build files
ZacSweers Jan 13, 2023
3bbf7d5
Use version catalogs in generate_build_properties.gradle
ZacSweers Jan 13, 2023
2728b55
Modernize remaining subprojects
ZacSweers Jan 13, 2023
8cf69b0
Align multiplatform source sets with new kotlin 1.8.0 structure
ZacSweers Jan 13, 2023
36145bb
Merge branch 'main' into z/modernizeBuild
ZacSweers Jan 13, 2023
33487b1
Update sample target/compile SDKs
ZacSweers Jan 13, 2023
e8f45a6
Fix source set name
ZacSweers Jan 13, 2023
868d161
Don't impose any specific gradle plugins
ZacSweers Jan 13, 2023
0e1859f
Modernize another
ZacSweers Jan 13, 2023
27c6702
Bump AGP to 7.1.0
ZacSweers Jan 13, 2023
358dbca
Add missing decl
ZacSweers Jan 13, 2023
68a4e65
Update a couple deprecations
ZacSweers Jan 13, 2023
942a491
Add missing exported=true
ZacSweers Jan 13, 2023
e584697
Avoid a gradle warning about missing task deps
ZacSweers Jan 13, 2023
2d36a04
Put more in ext for prev scripts
ZacSweers Jan 13, 2023
32334cb
Update espresso to avoid missing exported activities issue
ZacSweers Jan 13, 2023
c9ea7fd
Make mpp play nice with jvm targets
ZacSweers Jan 13, 2023
448bf1d
Remove dependencies.gradle
ZacSweers Jan 13, 2023
a155931
Update CI
ZacSweers Jan 13, 2023
1b006d3
Update github actions
ZacSweers Jan 13, 2023
4cd0813
Fix env location
ZacSweers Jan 13, 2023
d485efc
Missing configs
ZacSweers Jan 13, 2023
4ca160f
Update benchmark gen
ZacSweers Jan 13, 2023
f0390c5
Update maven publishing
ZacSweers Jan 13, 2023
9c8d2b0
Use imports
ZacSweers Jan 13, 2023
0092d58
Add missing group + remove redundant repository
ZacSweers Jan 13, 2023
9000a06
Restore fullTestRun doc
ZacSweers Jan 26, 2023
d1cb249
Restore allWarningsAsErrors TODOs
ZacSweers Jan 26, 2023
655a45e
Add KGP dep change to changelog
ZacSweers Jan 26, 2023
aa8f871
startsWith
ZacSweers Jan 26, 2023
cb2bb29
Use import
ZacSweers Jan 26, 2023
310f051
Add min AGP version bump to changelog
ZacSweers Jan 26, 2023
2a353f2
Switch to using just system props
ZacSweers Jan 31, 2023
d4a3ea3
Remove anvil from toml
ZacSweers Feb 3, 2023
5c2aff3
Gradle 7.5.1
ZacSweers Feb 3, 2023
e3091bc
Add override example
ZacSweers Feb 3, 2023
045f870
Revert "Gradle 7.5.1"
ZacSweers Feb 3, 2023
ddb4e36
Update compare_size.sh
ZacSweers Feb 3, 2023
d24fdf5
Merge branch 'main' into z/modernizeBuild
ZacSweers Feb 3, 2023
1a00582
Fix CI
ZacSweers Feb 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
78 changes: 39 additions & 39 deletions .github/workflows/ci.yml
Expand Up @@ -22,18 +22,18 @@ jobs :
kotlin-version : [ 1.8.0 ]

steps :
- uses : actions/checkout@v2
- uses : actions/setup-java@v2
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'adopt'
java-version : '11'
check-latest : true

- name : Test on Ubuntu
run : ./gradlew assemble test -Psquare.useIR=false --no-build-cache --no-daemon --stacktrace -Psquare.kotlinVersion=${{ matrix.kotlin-version }}
run : ./gradlew assemble test --no-build-cache --no-daemon --stacktrace -Doverride_kotlin=${{ matrix.kotlin-version }} -Doverride_config-useIR=false

- name : Upload Test Results
uses : actions/upload-artifact@v2
uses : actions/upload-artifact@v3
if : ${{ failure() }}
with :
# Use the Kotlin version to prevent overrides.
Expand All @@ -50,18 +50,18 @@ jobs :
kotlin-version : [ 1.8.0 ]

steps :
- uses : actions/checkout@v2
- uses : actions/setup-java@v2
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : '11'
check-latest : true

- name : Test on Ubuntu
run : ./gradlew assemble test --no-build-cache --no-daemon --stacktrace -Psquare.kotlinVersion=${{ matrix.kotlin-version }}
run : ./gradlew assemble test --no-build-cache --no-daemon --stacktrace -Doverride_kotlin=${{ matrix.kotlin-version }}

- name : Upload Test Results
uses : actions/upload-artifact@v2
uses : actions/upload-artifact@v3
if : ${{ failure() }}
with :
name : test-results-${{ matrix.kotlin-version }}
Expand All @@ -73,8 +73,8 @@ jobs :
timeout-minutes : 25

steps :
- uses : actions/checkout@v2
- uses : actions/setup-java@v2
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : '11'
Expand All @@ -87,10 +87,10 @@ jobs :
# Expressions in Github actions are limited. If there would be an if expression, then we
# wouldn't need to duplicate the next step and depending on the OS enable / disable them.
- name : Test on Windows
run : ./gradlew.bat assemble test --no-build-cache --no-daemon --stacktrace "-Psquare.fullTestRun=false"
run : ./gradlew.bat assemble test --no-build-cache --no-daemon --stacktrace -Doverride_config-fullTestRun=false

- name : Upload Test Results
uses : actions/upload-artifact@v2
uses : actions/upload-artifact@v3
if : ${{ failure() }}
with :
name : test-results-windows
Expand All @@ -101,8 +101,8 @@ jobs :
timeout-minutes : 15

steps :
- uses : actions/checkout@v2
- uses : actions/setup-java@v2
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : '11'
Expand All @@ -116,8 +116,8 @@ jobs :
timeout-minutes : 15

steps :
- uses : actions/checkout@v2
- uses : actions/setup-java@v2
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : '11'
Expand All @@ -127,7 +127,7 @@ jobs :
run : ./gradlew lint --no-build-cache --no-daemon --stacktrace

- name : Upload Lint Results
uses : actions/upload-artifact@v2
uses : actions/upload-artifact@v3
if : ${{ failure() }}
with :
name : lint-results
Expand All @@ -138,8 +138,8 @@ jobs :
timeout-minutes : 15

steps :
- uses : actions/checkout@v2
- uses : actions/setup-java@v2
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : '11'
Expand All @@ -160,8 +160,8 @@ jobs :
- publish-maven-local

steps :
- uses : actions/checkout@v2
- uses : actions/setup-java@v2
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : '11'
Expand All @@ -188,21 +188,21 @@ jobs :
fail-fast : false
matrix :
kotlin-version : [ 1.8.0 ]
agp-version : [ 4.2.2, 7.0.4, 7.1.1, 7.2.0-beta01, 7.3.0-alpha01 ]
agp-version : [ 7.1.1, 7.2.0, 7.3.1 ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not good that changes like these are mixed in. The migration to a .toml file should have been separate from this. They're not related. Especially when everything is squashed in the end.


steps :
- uses : actions/checkout@v2
- uses : actions/setup-java@v2
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : '11'
check-latest : true

- name : Test Gradle Plugin
run : ./gradlew assemble test --no-build-cache --no-daemon --stacktrace -Psquare.kotlinVersion=${{ matrix.kotlin-version }} -Psquare.agpVersion=${{ matrix.agp-version }}
run : ./gradlew assemble test --no-build-cache --no-daemon --stacktrace -Doverride_kotlin=${{ matrix.kotlin-version }} -Doverride_agp=${{ matrix.agp-version }}

- name : Upload Test Results
uses : actions/upload-artifact@v2
uses : actions/upload-artifact@v3
if : ${{ failure() }}
with :
# Use the Kotlin version to prevent overrides.
Expand All @@ -218,8 +218,8 @@ jobs :
timeout-minutes : 15

steps :
- uses : actions/checkout@v2
- uses : actions/setup-java@v2
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : '11'
Expand All @@ -241,21 +241,21 @@ jobs :
kotlin-version : [ 1.8.0 ]

steps :
- uses : actions/checkout@v2
- uses : actions/setup-java@v2
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : '11'
check-latest : true

- name : Run integration tests
run : ./gradlew -p integration-tests test -Psquare.generateDaggerFactoriesWithAnvil=false --no-build-cache --no-daemon --stacktrace -Psquare.kotlinVersion=${{ matrix.kotlin-version }}
run : ./gradlew -p integration-tests test --no-build-cache --no-daemon --stacktrace -Doverride_kotlin=${{ matrix.kotlin-version }} -Doverride_config-generateDaggerFactoriesWithAnvil=false

- name : Build the sample
run : ./gradlew :sample:app:assembleDebug -Psquare.generateDaggerFactoriesWithAnvil=false --no-build-cache --no-daemon --stacktrace -Psquare.kotlinVersion=${{ matrix.kotlin-version }}
run : ./gradlew :sample:app:assembleDebug --no-build-cache --no-daemon --stacktrace -Doverride_kotlin=${{ matrix.kotlin-version }} -Doverride_config-generateDaggerFactoriesWithAnvil=false

- name : Upload Test Results
uses : actions/upload-artifact@v2
uses : actions/upload-artifact@v3
if : ${{ failure() }}
with :
# Use the Kotlin version to prevent overrides.
Expand All @@ -275,8 +275,8 @@ jobs :
#- 24
- 29
steps :
- uses : actions/checkout@v2
- uses : actions/setup-java@v2
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : '11'
Expand All @@ -291,7 +291,7 @@ jobs :
script : ./gradlew connectedCheck --no-build-cache --no-daemon --stacktrace

- name : Upload results
uses : actions/upload-artifact@v2
uses : actions/upload-artifact@v3
with :
name : insrumentation-test-results
path : ./**/build/reports/androidTests/connected/**
Expand All @@ -301,16 +301,16 @@ jobs :
runs-on : ubuntu-latest
timeout-minutes : 15
steps :
- uses : actions/checkout@v2
- uses : actions/checkout@v3
- uses : gradle/wrapper-validation-action@v1

build-benchmark-project :
runs-on : ubuntu-latest
timeout-minutes : 25

steps :
- uses : actions/checkout@v2
- uses : actions/setup-java@v2
- uses : actions/checkout@v3
- uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : '11'
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,9 @@

### Changed

- Raise minimum AGP version to 7.1.0.
- The Kotlin Gradle Plugin (both the core plugin and the API artifact) are no longer a dependency of the Anvil Gradle Plugin. Instead, it's now a `compileOnly` dependency, allowing the plugin to defer to whatever version the user already has. If you were accidentally depending on KGP through Anvil, you'll need to explicitly add the plugin yourself now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

### Deprecated

### Removed
Expand Down
6 changes: 4 additions & 2 deletions annotations/build.gradle
@@ -1,5 +1,7 @@
apply plugin: 'org.jetbrains.kotlin.jvm'
apply from: rootProject.file('publishing.gradle')
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.mavenPublish)
}

kotlin {
explicitApi()
Expand Down