Skip to content

Commit 91ed720

Browse files
committed
Add instructions for integration testing Spotless, locally and with JitPack. Although JitPack is broken until jitpack/jitpack.io#4112 gets resolved.
1 parent 228aa37 commit 91ed720

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

CONTRIBUTING.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,57 @@ The gist of it is that you will have to:
115115

116116
If you get something running, we'd love to host your plugin within this repo as a peer to `plugin-gradle` and `plugin-maven`.
117117

118+
## Integration testing
119+
120+
### Locally
121+
122+
First, run `./gradlew publishToMavenLocal` in your local checkout of Spotless. Now, in any other project on your machine, you can use the following snippet in your `settings.gradle` (for Gradle 6.0+).
123+
124+
```
125+
pluginManagement {
126+
repositories {
127+
mavenLocal {
128+
content {
129+
includeGroup 'com.diffplug.spotless'
130+
}
131+
}
132+
gradlePluginPortal()
133+
}
134+
resolutionStrategy {
135+
eachPlugin {
136+
if (requested.id.id == 'com.diffplug.gradle.spotless') {
137+
useModule('com.diffplug.spotless:spotless-plugin-gradle:{latest-SNAPSHOT}')
138+
}
139+
}
140+
}
141+
}
142+
```
143+
144+
### Any commit in a public GitHub repo (this one, or any fork)
145+
146+
In Gradle 6.0+, you can use the following snippet in your `settings.gradle`. TODO: broken until [jitpack/jitpack.io#4112](https://github.com/jitpack/jitpack.io/issues/4112) is resolved.
147+
148+
```gradle
149+
pluginManagement {
150+
repositories {
151+
maven {
152+
url 'https://jitpack.io'
153+
content {
154+
includeGroup 'com.github.{{user-or-org}}.spotless'
155+
}
156+
}
157+
gradlePluginPortal()
158+
}
159+
resolutionStrategy {
160+
eachPlugin {
161+
if (requested.id.id == 'com.diffplug.gradle.spotless') {
162+
useModule('com.github.{{user-or-org}}.spotless:spotless-plugin-gradle:SHA_OF_COMMIT_YOU_WANT')
163+
}
164+
}
165+
}
166+
}
167+
```
168+
118169
## License
119170

120171
By contributing your code, you agree to license your contribution under the terms of the APLv2: https://github.com/diffplug/spotless/blob/master/LICENSE.txt

0 commit comments

Comments
 (0)