-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
125 lines (103 loc) · 3.91 KB
/
build.gradle
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
plugins {
id 'java-gradle-plugin'
id 'com.gradle.plugin-publish' version "${gradlePluginPublishVersion}"
id 'idea'
id 'groovy'
id 'com.github.ben-manes.versions' version "${versionsPluginVersion}"
id 'net.researchgate.release' version "${versionIncrementPluginVersion}"
id 'codenarc'
}
wrapper {
gradleVersion = gradleWrapperVersion
}
group = 'gradle.plugin.com.mgd.core'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
}
jar {
manifest {
attributes([
'Manifest-Version': '1.0',
'Build-Tag': "${buildTag}"
])
}
}
repositories {
mavenCentral()
}
dependencies {
// see https://github.com/CodeNarc/CodeNarc/issues/757#issuecomment-1847224932
codenarc group: 'org.codehaus.groovy', name: 'groovy-all', version: groovyVersion
codenarc group: 'org.codenarc', name: 'CodeNarc', version: codeNarcVersion
implementation gradleApi()
implementation localGroovy()
api group: 'software.amazon.awssdk', name: 's3', version: amazonAwsSdkVersion
api group: 'software.amazon.awssdk', name: 's3-transfer-manager', version: amazonAwsSdkVersion
api group: 'software.amazon.awssdk.crt', name: 'aws-crt', version: amazonAwsSdkCrtVersion
testRuntimeOnly group:'org.junit.platform', name: 'junit-platform-launcher', version: jUnitTestLauncherVersion
testImplementation group: 'org.spockframework', name: 'spock-core', version: spockVersion
testImplementation group: 'org.assertj', name: 'assertj-core', version: assertJVersion
testImplementation group: 'org.testcontainers', name: 'spock', version: testContainersVersion
testImplementation group: 'org.testcontainers', name: 'localstack', version: testContainersVersion
}
gradlePlugin {
website = 'https://github.com/mygrocerydeals/gradle-s3-plugin/blob/master/README.md'
vcsUrl = 'https://github.com/mygrocerydeals/gradle-s3-plugin'
plugins {
s3Plugin {
id = 'com.mgd.core.gradle.s3'
displayName = 'Gradle S3 Plugin'
description = 'Gradle plugin for uploading and downloading to AWS S3 buckets. Supports files,' +
' directories and downloads using path pattern matching. Provides callback hooks to attach' +
' script actions to file events. Provides native support for third-party providers such as LocalStack.'
tags.set(['aws', 's3'])
implementationClass = 'com.mgd.core.gradle.S3Plugin'
}
}
}
Closure<Boolean> isNonStable = { String version ->
Boolean stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
String regex = /^[0-9,.v-]+((M\d-)?groovy-[0-9.]+)?(-r|-jre)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named('dependencyUpdates').configure {
checkForGradleUpdate = true
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
tasks.register('updateReadme') {
ant.replaceregexp(match: "id 'com.mgd.core.gradle.s3' version '\\d+\\.\\d+\\.\\d+'", replace: "id 'com.mgd.core.gradle.s3' version '${version}'",
flags: 'g', byline: true) {
fileset(dir: '.', includes: 'README.md')
}
}
// Groovy static analysis tool
codenarc {
toolVersion = codeNarcVersion
configFile = file("${rootProject.projectDir}/config/codenarc/rules.groovy")
reportFormat = 'html'
}
codenarcTest {
ignoreFailures = false
}
test {
useJUnitPlatform {}
}
// configuration for auto version increment plugin
release {
tagTemplate = 'v$version'
newVersionCommitMessage = '[skip ci] set version to: '
failOnCommitNeeded = false
failOnUnversionedFiles = false
git {
release.git.requireBranch.set('master')
}
}
// configuration for gradle enterprise plugin to publish build scan
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
// Gradle task dependencies
assemble.dependsOn updateReadme