-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.gradle
More file actions
149 lines (136 loc) · 7.16 KB
/
build.gradle
File metadata and controls
149 lines (136 loc) · 7.16 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
148
149
apply plugin: 'idea' // http://www.gradle.org/docs/current/userguide/idea_plugin.html
subprojects {
apply plugin: 'idea'
}
// http://www.gradle.org/docs/current/userguide/gradle_wrapper.html
task wrapper(type: Wrapper) {
gradleVersion = '1.6'
}
// Ensure the IWS Workspace file is also deleted (this is not the default)
task cleanIdea(dependsOn: [cleanIdeaProject, cleanIdeaWorkspace, cleanIdeaModule],
type: Delete,
overwrite: true,
description: 'Cleans IDEA project files (IML, IPR, IWS)',
group: 'IDE')
task clean(description: 'Deletes the build directory produced by Gradle and the out directory produced by IntelliJ IDEA.',
group: 'build') << {
delete "${buildDir}", 'out'
}
// Tell IntelliJ IDEA that the VCS for this project is Git
idea.project.ipr {
withXml { provider ->
provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git'
provider.node.component.find { it.@name == 'ProjectRootManager' }.@"assert-jdk-15" = 'true'
provider.node.component.find { it.@name == 'ProjectRootManager' }.@languageLevel = 'JDK_1_7'
}
}
def startServiceRunConfiguration = '''
<configuration default="false" name="Run Service" type="Application" factoryName="Application" singleton="true">
<option name="MAIN_CLASS_NAME" value="com.thoughtworks.learnangularjs.server.TomcatServer" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/service" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="service" />
<envs />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
'''
def clientUnitTestContinuousRunConfiguration = '''
<configuration default="false" name="Client Unit Tests (continuous)" type="NodeJSConfigurationType" factoryName="Node.js" singleton="true" path-to-node="/usr/local/bin/node" path-to-js-file="node_modules/karma/bin/karma" application-parameters="start support/unit.conf.js --no-single-run --reporters progress" working-dir="$PROJECT_DIR$/client" coffeescript-run="false">
<RunnerSettings RunnerId="NodeJS.run" />
<ConfigurationWrapper RunnerId="NodeJS.run" />
<method />
</configuration>
'''
def clientUnitTestOnceRunConfiguration = '''
<configuration default="false" name="Client Unit Tests (once)" type="NodeJSConfigurationType" factoryName="Node.js" singleton="true" path-to-node="/usr/local/bin/node" path-to-js-file="node_modules/karma/bin/karma" application-parameters="start support/unit.conf.js --single-run --reporters progress" working-dir="$PROJECT_DIR$/client" coffeescript-run="false">
<RunnerSettings RunnerId="NodeJS.run" />
<ConfigurationWrapper RunnerId="NodeJS.run" />
<method />
</configuration>
'''
def e2eTestRunConfiguration = '''
<configuration default="false" name="E2E Scenario Tests" type="NodeJSConfigurationType" factoryName="Node.js" singleton="true" path-to-node="/usr/local/bin/node" path-to-js-file="node_modules/karma/bin/karma" application-parameters="start support/e2e.conf.js --single-run --reporters progress" working-dir="$PROJECT_DIR$/client" coffeescript-run="false">
<RunnerSettings RunnerId="NodeJS.run" />
<ConfigurationWrapper RunnerId="NodeJS.run" />
<method />
</configuration>
'''
def startStubServiceRunConfiguration = '''
<configuration default="false" name="Run Stub Service" type="NodeJSConfigurationType" factoryName="Node.js" singleton="true" path-to-node="/usr/local/bin/node" path-to-js-file="stubservice.js" working-dir="$PROJECT_DIR$/stubservice" coffeescript-run="false">
<RunnerSettings RunnerId="NodeJS.run" />
<ConfigurationWrapper RunnerId="NodeJS.run" />
<method />
</configuration>
'''
def serviceUnitTestRunConfiguration = '''
<configuration default="false" name="Service Unit Tests" type="JUnit" factoryName="JUnit">
<module name="service" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="directory" />
<option name="VM_PARAMETERS" value="" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/service" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<dir value="$PROJECT_DIR$/service/src/test/java" />
<patterns />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
'''
def serviceIntegrationTestRunConfiguration = '''
<configuration default="false" name="Service Integration Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" runner="idea" />
<module name="service" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="directory" />
<option name="VM_PARAMETERS" value="" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/service" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<dir value="$PROJECT_DIR$/service/src/integration-test/java" />
<patterns />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
'''
idea.workspace.iws {
withXml { workspace ->
// Add run configurations
def runManagerComponentNode = workspace.node.component.find { it.@name == 'RunManager' }
runManagerComponentNode.append(new XmlParser().parseText(startServiceRunConfiguration))
runManagerComponentNode.append(new XmlParser().parseText(clientUnitTestContinuousRunConfiguration))
runManagerComponentNode.append(new XmlParser().parseText(clientUnitTestOnceRunConfiguration))
runManagerComponentNode.append(new XmlParser().parseText(e2eTestRunConfiguration))
runManagerComponentNode.append(new XmlParser().parseText(startStubServiceRunConfiguration))
runManagerComponentNode.append(new XmlParser().parseText(serviceUnitTestRunConfiguration))
runManagerComponentNode.append(new XmlParser().parseText(serviceIntegrationTestRunConfiguration))
}
}