-
Notifications
You must be signed in to change notification settings - Fork 5
/
dependencies.gradle
83 lines (70 loc) · 2.01 KB
/
dependencies.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
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'
}
}
defaultTasks 'installMps'
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 {
mps
}
dependencies {
// MPS-related stuff declared as project properties
mps "org:${mpsBuildConfiguration}:${mpsBuildNumber}:${mpsBuildLabel}.tcbuildtag@zip"
}
task installMps(type: Copy) {
onlyIf {
! file('MPS_HOME').exists()
}
from zipTree(configurations.mps[0])
into 'MPS_HOME'
// Gradle woodoo for unzipping an archive
eachFile { FileCopyDetails fcp ->
// copy the contents of the directory named "MPS ${mpsRelease}"
if (fcp.relativePath.pathString.startsWith("MPS ${mpsRelease}/")) {
// remap the file to the root
def segments = fcp.relativePath.segments
def pathsegments = segments[1..-1] as String[]
fcp.relativePath = new RelativePath(!fcp.file.isDirectory(), pathsegments)
} else {
fcp.exclude()
}
// avoid overriding files
if (fcp.relativePath.getFile(destinationDir).exists()) {
it.exclude()
}
}
includeEmptyDirs = false
}
task deleteMps(type: Delete) {
delete 'MPS_HOME'
}