Skip to content

Commit

Permalink
Gradle 7 support (#225)
Browse files Browse the repository at this point in the history
* Update scalatest and remove old gradle plugin publish configuration we are about to replace

* Fix gradle 7 support

* Format code with the new scala fmt version

* Disable release for CI

* Remove invalid dependency

* Update docs
  • Loading branch information
pedrovgs authored May 18, 2021
1 parent 62c0b82 commit deb900d
Show file tree
Hide file tree
Showing 32 changed files with 529 additions and 474 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ jobs:
run: ./gradlew test
- name: Shot unit tests
run: ./gradlew :shot-android:connectedCheck
- name: Disable artifacts signing
run: echo "RELEASE_SIGNING_ENABLED=false" >> gradle.properties
- name: Build and install Shot
run: ./gradlew uploadArchives
run: ./gradlew publishToMavenLocal
- name: Execute screenshot tests for shot-consumer-compose
run: ./gradlew executeScreenshotTests
working-directory: shot-consumer-compose
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Modify your root ``build.gradle`` file:
// ...
dependencies {
// ...
classpath 'com.karumi:shot:5.10.4'
classpath 'com.karumi:shot:<LATEST_RELEASE>'
}
}
```
Expand Down Expand Up @@ -341,11 +341,12 @@ When talking about the IDE we should use, our recommendation is simple. We shoul
* Fork this repository and create a new branch where you'll develop the new feature or fix.
* Install IntelliJ and Android Studio.
* Import the root Gradle file configuration with IntelliJ. You will have to install the Scala plugin recommended by IntelliJ, but don't worry, as soon as you start IntelliJ you'll see a pop-up with the recommended plugin.
* Add ``RELEASE_SIGNING_ENABLED=false`` to your local properties to be able to install artifacts in your local maven repository without signing them.
* Develop the code you'd like to implement. Remember to add the unit/integration test coverage to the code you are working on.
* Execute the Gradle task ``./gradlew uploadArchives`` from the root folder in order to update your plugin local installation.
* Execute the Gradle task ``./gradlew publishToMavenLocal`` from the root folder in order to update your plugin local installation.
* Using Android Studio import ``shot-android`` or ``shot-consumer-flavors`` and write an example of the feature or fix you coded before. The example test you write will work as an end to end test.
* Commit and push the code. Our CI configuration will ensure everything is working as expected!
* Remember to execute ``./gradlew uploadArchives`` whenever you change the Gradle plugin code related in order to update your local repository and be able to use it from the consumers folder.
* Remember to execute ``./gradlew publishToMavenLocal`` whenever you change the Gradle plugin code related in order to update your local repository and be able to use it from the consumers folder.
* Once you are ready, send a PR. We will review it and help you to contribute to the official repository. Once everything is ready, we will merge it and release a new version.
In case you need to start an Android emulator you have scripts inside the consumers' folder you can execute to create the emulators you'll need to run the tests :smiley:
Expand All @@ -354,7 +355,7 @@ This is the list of most useful Gradle tasks you might need divided by type of p
* Plugin related tasks:
* ``./gradlew uploadArchives``: Install Shot in your local gradle repository.
* ``./gradlew publishToMavenLocal``: Install Shot in your local gradle repository.
* ``./gradlew test``: Execute all the tests related to the Gradle plugin.
* ``./gradlew scalafmtAll`: Review the Gradle Plugin's checkstyle.
Expand Down
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ buildscript {
ext.kotlin_version = "1.4.32"

dependencies {
classpath "gradle.plugin.com.github.maiflai:gradle-scalatest:0.29"
classpath "cz.alenkacz:gradle-scalafmt:1.14.0"
classpath "gradle.plugin.com.github.maiflai:gradle-scalatest:0.31"
classpath "gradle.plugin.cz.alenkacz:gradle-scalafmt:1.16.2"
classpath "com.android.tools.build:gradle:4.1.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jlleitschuh.gradle:ktlint-gradle:10.0.0"
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.15.1'
}
}
}
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'scala'
apply plugin: 'jacoco'
apply plugin: 'com.github.maiflai.scalatest'
apply plugin: 'scalafmt'
apply from: '../release.gradle'
apply plugin: "com.vanniktech.maven.publish"

repositories {
mavenCentral()
Expand Down
Loading

0 comments on commit deb900d

Please sign in to comment.