File tree Expand file tree Collapse file tree 5 files changed +31
-22
lines changed Expand file tree Collapse file tree 5 files changed +31
-22
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,9 @@ plugins {
5
5
id(" local.gwt-test" )
6
6
id(" local.maven-publish" )
7
7
8
- id(" net.ltgt.errorprone" ) version " 0.8"
9
- id(" com.diffplug.gradle.spotless" ) version " 3.23.0"
8
+ id(" net.ltgt.errorprone" ) version " 0.8.1"
9
+ id(" com.diffplug.gradle.spotless" ) version " 3.24.3"
10
+ id(" org.jlleitschuh.gradle.ktlint" ) version " 8.2.0"
10
11
id(" com.github.hierynomus.license" ) version " 0.15.0"
11
12
}
12
13
@@ -44,17 +45,19 @@ repositories {
44
45
45
46
allprojects {
46
47
apply (plugin = " com.diffplug.gradle.spotless" )
48
+ apply (plugin = " org.jlleitschuh.gradle.ktlint" )
47
49
48
50
spotless {
49
- kotlinGradle {
50
- ktlint(" 0.32.0" )
51
- }
52
51
java {
53
52
// local.gwt-test generates sources, we only want to check sources
54
53
targetExclude(fileTree(buildDir) { include(" **/*.java" ) })
55
54
googleJavaFormat(" 1.7" )
56
55
}
57
56
}
57
+ ktlint {
58
+ version.set(" 0.34.2" )
59
+ enableExperimentalRules.set(true )
60
+ }
58
61
}
59
62
60
63
/*
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ plugins {
2
2
`java- gradle- plugin`
3
3
`kotlin- dsl`
4
4
5
- id(" com.diffplug .gradle.spotless " ) version " 3.23 .0"
5
+ id(" org.jlleitschuh .gradle.ktlint " ) version " 8.2 .0"
6
6
}
7
7
repositories {
8
8
jcenter()
@@ -11,15 +11,15 @@ kotlinDslPluginOptions {
11
11
experimentalWarning.set(false )
12
12
}
13
13
14
- spotless {
15
- val ktlintVersion = " 0.32.0"
16
- kotlin {
17
- // for some reason, spotless includes *.kts but won't lint them as scripts
18
- targetExclude(" **/*.kts" )
19
- ktlint(ktlintVersion)
14
+ ktlint {
15
+ version.set(" 0.34.2" )
16
+ enableExperimentalRules.set(true )
17
+ kotlinScriptAdditionalPaths {
18
+ include(fileTree(" src/main/kotlin" ))
20
19
}
21
- kotlinGradle {
22
- target(" *.gradle.kts" , " src/main/kotlin/**/*.gradle.kts" )
23
- ktlint(ktlintVersion)
20
+ filter {
21
+ exclude() {
22
+ it.file in fileTree(buildDir)
23
+ }
24
24
}
25
25
}
Original file line number Diff line number Diff line change 1
1
package local
2
2
3
+ import javax.inject.Inject
3
4
import org.gradle.api.model.ObjectFactory
4
5
import org.gradle.kotlin.dsl.property
5
- import javax.inject.Inject
6
6
7
7
open class GwtTestExtension @Inject constructor(objects : ObjectFactory ) {
8
8
val moduleName = objects.property<String >()
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ val generateGwtTestSources by tasks.registering(Copy::class) {
14
14
if (it == " import junit.framework.TestCase;" ) {
15
15
" import com.google.gwt.junit.client.GWTTestCase;"
16
16
} else {
17
- it.replace(" extends TestCase {" , """ extends GWTTestCase {
17
+ it.replace(
18
+ " extends TestCase {" ,
19
+ """ extends GWTTestCase {
18
20
@Override
19
21
public String getModuleName() { return "${extension.moduleName.get()} "; }"""
20
22
)
Original file line number Diff line number Diff line change @@ -24,11 +24,15 @@ val sourcesJar by tasks.creating(Jar::class) {
24
24
25
25
val sonatypeRepository = publishing.repositories.maven {
26
26
name = " sonatype"
27
- setUrl(provider {
28
- if (isSnapshot)
29
- uri(" https://oss.sonatype.org/content/repositories/snapshots/" ) else
30
- uri(" https://oss.sonatype.org/service/local/staging/deploy/maven2/" )
31
- })
27
+ setUrl(
28
+ provider {
29
+ if (isSnapshot) {
30
+ uri(" https://oss.sonatype.org/content/repositories/snapshots/" )
31
+ } else {
32
+ uri(" https://oss.sonatype.org/service/local/staging/deploy/maven2/" )
33
+ }
34
+ }
35
+ )
32
36
credentials {
33
37
username = project.findProperty(" ossrhUsername" ) as ? String
34
38
password = project.findProperty(" ossrhPassword" ) as ? String
You can’t perform that action at this time.
0 commit comments