-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
152 lines (127 loc) · 4.55 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
plugins {
id 'org.xtext.xtend' version '3.0.2'
id 'org.xtext.builder' version '3.0.2'
id 'java'
id 'eclipse'
id 'maven'
id 'application'
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
maven { url "file:///${System.properties['user.home']}/artifacts/" }
maven { url "https://www.stat.ubc.ca/~bouchard/maven/" }
maven { url 'https://jitpack.io' }
mavenCentral()
jcenter()
}
xtend {
generator {
javaSourceLevel = 1.8
}
}
// warning: DSL v.4.0.8-4.1.x are broken. TODO: get rid of artifacts!
def blangVersion = '4.0.7' // Note to self: not the one that changes often!
dependencies {
xtextLanguages "com.github.UBC-Stat-ML.blangDSL:ca.ubc.stat.blang:${blangVersion}"
compile "com.github.UBC-Stat-ML:blangDSL:${blangVersion}"
compile group: 'org.eclipse.xtext', name: 'org.eclipse.xtext.xbase.lib', version: '2.24.0'
compile group: 'com.github.UBC-Stat-ML', name: 'inits', version: '3.4.1'
compile group: 'com.github.UBC-Stat-ML', name: 'bayonet', version: '4.1.13'
compile group: 'com.github.UBC-Stat-ML', name: 'binc', version: '2.0.5'
compile group: 'com.github.UBC-Stat-ML', name: 'xlinear', version: '2.4.1'
compile group: 'com.github.UBC-Stat-ML', name: 'pxviz', version: '1.2.1'
compile group: 'uk.com.robust-it', name: 'cloning', version: '1.9.6'
/* blang-standalone-compiler-directive - do not edit : ADD_SDK_DEPENDENCY */
}
xtext {
languages {
blang {
setup = 'ca.ubc.stat.blang.BlangDslStandaloneSetup'
fileExtension = 'bl'
generator.outlet.producesJava = true
generator.javaSourceLevel = '1.8'
}
}
}
mainClassName = "blang.runtime.internals.Main"
// Creates scripts for entry points
// Subproject must apply application plugin to be able to call this method.
def createScript(project, mainClass, name) {
project.tasks.create(name: name, type: CreateStartScripts) {
outputDir = new File(project.buildDir, 'scripts')
mainClassName = mainClass
applicationName = name
classpath = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files + project.configurations.runtime
}
project.tasks[name].dependsOn(project.jar)
project.applicationDistribution.with {
into("bin") {
from(project.tasks[name])
fileMode = 0755
}
}
}
// The next two lines disable the tasks for the primary main which by default
// generates a script with a name matching the project name.
// You can leave them enabled but if so you'll need to define mainClassName
// And you'll be creating your application scripts two different ways which
// could lead to confusion
startScripts.enabled = true
run.enabled = true
// Call this for each Main class you want to expose with an app script
createScript(project, 'blang.runtime.internals.DefaultPostProcessor', 'postprocess')
createScript(project, 'blang.runtime.internals.CreateBlangGradleProject', 'create-blang-gradle-project')
/* This exact task is used by the standalone compiler - do not remove or edit lightly! */
task printClasspath {
doLast {
configurations.testRuntime.each { println it }
}
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
//noinspection SpellCheckingInspection
tasks.withType(Javadoc) {
// disable the crazy super-strict doclint tool in Java 8
//noinspection SpellCheckingInspection
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
// Put before TRIM line otherwise large file gets generated
configurations.archives.with {
artifacts.remove artifacts.find { it.file =~ 'tar' }
artifacts.remove artifacts.find { it.file =~ 'zip' }
}
/* blang-standalone-compiler-directive - do not edit : TRIM */
/*
Things below the above line will NOT be included in the on-the-fly compilation used by the blang standalone command.
*/
/** Deployment information */
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file:///${System.properties['user.home']}/artifacts/")
snapshotRepository(url: "file:///${System.properties['user.home']}/artifacts/")
pom.version = "2.18.4" /* blang-standalone-compiler-directive - do not edit : EXTRACT_VERSION */
pom.artifactId = "blangSDK"
pom.groupId = "com.github.UBC-Stat-ML"
}
}
}
jar {
from { fileTree(dir: 'src/main/java', includes: [ '**/*.bl' ]) }
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}