-
Notifications
You must be signed in to change notification settings - Fork 64
/
build.gradle
228 lines (193 loc) · 9.08 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
buildscript {
repositories {
jcenter()
//Provides cq-gradle-plugins and jackalope
maven {
url "http://dl.bintray.com/twcable/aem"
}
mavenLocal()
}
dependencies {
classpath "com.twcable.gradle:cq-gradle-plugins:${gradle_plugins_version}"
classpath "ws.antonov.gradle.plugins:gradle-plugin-protobuf:${protobuf_gradle_plugin_version}"
classpath "commons-io:commons-io:2.4"
}
}
plugins {
id "com.jfrog.bintray" version "1.3.1"
}
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'maven'
repositories {
jcenter()
//Provides cq-gradle-plugins and jackalope
maven {
url "http://dl.bintray.com/twcable/aem"
}
maven {
url "http://dl.bintray.com/twcable/osgi"
}
//Provides all Adobe AEM specific repos (like cq-workflow-console)
maven {
url "http://repo.adobe.com/nexus/content/groups/public"
}
// hack to allow getting to a working version of AEM 6.1 workflow-console jar
// without running afoul of licensing restrictions
flatDir { dirs rootProject.projectDir }
}
ext.vendor = 'Time Warner Cable - Converged Technology Group - CMS Team'
ext.organization = "Time Warner Cable"
ext.providerUrl = "https://www.timewarnercable.com"
ext.providerLink = "https://github.com/TWCable/grabbit"
apply plugin: 'groovy'
apply from: "${rootProject.projectDir}/gradle/dependencies.gradle"
apply from: "${rootProject.projectDir}/testutils/gradle/testing.gradle"
jar.manifest {
attributes 'Specification-Version': project.version
attributes 'Bundle-Vendor': project.vendor
attributes 'Implementation-Title': project.name
attributes 'Implementation-Version': project.version
attributes 'Implementation-Vendor': project.vendor
instruction 'Import-Package', 'org.joda.time; version="[2,3)"'
instruction 'Import-Package', 'org.joda.time.base; version="[2,3)"'
instruction 'Import-Package', 'org.joda.time.format; version="[2,3)"'
}
afterEvaluate {
if (project.hasProperty('sourceCompatibility')) {
project.sourceCompatibility = 1.7
}
if (project.hasProperty('targetCompatibility')) {
project.targetCompatibility = 1.7
}
if (project.hasProperty('bundleName')) {
jar.manifest {
attributes 'Bundle-Name': project.bundleName
attributes 'Bundle-SymbolicName': project.symbolicName
attributes 'Bundle-Description': project.bundleDescription
}
}
if(project.hasProperty('slingServers')) {
project.slingServers.retryWaitMs = 500
project.slingServers.maxWaitValidateBundlesMs = 90000
}
// http://forums.gradle.org/gradle/topics/classpath_order_generated_by_eclipse_plugin_causes_problems
if (project.plugins.hasPlugin('java')) {
project.eclipse.classpath.file.whenMerged { classpath ->
def projectRefs = classpath.entries.findAll { entry -> entry.kind == 'src' && entry.path.startsWith('/') }
//move the project references to the end of the list:
classpath.entries.removeAll(projectRefs)
classpath.entries.addAll(projectRefs)
}
}
}
idea.project.ipr {
withXml { provider ->
provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git'
def codeStyleNode = provider.node.component.find { it.@name == 'ProjectCodeStyleSettingsManager' }
if (codeStyleNode == null) {
codeStyleNode = provider.node.appendNode('component', [name: 'ProjectCodeStyleSettingsManager'])
}
codeStyleNode.replaceNode { node ->
component(name: 'ProjectCodeStyleSettingsManager') {
option(name: "PER_PROJECT_SETTINGS") {
value {
option(name: "OTHER_INDENT_OPTIONS") {
value {
option(name: "INDENT_SIZE", value: "4")
option(name: "CONTINUATION_INDENT_SIZE", value: "4")
option(name: "TAB_SIZE", value: "4")
option(name: "USE_TAB_CHARACTER", value: "false")
option(name: "SMART_TABS", value: "false")
option(name: "LABEL_INDENT_SIZE", value: "0")
option(name: "LABEL_INDENT_ABSOLUTE", value: "false")
option(name: "USE_RELATIVE_INDENTS", value: "false")
}
}
option(name: "CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND", value: "9999")
option(name: "NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND", value: "9999")
XML {
option(name: "XML_LEGACY_SETTINGS_IMPORTED", value: "true")
}
// this is needed in addition to the one below, for import settings
GroovyCodeStyleSettings {
option(name: "CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND", value: "9999")
option(name: "NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND", value: "9999")
}
// oddly, both "JAVA" and "Java" are used...
['Groovy', 'JAVA', 'Java', 'Scala'].each {
codeStyleSettings(language: it) {
option(name: "CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND", value: "9999")
option(name: "NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND", value: "9999")
option(name: "BLANK_LINES_AROUND_METHOD", value: "2")
//option(name: "BLANK_LINES_BEFORE_METHOD_BODY", value: "1")
option(name: "ELSE_ON_NEW_LINE", value: "true")
option(name: "CATCH_ON_NEW_LINE", value: "true")
option(name: "FINALLY_ON_NEW_LINE", value: "true")
option(name: "SPACE_AFTER_TYPE_CAST", value: "false")
option(name: "INDENT_SIZE", value: "2")
option(name: "TAB_SIZE", value: "4")
// both this level and 'indentOptions' are used
option(name: "CONTINUATION_INDENT_SIZE", value: "4")
indentOptions {
option(name: "CONTINUATION_INDENT_SIZE", value: "4")
}
}
}
}
}
option(name: "USE_PER_PROJECT_SETTINGS0", value: "true")
}
}
}
}
apply from: "${rootProject.projectDir}/gradle/verifyComponentConfig.gradle"
apply from: "${rootProject.projectDir}/gradle/utils.gradle"
apply plugin: 'osgi'
apply plugin: 'scr'
apply plugin: 'sling-bundle'
apply plugin: 'protobuf'
// remove "mvn install" since it's not needed and causes a conflict
def installTask = tasks.findByPath('install')
if (installTask != null) tasks.remove(installTask)
apply from: "${rootProject.projectDir}/gradle/bundle.gradle"
apply from: "${rootProject.projectDir}/gradle/packageExclusions.gradle"
apply from: "${rootProject.projectDir}/gradle/idea.gradle"
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(bintrayUpload)) {
if (!project.hasProperty('bintray.user') || !project.hasProperty('bintray.key')) {
throw new IllegalArgumentException((String)"Please define 'bintray.user' and " +
"'bintray.key' properties. (Such as in ~/.gradle/gradle.properties)")
}
}
}
version = new com.twcable.grabbit.Version(version as String)
bintray {
user = project.properties['bintray.user']
key = project.properties['bintray.key']
filesSpec {
from tasks.getByPath('createPackage').archivePath
into '.'
}
publish = version.status == 'release'
pkg {
userOrg = 'twcable'
repo = 'aem'
name = 'Grabbit'
desc = 'The purpose of this project is to provide a reliable and fast solution for copying content from a Source to Destination. Source and destination can be any AEM instances.'
websiteUrl = 'https://github.com/TWCable/grabbit'
issueTrackerUrl = 'https://github.com/TWCable/grabbit/issues'
vcsUrl = 'https://github.com/TWCable/grabbit.git'
licenses = ['Apache-2.0']
labels = ['AEM', 'CQ', 'Content Copy', 'Data Migration']
attributes = ['plat': ['aem', 'cq']]
publicDownloadNumbers = true
//noinspection GroovyAssignabilityCheck
version {
//noinspection GrReassignedInClosureLocalVar
name = project.version.bintrayVersion
vcsTag = 'v' + project.version
}
}
}
bintrayUpload.dependsOn('createPackage')