forked from classmethod/gradle-aws-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
176 lines (147 loc) · 5.2 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// -*- coding: utf-8; mode: groovy -*-
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2"
classpath "com.gradle.publish:plugin-publish-plugin:0.9.1"
classpath "com.diffplug.gradle.spotless:spotless:1.3.3"
}
}
apply plugin: "com.gradle.plugin-publish"
apply plugin: "com.diffplug.gradle.spotless"
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
defaultTasks "clean", "build"
// ======== deployment options (dispatched on group name) ========
group = "jp.classmethod.aws"
version = "0.30-SNAPSHOT"
sourceCompatibility = targetCompatibility = 1.8
ext {
artifactId = "gradle-aws-plugin"
defaultEncoding = "UTF-8"
}
// ======== spotless ========
spotless {
java {
licenseHeaderFile 'gradle/spotless.license.java'
importOrderFile 'gradle/spotless.importorder'
eclipseFormatFile 'gradle/spotless.eclipseformat.xml'
// Eclipse formatter screws up long literals with underscores inside of annotations (see issue #14)
// @Max(value = 9_999_999 L) // what Eclipse does
// @Max(value = 9_999_999L) // what I wish Eclipse did
custom 'Long literal fix', { it.replaceAll('([0-9_]+) [Ll]', '$1L') }
// Eclipse formatter puts excess whitespace after lambda blocks
// funcThatTakesLambdas(x -> {} , y -> {} ) // what Eclipse does
// funcThatTakesLambdas(x -> {}, y -> {}) // what I wish Eclipse did
custom 'Lambda fix', { it.replace('} )', '})').replace('} ,', '},') }
indentWithTabs()
endWithNewline()
customReplaceRegex 'Add space before comment asterisk', '^(\\t*)\\*', '$1 *'
// customReplaceRegex 'Remove indent before line comment', '^\\t*//', '//'
}
}
// ======== create source and javadoc bundles ========
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc"
from javadoc.destinationDir
}
javadoc {
failOnError = false
}
artifacts {
archives sourcesJar
archives javadocJar
}
configurations {
deployerJars
}
// ======== library versions ========
ext {
lombokVersion = "1.16.2"
awsJavaSdkVersion = "1.11.27"
groovyVersion = "2.3.7"
junitVersion = "4.12"
hamcrestVersion = "1.3"
mockitoCoreVersion = "1.9.5"
guavaVersion = "18.0"
sparWingsVersion = "0.16"
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
compile gradleApi()
compile "com.google.guava:guava:$guavaVersion"
compile "commons-io:commons-io:1.4"
compile "org.projectlombok:lombok:$lombokVersion"
compile "com.amazonaws:aws-java-sdk-sts:$awsJavaSdkVersion"
compile "com.amazonaws:aws-java-sdk-s3:$awsJavaSdkVersion"
compile "com.amazonaws:aws-java-sdk-ec2:$awsJavaSdkVersion"
compile "com.amazonaws:aws-java-sdk-rds:$awsJavaSdkVersion"
compile "com.amazonaws:aws-java-sdk-route53:$awsJavaSdkVersion"
compile "com.amazonaws:aws-java-sdk-elasticloadbalancing:$awsJavaSdkVersion"
compile "com.amazonaws:aws-java-sdk-elasticbeanstalk:$awsJavaSdkVersion"
compile "com.amazonaws:aws-java-sdk-cloudformation:$awsJavaSdkVersion"
compile "com.amazonaws:aws-java-sdk-lambda:$awsJavaSdkVersion"
compile "com.amazonaws:aws-java-sdk-iam:$awsJavaSdkVersion"
compile "com.amazonaws:aws-java-sdk-sqs:$awsJavaSdkVersion"
compile "com.amazonaws:aws-java-sdk-sns:$awsJavaSdkVersion"
compile "jp.xet.spar-wings:spar-wings-awscli-config:$sparWingsVersion"
// tests
testCompile "junit:junit:$junitVersion"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
testCompile "org.mockito:mockito-core:$mockitoCoreVersion"
deployerJars "org.springframework.build:aws-maven:4.7.0.RELEASE"
}
// ======== deploy artifacts ========
// Allows forks of the plugin to define their own deployment mechanisms
// in separate files named according to their maven group name
apply from: "deploy/${group}.gradle"
// ======== wrapper ========
task wrapper(type: Wrapper) {
gradleVersion = "2.5"
}
// ======== IDE ========
eclipse {
project {
buildCommand 'org.eclipse.jdt.core.javabuilder'
buildCommand 'org.springframework.ide.eclipse.core.springbuilder'
buildCommand 'net.sf.eclipsecs.core.CheckstyleNature'
buildCommand 'edu.umd.cs.findbugs.plugin.eclipse.findbugsNature'
natures 'org.eclipse.jdt.core.javanature',
'org.springsource.ide.eclipse.gradle.core.nature',
'org.springframework.ide.eclipse.core.springnature',
'net.sf.eclipsecs.core.CheckstyleBuilder',
'edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder'
}
classpath {
defaultOutputDir = file('build/classes')
containers = [
'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8',
'org.springsource.ide.eclipse.gradle.classpathcontainer' // Gradle IDE classpath container
]
file {
// exclude jar entries from .classpath
whenMerged { classpath ->
classpath.configure classpath.entries.grep { entry ->
!(entry instanceof org.gradle.plugins.ide.eclipse.model.Library)
}
classpath.entries.findAll {
it instanceof org.gradle.plugins.ide.eclipse.model.SourceFolder && it.path.startsWith("src/test/")
}*.output = "build/test-classes"
}
}
downloadSources = true
downloadJavadoc = true
}
}