-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
executable file
·274 lines (246 loc) · 6.79 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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
version = '0.2.0'
buildscript {
repositories {
ivy { url '../repository' }
ivy { url 'http://unity-technologies.github.com/kaizen/repositories/unstable' }
mavenCentral()
}
dependencies {
classpath 'kaizen:kaizen:0.3.2'
}
}
allprojects {
apply plugin: 'vs2010'
}
/*
project(':CodeEditor.Text.UI.Unity.Editor') {
vs {
project {
postBuildEvent {
task ':updateUnityProject'
}
}
}
}
*/
vs {
solutions {
def frameworkProjects = [
':CodeEditor.Collections',
':CodeEditor.Composition',
':CodeEditor.ContentTypes',
':CodeEditor.IO',
':CodeEditor.IO.Unity.Editor',
':CodeEditor.Testing',
':CodeEditor.ServiceClient',
':CodeEditor.ServiceHost',
':CodeEditor.Reactive',
':CodeEditor.Logging',
]
def remaining = subprojects
def categorize = { condition ->
def result = remaining.findAll(condition)
remaining = remaining.minus(result)
result
}
def framework = categorize { p -> frameworkProjects.any({ p.path.startsWith(it) }) }
def monitoring = categorize { it.name.contains('Monitoring') }
def navigateTo = categorize { it.name.contains('NavigateTo') }
def language = categorize { it.name.contains('Languages') }
CodeEditor {
folder('Frameworks') { f ->
framework.each {
f.project(it.path)
}
}
folder('Features') { features ->
features.folder('NavigateTo') { f ->
navigateTo.each {
f.project(it.path)
}
}
features.folder('Monitoring') { f ->
monitoring.each {
f.project(it.path)
}
}
}
folder('Languages') { f ->
language.each {
f.project(it.path)
}
}
remaining.each {
project(it.path)
}
}
}
}
allprojects {
repositories {
ivy { url 'http://unity-technologies.github.com/kaizen/repositories/unstable' }
}
apply plugin: 'nuget'
}
configurations {
editor {
description "Configuration for editor extension artifacts."
}
tests {
description "Configuration for testing artifacts."
}
serviceHost {
description "Configuration for service artifacts."
}
}
apply plugin: 'assembly-bundle'
apply plugin: 'project-refactorings'
apply plugin: 'nunit'
apply plugin: 'idea'
def rxDependency(rxPackage, rxAssembly, rxConfiguration) {
['group': rxPackage, 'name': rxAssembly, 'version': '1.0.2856.0', 'configuration': rxConfiguration]
}
def serviceStack(assembly, pkg = 'ServiceStack') {
['group': pkg, 'name': assembly, 'version': '3.9.38', 'configuration': 'net35']
}
def unityAssembly(assembly) {
['group': 'Unity', 'name': assembly, version: '4.0+', configuration: 'editor']
}
ext {
rxCore = { assemblyName, configuration = 'Net35' -> rxDependency('Rx-Core-old', assemblyName, configuration) }
rxMain = { assemblyName, configuration = 'Net35' -> rxDependency('Rx-Main', assemblyName, configuration) }
references = [
'nunitFramework': "nunit:nunit.framework:${nunit.version}",
'moq': 'Moq:Moq:4.0+',
'adt': 'boo-extensions:Boo.Adt:0.1.3+',
'ometa': 'boo-extensions:Boo.OMeta:0.1.3+',
'boo': { assembly -> "boo:$assembly:0.9.7+" },
'unityEngine': unityAssembly('UnityEngine'),
'unityEditor': [
unityAssembly('UnityEngine'),
unityAssembly('UnityEditor')
],
'frameworks': [
project(':CodeEditor.IO'),
project(':CodeEditor.Logging'),
project(':CodeEditor.Composition'),
project(':CodeEditor.Reactive')
],
'languagesCommon': [
project(':CodeEditor.Composition'),
project(':CodeEditor.ContentTypes'),
project(':CodeEditor.Text.Data'),
project(':CodeEditor.Text.Logic'),
project(':CodeEditor.Text.UI'),
project(':CodeEditor.Languages.Common')
],
'rx35': [
rxMain('System.Reactive'),
rxCore('System.Observable'),
rxCore('System.CoreEx'),
rxCore('System.Threading'),
],
'rx40': [
rxMain('System.Reactive', 'Net4'),
rxCore('System.CoreEx', 'Net4'),
],
'serviceStack': [
serviceStack('ServiceStack'),
serviceStack('ServiceStack.ServiceInterface'),
serviceStack('ServiceStack.Common', 'ServiceStack.Common'),
serviceStack('ServiceStack.Interfaces', 'ServiceStack.Common'),
serviceStack('ServiceStack.Text', 'ServiceStack.Text')
],
'serviceStackInterfaces': [
serviceStack('ServiceStack.Interfaces', 'ServiceStack.Common'),
],
'serviceStackClient': [
serviceStack('ServiceStack.Interfaces', 'ServiceStack.Common'),
serviceStack('ServiceStack.Text', 'ServiceStack.Text'),
serviceStack('ServiceStack.Common', 'ServiceStack.Common')
],
]
}
def bundleDependency(configuration, subProject) {
dependencies.add(configuration, dependencies.project(path: subProject.path))
}
subprojects { subProject ->
switch (subProject.name) {
case ~/.+\.Tests$/:
apply plugin: 'nunit-assembly'
def subjectPath = subProject.path[0..-('.Tests'.length() + 1)]
dependencies {
// Foo.Bar.Tests depends on Foo.Bar
if (rootProject.findProject(subjectPath)) {
'default' project(subjectPath)
}
'default' project(':CodeEditor.Testing')
'default' rootProject.references.moq
}
bundleDependency('tests', subProject)
break
case ~/.+\.ServiceHost$/:
case ~/.+\.Services($|\..+)/:
bundleDependency('serviceHost', subProject)
break
case ~/.+\.(Testing|Fixtures)$/:
break
default:
bundleDependency('editor', subProject)
}
}
task publish {
dependsOn uploadEditor
project.configurations.editor.dependencies.each {
dependsOn ":$it.name:uploadDefault"
}
}
class UpdateDir extends DefaultTask {
def destinationDir
def setDestinationDir(destinationDir) {
this.destinationDir = project.file(destinationDir)
outputs.dir this.destinationDir
}
@TaskAction
def update() {
logger.info("Updating $destinationDir")
def destDir = destinationDir
inputs.sourceFiles.each { f ->
project.copy {
from project.zipTree(f)
into destDir
include '*.dll'
include '*.exe'
exclude 'UnityE*'
}
}
}
}
def unityProjectDir = project.properties.get('unityProjectDir', 'UnityProject')
def unityExecutable = project.hasProperty('unityExecutable') ?
project.property ('unityExecutable') :
rootProject.extensions.unity.executable
task updateUnityProjectEditorConfig(type: UpdateDir) {
description 'Builds and copies required assemblies to the configured Unity project (unityProjectDir)'
inputs.source project.configurations.editor
destinationDir = "$unityProjectDir/Assets/kaizen/lib/Editor"
}
task updateUnityProjectServiceHostConfig(type: UpdateDir) {
description 'Builds and copies required assemblies to the configured Unity project (unityProjectDir)'
inputs.source project.configurations.serviceHost
destinationDir = "$unityProjectDir/Library/CodeEditor/ServiceHost"
}
task updateUnityProject {
dependsOn updateUnityProjectEditorConfig
dependsOn updateUnityProjectServiceHostConfig
}
task open {
dependsOn updateUnityProject
doFirst {
project.exec {
executable unityExecutable
args '-projectPath'
args file(unityProjectDir)
}
}
}