This repository has been archived by the owner on Jun 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
173 lines (137 loc) · 4.92 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
169
170
171
172
173
// --------------- Plugins ---------------
buildscript {
// unfortunately we need to use the legacy buildscript block
// because the plugins {} DSL does not work when the plugin is compiled with a newer Java version
// (in this case, javafx-plugin is compiled against 11, while we want the build to work in 8)
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'org.openjfx:javafx-plugin:0.0.9'
}
}
plugins {
id 'java-library'
id 'antlr'
id 'maven-publish'
// https://plugins.gradle.org/plugin/com.palantir.revapi
id 'com.palantir.revapi' version '1.4.4'
// https://plugins.gradle.org/plugin/org.fulib.fulibGradle
id 'org.fulib.fulibGradle' version '0.5.0'
// https://plugins.gradle.org/plugin/com.bmuschko.nexus
id 'com.bmuschko.nexus' version '2.3.1'
// https://plugins.gradle.org/plugin/io.codearte.nexus-staging
id 'io.codearte.nexus-staging' version '0.22.0'
}
if (JavaVersion.current().java11Compatible) {
apply plugin: 'org.openjfx.javafxplugin'
}
// --------------- General Settings ---------------
group = 'org.fulib'
version = 'git describe --tags'.execute().text[1..-2] // strip v and \n
description = 'Fulib is a Java-code generating library.'
modifyPom {
project {
name = project.name
description = project.description
url = 'https://github.com/fujaba/fulib'
inceptionYear = '2018'
scm {
url = 'https://github.com/fujaba/fulib'
}
licenses {
license {
name = 'MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id = 'zuendorf'
name = 'Albert Zuendorf'
}
developer {
id = 'digitalhoax'
name = 'Tobias George'
}
developer {
id = 'eicke123'
name = 'Christoph Eickhoff'
}
developer {
id = 'Clashsoft'
name = 'Adrian Kunz'
}
}
}
}
// --------------- Dependencies ---------------
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
// https://mvnrepository.com/artifact/org.fulib/fulibScenarios
fulibScenarios group: 'org.fulib', name: 'fulibScenarios', version: '1.6.2'
// https://mvnrepository.com/artifact/org.antlr/antlr4
antlr group: 'org.antlr', name: 'antlr4', version: '4.9.1'
// https://mvnrepository.com/artifact/org.fulib/fulibYaml
api group: 'org.fulib', name: 'fulibYaml', version: '1.5.0'
// https://mvnrepository.com/artifact/org.antlr/ST4
implementation group: 'org.antlr', name: 'ST4', version: '4.3.1'
// https://mvnrepository.com/artifact/org.antlr/antlr4-runtime
implementation group: 'org.antlr', name: 'antlr4-runtime', version: '4.9.1'
// https://mvnrepository.com/artifact/org.hamcrest/hamcrest-library
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.2'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.7.1'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-params
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.7.1'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.1'
genCompile sourceSets.main.output + sourceSets.main.runtimeClasspath
// https://mvnrepository.com/artifact/org.fulib/fulibTools
genCompile group: 'org.fulib', name: 'fulibTools', version: '1.4.1'
}
if (JavaVersion.current().java11Compatible) {
javafx {
modules 'javafx.base'
configuration = 'testCompile'
}
}
// --------------- Misc. Settings ---------------
// Workaround for a circular dependency error.
// Now the task needs to be run manually.
compileJava.dependsOn = compileJava.dependsOn - 'generateScenarioSource'
generateScenarioSource.enabled = false
tasks.register('genModel', JavaExec) {
generateScenarioSource.copyTo(it)
}
test {
useJUnitPlatform()
testLogging.showStandardStreams = true
workingDir = temporaryDir
outputs.dir workingDir
doFirst {
workingDir.mkdirs()
}
}
revapi {
oldVersion = '1.4.1'
}
// --------------- ANTLR ---------------
def generatedANTLRDir = "$buildDir/generated/sources/antlr/main/"
sourceSets.main.java.srcDir(generatedANTLRDir)
// https://stackoverflow.com/questions/40995727/gradle-cant-find-antlr-token-file
generateGrammarSource {
def packageName = 'org.fulib.parser'
arguments += [ '-package', packageName ]
outputDirectory = file("$generatedANTLRDir/${ packageName.replace('.', '/') }/")
}
// https://github.com/gradle/gradle/issues/820
configurations.compile {
extendsFrom = extendsFrom.findAll { it != configurations.antlr }
}