-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
140 lines (116 loc) · 4.08 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
import de.itemis.mps.gradle.*
import java.time.LocalDate
import java.time.format.DateTimeFormatter
import java.time.format.FormatStyle
//will pull the groovy classes/types from nexus to the classpath
buildscript {
repositories {
mavenCentral()
maven { url 'https://artifacts.itemis.cloud/repository/maven-mps/' }
}
dependencies {
classpath 'de.itemis.mps:mps-gradle-plugin:1.18.356.90f1a8c'
}
}
plugins {
id 'base'
id 'maven-publish'
id "co.riiid.gradle" version "0.4.2"
}
def incrementalBuild = !project.hasProperty("disableIncrementalBuild")
def artifactsDir = new File(buildDir, 'artifacts')
configurations {
mps
languageLibs
junitAnt
}
dependencies {
mps "com.jetbrains:mps:2022.2.+"
languageLibs "com.mbeddr:platform:2022.2+"
junitAnt 'org.apache.ant:ant-junit:1.10.6'
}
repositories {
maven {
url "https://artifacts.itemis.cloud/repository/maven-mps/"
}
mavenCentral()
}
task resolveMps(type: Copy) {
dependsOn configurations.mps
from {
configurations.mps.resolve().collect { zipTree(it) }
}
into "$buildDir/mps"
}
task resolveAllLanguageLibs(type: Copy) {
from {
configurations.languageLibs.resolve().collect { zipTree(it) }
}
into "$buildDir/dependencies"
}
def javafxVersion = project.findProperty("javafxVersion")
def pluginVersion = project.findProperty("pluginVersion")
// Default arguments for ant scripts
def defaultScriptArgs = [
'mps.home' : resolveMps.destinationDir,
'javafx.home' : projectDir,
'javafx.version' : javafxVersion,
'plugin.version' : pluginVersion,
'build.dir' : buildDir,
'mps.generator.skipUnmodifiedModels': incrementalBuild
]
def defaultScriptClasspath = project.configurations.junitAnt.fileCollection { true }
// enables https://github.com/mbeddr/mps-gradle-plugin#providing-global-defaults
ext["itemis.mps.gradle.ant.defaultScriptArgs"] = defaultScriptArgs.collect { "-D$it.key=$it.value".toString() }
ext["itemis.mps.gradle.ant.defaultScriptClasspath"] = defaultScriptClasspath
task buildLanguages(type: BuildLanguages, dependsOn: [resolveMps, resolveAllLanguageLibs]) {
script "build.xml"
}
task packageLanguages(type: Zip, dependsOn: buildLanguages) {
archiveBaseName = 'plugin-${javafxVersion}-${pluginVersion}'
from "${artifactsDir}/JavaFX"
include 'JavaFX/**'
}
task setup {
dependsOn resolveAllLanguageLibs
description 'Set up MPS project libraries. Libraries are read in from projectlibraries.properties file.'
}
def releaseArtifacts = ["${artifactsDir}/JavaFX/plugin-${javafxVersion}-${pluginVersion}.zip"]
github {
owner = 'DSLFoundry'
repo = 'mps-javafx'
token = System.getenv().GITHUB_TOKEN != null ? System.getenv().GITHUB_TOKEN : "empty"
tagName = "v-$javafxVersion-$pluginVersion"
targetCommitish = System.getenv().CI_COMMIT_SHA != null ? System.getenv().CI_COMMIT_SHA : "master"
name = "JavaFX stubs v$javafxVersion (plugin v$pluginVersion)"
assets = releaseArtifacts
// body = ReleaseNotes.getReleaseNotes(file("RELEASE_NOTES.md"))
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/DSLFoundry/mps-javafx")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
groupId = 'com.dslfoundry.javafx'
artifactId = 'plugin'
version = "$javafxVersion-$pluginVersion"
artifacts = [packageLanguages]
pom {
name = "JavaFX stubs"
url = "https://github.com/DSLFoundry/mps-javafx"
}
}
}
}
build.dependsOn buildLanguages
githubRelease.dependsOn build
defaultTasks 'buildLanguages'
publish.dependsOn build