-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
120 lines (99 loc) · 3.05 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
import de.itemis.mps.gradle.BuildLanguages
import de.itemis.mps.gradle.TestLanguages
import de.itemis.mps.gradle.GenerateLibrariesXml
import de.itemis.mps.gradle.RunAntScript
buildscript {
repositories {
maven { url 'https://projects.itemis.de/nexus/content/repositories/mbeddr' }
mavenCentral()
}
dependencies {
classpath 'de.itemis.mps:mps-gradle-plugin:1.0.85.03fbeda'
}
}
group "com.strumenta.formatsdsl"
description = "Formats DSL"
configurations {
mps
mpsArtifacts
mpsExtensions
jdk
ant_lib
libs
distribution
}
ext.mpsVersion = '2019.1.3'
ext.mpsExtensionsVersion = '2019.1.988.25746fd'
repositories {
mavenCentral()
maven {
url 'https://projects.itemis.de/nexus/content/groups/OS/'
}
}
dependencies {
ant_lib "org.apache.ant:ant-junit:1.10.1"
mps "com.jetbrains:mps:$mpsVersion"
mpsExtensions "de.itemis.mps:extensions:$mpsExtensionsVersion"
}
if (!hasProperty("jdk_home")) {
def java_home = System.properties['java.home']
def jdk_home = java_home
if (!file("$jdk_home/lib/tools.jar").isFile()) {
jdk_home = jdk_home + "/.."
}
if (!file("$jdk_home/lib/tools.jar").isFile()) {
throw new GradleException("Not finding the JDK...")
}
ext.jdk_home = jdk_home
}
ext.artifactsDir = new File(rootDir, 'artifacts')
ext.mpsDir = new File(artifactsDir, 'mps')
ext.buildScriptClasspath = project.configurations.ant_lib.fileCollection({
true
}) + project.files("$project.jdk_home/lib/tools.jar")
ext.antScriptArgs = [
"-Dmps.home=${mpsDir.getAbsolutePath()}",
"-Dartifacts.root=${artifactsDir.getAbsolutePath()}"
]
task resolveMps(type: Copy) {
from {
configurations.mps.resolve().collect { zipTree(it) }
}
into mpsDir
}
task resolveMpsArtifacts(type: Copy) {
from {
configurations.mpsArtifacts.resolve().collect { zipTree(it) }
}
into artifactsDir
}
task resolveMpsExtensions(type: Copy) {
dependsOn configurations.mpsExtensions
from {
configurations.mpsExtensions.resolve().collect { zipTree(it) }
}
into artifactsDir
}
task setuplocal {
dependsOn resolveMpsArtifacts
dependsOn resolveMpsExtensions
}
task generateBuildAntScripts(type: BuildLanguages, dependsOn: [resolveMps, resolveMpsArtifacts, resolveMpsExtensions]) {
scriptArgs = antScriptArgs
scriptClasspath = buildScriptClasspath
script new File('build-meta.xml')
}
task buildLanguages(type: BuildLanguages, dependsOn: [generateBuildAntScripts]) {
scriptArgs = antScriptArgs
scriptClasspath = buildScriptClasspath
script new File('build-languages.xml')
}
// ext.mbeddrPlatformVersion = '1.2.21553.14a910d'
// ext.iets3opensourceVersion = '0.2.3754.7f76cf6'
// dependencies {
// // ant_lib "org.apache.ant:ant-junit:1.10.1"
// // mps "com.jetbrains:mps:$mpsVersion"
// // mpsArtifacts "org.iets3:opensource:$iets3opensourceVersion"
// // distribution "com.jetbrains.jdk:jdk:8u152b1343.26:windows_x64@tgz"
// // distribution "com.jetbrains.jdk:jdk:8u152b1343.26:osx_x64@tgz"
// }