-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
132 lines (109 loc) · 4.18 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
buildscript {
repositories { mavenCentral() }
dependencies {
// Gradle linter
classpath 'com.netflix.nebula:gradle-lint-plugin:latest.release'
}
}
plugins {
id 'java'
// IDE plugins
id 'eclipse'
id 'idea'
// JaCoCo plugin to measure KGP's coverage but not to calculate fault localization metric
id 'jacoco'
// Maven plugin to use JitPack
id 'maven-publish'
// Gradle lint
id "nebula.lint" version "16.9.0"
}
// Set compiler version
//sourceCompatibility = '1.11'
//targetCompatibility = '1.11'
// Set default encoding
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
// Configure gradle linter
gradleLint.rules = ['all-dependency'] // include all rules
gradleLint.alwaysRun = false
// Set group to use JitPack
group = 'com.github.kusumotolab'
// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
}
// In this section you declare the dependencies for your production and test code
dependencies {
// Use custom junit jar to terminate timed out process during apr loop
implementation files('src/main/resources/junit4/junit-4.12-kgp-custom.jar')
implementation 'args4j:args4j:2.33'
implementation 'ch.qos.logback:logback-classic:1.2.3'
implementation 'com.github.albfernandez:juniversalchardet:2.3.2'
implementation 'com.github.wumpz:diffutils:2.2'
implementation 'com.google.code.gson:gson:2.10'
implementation 'com.google.guava:guava:26.0-jre'
implementation 'commons-codec:commons-codec:1.11'
implementation 'io.gsonfire:gson-fire:1.8.5'
implementation 'io.reactivex.rxjava2:rxjava:2.2.4'
implementation 'org.apache.commons:commons-lang3:3.7'
implementation 'org.apache.maven:maven-model:3.5.4'
implementation 'org.codehaus.plexus:plexus-utils:3.1.0'
implementation 'org.eclipse.jdt:org.eclipse.jdt.core:3.13.102'
implementation 'org.eclipse.platform:org.eclipse.equinox.common:3.10.200'
implementation 'org.eclipse.platform:org.eclipse.text:3.8.0'
implementation 'org.jacoco:org.jacoco.core:0.8.1'
implementation 'org.slf4j:slf4j-api:1.7.25'
testImplementation 'org.assertj:assertj-core:3.23.1'
testImplementation 'org.mockito:mockito-core:4.10.0'
testImplementation 'com.google.jimfs:jimfs:1.1'
testImplementation 'com.github.stefanbirkner:system-rules:1.19.0'
testImplementation 'net.javacrumbs.json-unit:json-unit-assertj:2.36.0'
// Declare by "runtimeOnly" cuz hamcrest is necessary to execute junit-test dynamically,
// but it doesn't seem to be loaded on compile task.
runtimeOnly 'org.hamcrest:hamcrest-core:1.3'
// night-config:core is necessary to compile, and "toml" is necessary for runtime only.
implementation 'com.electronwill.night-config:core:3.4.0'
runtimeOnly 'com.electronwill.night-config:toml:3.4.0'
}
jar {
// Specify App's entry point
manifest.attributes "Main-Class": "jp.kusumotolab.kgenprog.CUILauncher"
// fatjar must include all dependencies
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
// exclude jar signatures for jar compression to avoid invalid signature
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
doFirst {
// copy gradle.properties to resolve version info
copy {
from 'gradle.properties'
into buildDir.name + '/resources/main/'
}
// annotate whether this task was executed on CI or not
def isCi = System.getenv('CI') ? 'true' : 'false'
File prop = new File(buildDir.name + '/resources/main/gradle.properties')
prop.append('ci = ' + isCi + '\n')
}
}
// Define App's version
version = currentVersion
task printCurrentVersion {
description 'Prints the current kGenProg version.'
doLast {
println version
}
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
html.enabled false
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: '**/*junit**')
}))
}
}