-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
147 lines (128 loc) · 6.09 KB
/
build.gradle.kts
File metadata and controls
147 lines (128 loc) · 6.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import java.io.FileNotFoundException
plugins {
groovy
`java-gradle-plugin`
org.gradle.playframework.`test-setup`
org.gradle.playframework.`integration-test-fixtures`
org.gradle.playframework.`integration-test`
org.gradle.playframework.`user-guide`
org.gradle.playframework.`github-pages`
org.gradle.playframework.`documentation-test`
id("com.gradle.plugin-publish") version "1.2.1"
}
group = "org.gradle.playframework"
version = "0.16.0"
repositories {
mavenCentral()
}
dependencies {
testImplementation("org.spockframework:spock-core:2.0-groovy-3.0") {
exclude(group = "org.codehaus.groovy")
}
testImplementation("org.junit.platform:junit-platform-launcher")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
integTestFixturesImplementation("com.google.guava:guava:32.0.1-jre")
integTestFixturesImplementation("org.hamcrest:hamcrest-library:1.3")
integTestFixturesImplementation("org.apache.ant:ant:1.10.11")
integTestFixturesImplementation("org.freemarker:freemarker:2.3.30")
docTestImplementation("org.gradle.exemplar:samples-check:1.0.3")
docTestRuntimeOnly("org.slf4j:slf4j-simple:1.7.16")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
gradlePlugin {
testSourceSets(sourceSets.integTest.get(), sourceSets.docTest.get())
website = "https://gradle.github.io/playframework/"
vcsUrl = "https://github.com/gradle/playframework"
plugins {
register("play-twirl-plugin") {
id = "org.gradle.playframework-twirl"
displayName = "Play Twirl Plugin"
description = "Plugin for compiling Twirl sources in a Play application."
implementationClass = "org.gradle.playframework.plugins.PlayTwirlPlugin"
tags.set(listOf("playframework", "web", "java", "scala"))
}
register("play-routes-plugin") {
id = "org.gradle.playframework-routes"
displayName = "Play Routes Plugin"
description = "Plugin for compiling Play routes sources in a Play application."
implementationClass = "org.gradle.playframework.plugins.PlayRoutesPlugin"
tags.set(listOf("playframework", "web", "java", "scala"))
}
register("play-application-plugin") {
id = "org.gradle.playframework-application"
displayName = "Play Application Plugin"
description = "Plugin for building a Play application."
implementationClass = "org.gradle.playframework.plugins.PlayApplicationPlugin"
tags.set(listOf("playframework", "web", "java", "scala"))
}
register("play-javascript-plugin") {
id = "org.gradle.playframework-javascript"
displayName = "Play JavaScript Plugin"
description = "Plugin for adding JavaScript processing to a Play application."
implementationClass = "org.gradle.playframework.plugins.PlayJavaScriptPlugin"
tags.set(listOf("playframework", "web", "java", "scala"))
}
register("play-distribution-plugin") {
id = "org.gradle.playframework-distribution"
displayName = "Play Distribution Plugin"
description = "Plugin for generating distributions for Play applications."
implementationClass = "org.gradle.playframework.plugins.PlayDistributionPlugin"
tags.set(listOf("playframework", "web", "java", "scala"))
}
register("play-ide-plugin") {
id = "org.gradle.playframework-ide"
displayName = "Play IDE Plugin"
description = "Plugin for generating IDE project files for Play applications."
implementationClass = "org.gradle.playframework.plugins.PlayIdePlugin"
tags.set(listOf("playframework", "web", "java", "scala"))
}
register("play-plugin") {
id = "org.gradle.playframework"
displayName = "Play Plugin"
description = "Plugin that supports building, testing and running Play applications with Gradle."
implementationClass = "org.gradle.playframework.plugins.PlayPlugin"
tags.set(listOf("playframework", "web", "java", "scala"))
}
}
}
// Wire in the publishing credentials from the environment or as a project property
setFromEnvOrGradleProperty("gradle.publish.key", "GRADLE_PUBLISH_KEY")
setFromEnvOrGradleProperty("gradle.publish.secret", "GRADLE_PUBLISH_SECRET")
fun Project.setFromEnvOrGradleProperty(gradleProperty: String, environmentVariable: String) {
val envVar = providers.environmentVariable(environmentVariable)
val gradleProp = providers.gradleProperty(gradleProperty)
ext[gradleProperty] = envVar.orElse(gradleProp).getOrNull()
}
tasks.named<ProcessResources>("processIntegTestFixturesResources") {
duplicatesStrategy = DuplicatesStrategy.WARN
}
tasks.withType<Test>().configureEach {
if (name != "docTest") {
useJUnitPlatform() // required for Spock 2+, but Samples use JUnit 4 rule
}
}
val readReleaseNotes by tasks.registering {
description = "Ensure we've got some release notes handy"
doLast {
val releaseNotesFile = file("release-notes-$version.txt")
if (!releaseNotesFile.exists()) {
throw FileNotFoundException("Couldn't find release notes file ${releaseNotesFile.absolutePath}")
}
val releaseNotes = releaseNotesFile.readText().trim()
require(!releaseNotes.isBlank()) { "Release notes file ${releaseNotesFile.absolutePath} is empty" }
gradlePlugin.plugins["play-twirl-plugin"].description = releaseNotes
gradlePlugin.plugins["play-routes-plugin"].description = releaseNotes
gradlePlugin.plugins["play-application-plugin"].description = releaseNotes
gradlePlugin.plugins["play-javascript-plugin"].description = releaseNotes
gradlePlugin.plugins["play-distribution-plugin"].description = releaseNotes
gradlePlugin.plugins["play-ide-plugin"].description = releaseNotes
gradlePlugin.plugins["play-plugin"].description = releaseNotes
}
}
tasks.publishPlugins {
dependsOn(readReleaseNotes)
}