Skip to content

Commit

Permalink
Improve quick check and Contribution guide
Browse files Browse the repository at this point in the history
  • Loading branch information
skuzzle committed Dec 21, 2023
1 parent 57e5527 commit 68cfce0
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 15 deletions.
17 changes: 14 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Contributions are highly appreciated!
# Contributing

**Contributions are highly appreciated!**

If you have any questions, feature requests or suspected bugs please do not hesitate to
open a new issue.
Expand All @@ -8,11 +10,20 @@ I don't want you to waste your time on changes that I might decline, so please o
issue before implementing any new feature and sending a pull request. I'm happy to
discuss your idea and give advice on how to best implement it.

If your idea is accepted, simply send the PR against the *development* branch.
If your idea is accepted, simply send the PR targetting the *development* branch.

## Local Development

### Building
For fast feedback during development you can run `./gradlew quickCheck` or its short-form `./gradlew qC`. This runs only fast unit tests as well as code style checks.

To run the full test suite use `./gradlew check`.

### Code Style
Note that code formatting is enforced by `spotless`. You can apply the configured
formatting rules to your changes by running `./gradlew spotlessApply`

## Local Development
### Build Scans
When building the project locally gradle will ask you whether you want to accept the TOS of the public
Build Scan service:
> Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service. Do you accept these terms? [yes, no]
Expand Down
1 change: 0 additions & 1 deletion build-logic/conventions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ repositories {

dependencies {
implementation(kotlin("gradle-plugin"))
implementation(libs.gradle.spotless)
implementation(libs.gradle.commonCustomUserData)
implementation(libs.gradle.enterprise)
implementation(libs.shadowPlugin)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import com.diffplug.gradle.spotless.SpotlessCheck

plugins {
id("build-logic.base")
id("java-library")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import com.diffplug.gradle.spotless.SpotlessCheck
import de.skuzzle.restrictimports.verifypublication.VerifyPublicationTask
import gradle.kotlin.dsl.accessors._516e34ac18c4e121e5f0f9bca9fd64a8.compileJava
import gradle.kotlin.dsl.accessors._516e34ac18c4e121e5f0f9bca9fd64a8.compileTestJava
import gradle.kotlin.dsl.accessors._516e34ac18c4e121e5f0f9bca9fd64a8.javadoc
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

tasks.named("quickCheck").configure {
dependsOn(
tasks.withType<VerifyPublicationTask>(),
tasks.withType<SpotlessCheck>(),
tasks.compileJava,
tasks.compileTestJava,
tasks.javadoc,
tasks.named("spotlessCheck"),
tasks.withType<JavaCompile>(),
tasks.withType<Javadoc>(),
tasks.withType<KotlinCompile>(),
tasks.withType<GroovyCompile>(),
tasks.named("test")
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ val verifyPublication by tasks.creating(VerifyPublicationTask::class.java) {
verificationRepoDir = extension.verificationRepoDir
artifacts = extension.artifacts
}
tasks.named("check").configure { dependsOn(verifyPublication) }
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ val publishEnforcerRuleTask =
val functionalTest by tasks.creating {
group = "verification"
}
val checkTask = tasks.named("check")

listOf(libs.versions.enforcerMin, libs.versions.enforcerMax)
.map { it.get() }
Expand All @@ -24,8 +25,11 @@ listOf(libs.versions.enforcerMin, libs.versions.enforcerMax)
group = "verification"
notCompatibleWithConfigurationCache("Inherently not")

functionalTest.dependsOn(this)
val mavenExecTask = this

functionalTest.dependsOn(mavenExecTask)
tasks.check.configure { dependsOn(mavenExecTask) }

with(publishEnforcerRuleTask) {
mavenExecTask.dependsOn(this)
mavenExecTask.inputs.files(this?.outputs)
Expand Down

0 comments on commit 68cfce0

Please sign in to comment.