-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
168 lines (144 loc) · 4.07 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
import groovy.xml.MarkupBuilder
import java.util.regex.*
import java.util.zip.*
import java.io.*
import com.jetbrains.plugin.blockmap.core.BlockMap
import com.jetbrains.plugin.blockmap.core.FileHash
import com.fasterxml.jackson.databind.ObjectMapper
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'org.jetbrains.intellij', name: 'blockmap', version: '1.0.5'
// https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind
classpath group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.3'
}
}
// In case gradle build fails to execute any of the tasks imported from
// buid.xml, try the following steps:
//
// 1. Uncomment the following section importing the task-tree plugin
// 2. Run `./gradlew assemble taskTree --no-repeat`
//
// If the above command generates suspiciously-looking output and never
// finishes, the most likely cause is that the target definitions in Ant
// build.xml file have cyclic dependencies. This needs to be fixed in build
// script, and build.xml regenerated.
// plugins {
// id "com.dorongold.task-tree" version "1.5"
// }
defaultTasks 'assemble'
allprojects {
apply plugin: 'java'
repositories {
mavenLocal()
mavenCentral()
}
// please no jars, no manifests, no build folders
jar { onlyIf { false } }
}
repositories {
ivy {
url 'https://teamcity.jetbrains.com/guestAuth/repository/download'
patternLayout {
ivy '[module]/[revision]/teamcity-ivy.xml'
artifact '[module]/[revision]/[revision].[ext]'
}
}
}
configurations {
junitAnt
}
dependencies {
// initialize JUnit optional ant task
junitAnt 'junit:junit:4.8.2'
junitAnt('org.apache.ant:ant-junit:1.9.2') {
transitive = false
}
}
def allInitDependencies = [
'coderules:solutions:jetbrains.mps.logic.reactor:copyDependencies',
'coderules:solutions:jetbrains.mps.logic.test:copyDependencies',
'coderules:solutions:jetbrains.mps.coderules.typechecking:copyDependencies',
'coderules:solutions:jetbrains.mps.coderules:copyDependencies' ]
task antProperties {
onlyIf{
buildNumber().find()
}
doLast {
ant.properties.'ci.build.num' = "${buildNumber().find() ? buildNumber()[0][4] : '9999'}".toString()
ant.properties.'ci.build.tag' = "${buildNumber().find() ? buildNumber()[0][4] : 'SNAPSHOT'}".toString()
ant.properties.'ci.mps.release' = "${buildNumber().find() ? buildNumber()[0][1] : '232'}".toString()
ant.properties.'mps.ant.log' = "debug"
}
}
task setup (dependsOn: [allInitDependencies, antProperties]) {
doLast {
println 'Initialized all dependencies.'
}
}
def buildNumber() {
System.env.BUILD_NUMBER =~ /MPS-([0-9]+)\.([0-9]+).([0-9]+)-([0-9]+)/
}
ant.importBuild('build.xml') { antTarget ->
'coderules-'+antTarget
}
// ensure 'setup' runs before 'fetchDependencies' and 'declare-mps-tasks'
'coderules-fetchDependencies' {
dependsOn {
'setup'
}
}
'coderules-declare-mps-tasks' {
dependsOn {
'setup'
}
}
// ensure 'generate' runs before 'classes' ('generate' is NOT optional)
'coderules-classes' {
dependsOn {
'coderules-generate'
}
mustRunAfter {
'coderules-generate'
}
}
'coderules-assemble' {
}
assemble {
dependsOn {
[
':coderules-assemble',
':samples:mpscore:mpscore-assemble',
':samples:lambdacalc:lambdacalc-assemble',
':samples:fitch:fitch-assemble'
]
}
}
clean {
dependsOn {
[
':coderules-clean', ':coderules-cleanSources',
':samples:mpscore:mpscore-clean', ':samples:mpscore:mpscore-cleanSources',
':samples:lambdacalc:lambdacalc-clean', ':samples:lambdacalc:lambdacalc-cleanSources',
':samples:fitch:fitch-clean', ':samples:fitch:fitch-cleanSources'
]
}
finalizedBy {
deleteMps
}
}
check {
dependsOn {
[
':samples:mpscore:mpscore-check',
':samples:lambdacalc:lambdacalc-check',
':samples:fitch:fitch-check'
]
}
// tests from this target also include model checker invocation, which requires everything to be built
finalizedBy {
':coderules-check'
}
}