-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
143 lines (119 loc) · 3.39 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
plugins {
id "application"
id 'java-library'
id 'eclipse'
id 'maven-publish'
id 'jacoco'
id 'signing'
id "com.gradleup.shadow" version "8.3.5"
}
project.group = 'de.hhu.stups'
project.version = "1.4.1-SNAPSHOT"
final isSnapshot = project.version.endsWith("-SNAPSHOT")
repositories {
mavenCentral()
if (isSnapshot) {
maven {
name "sonatype snapshots"
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
}
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
def parser_version = '2.13.6-SNAPSHOT'
dependencies {
implementation(group: 'commons-cli', name: 'commons-cli', version: '1.9.0')
api(group: 'de.hhu.stups', name: 'tlatools', version: '1.1.0')
api(group: 'de.hhu.stups', name: 'prologlib', version: parser_version)
api(group: 'de.hhu.stups', name: 'bparser', version: parser_version)
testImplementation(group: 'junit', name: 'junit', version: '4.13.2')
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
}
application {
mainClass = "de.tla2b.TLA2B"
}
jar {
manifest {
attributes([
"Main-Class": application.mainClass,
])
}
}
shadowJar {
archiveFileName = 'TLA2B.jar'
}
// Don't publish the shadowJar to Maven Central. Code from:
// https://github.com/johnrengelman/shadow/issues/586#issuecomment-708375599
// https://github.com/johnrengelman/shadow/issues/651#issuecomment-815921124
components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
skip()
}
processResources {
inputs.property("project.version", project.version)
filesMatching("de/tla2b/build.properties") {
expand(version: project.version)
}
}
jacoco {
toolVersion = "0.8.9"
reportsDirectory = file("$buildDir/customJacocoReportDir")
}
// type 'gradle tla2b jacocoIntegrationTestReport' in order to run the jacoco code coverage analysis
tasks.register('jacocoIntegrationTestReport', JacocoReport) {
sourceSets sourceSets.main
//executionData files('build/jacoco/integrationTests.exec')
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'TLA+ to B-AST'
description = "Translator from TLA+ to ProB's AST representation."
url = 'https://github.com/hhu-stups/tla2bAST'
licenses {
license {
name = 'Eclipse Public License, Version 1.0'
url = 'https://www.eclipse.org/legal/epl-v10.html'
}
}
scm {
connection = 'scm:git:https://github.com/hhu-stups/tla2bAST.git'
developerConnection = 'scm:git:[email protected]:hhu-stups/tla2bAST.git'
url = 'https://github.com/hhu-stups/tla2bAST'
}
developers {
developer {
id = 'bendisposto'
name = 'Jens Bendisposto'
email = '[email protected]'
}
}
}
}
}
repositories {
maven {
final releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
final snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url isSnapshot ? snapshotsRepoUrl : releasesRepoUrl
if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
credentials {
username project.ossrhUsername
password project.ossrhPassword
}
}
}
}
}
ext."signing.secretKeyRingFile" = rootProject.file("secring.gpg").absolutePath
signing {
sign publishing.publications.mavenJava
}