🎨 🔊 log string leading to exception
[Sone.git] / build.gradle
1 import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2
3 plugins {
4     id 'org.jetbrains.kotlin.jvm' version '1.3.72'
5     id 'org.jetbrains.kotlin.plugin.noarg' version '1.3.72'
6     id 'info.solidsoft.pitest' version '1.4.5'
7 }
8
9 group = 'net.pterodactylus'
10 version = '82'
11
12 repositories {
13      mavenCentral()
14      maven { url "https://maven.pterodactylus.net/" }
15 }
16
17 apply plugin: 'java'
18
19 sourceCompatibility = 1.8
20 targetCompatibility = 1.8
21
22 tasks.withType(JavaCompile) {
23         options.encoding = 'UTF-8'
24 }
25
26 tasks.withType(KotlinCompile) {
27     kotlinOptions {
28         jvmTarget = "1.8"
29         freeCompilerArgs += '-Xjvm-default=enable'
30     }
31 }
32
33 configurations {
34     provided {
35         dependencies.all { dep ->
36             configurations.default.exclude group: dep.group, module: dep.name
37         }
38     }
39     compile.extendsFrom provided
40 }
41
42 dependencies {
43     provided group: 'org.freenetproject', name: 'fred', version: '0.7.5.1475'
44     provided group: 'org.freenetproject', name: 'freenet-ext', version: '29'
45     provided group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.54'
46
47     compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8'
48     compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.3.0-RC'
49
50     compile group: 'net.pterodactylus', name: 'utils', version: '0.13.1'
51     compile group: 'com.google.inject', name: 'guice', version: '4.2.2'
52     compile group: 'com.google.guava', name: 'guava', version: '27.0.1-jre'
53     compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.1'
54     compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.9.1'
55     compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
56     compile group: 'org.jsoup', name: 'jsoup', version: '1.10.2'
57     compile group: 'io.dropwizard.metrics', name: 'metrics-core', version: '4.1.0'
58     compile group: 'javax.activation', name: 'javax.activation-api', version: '1.2.0'
59
60     testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit'
61     testCompile group: 'junit', name: 'junit', version: '4.11'
62     testCompile group: 'org.mockito', name: 'mockito-core', version: '2.28.2'
63     testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
64 }
65
66 apply from: 'version.gradle'
67
68 task parallelTest(type: Test) {
69     maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
70     useJUnit {
71         excludeCategories 'net.pterodactylus.sone.test.NotParallel'
72     }
73 }
74
75 task notParallelTest(type: Test) {
76     maxParallelForks = 1
77     useJUnit {
78         includeCategories 'net.pterodactylus.sone.test.NotParallel'
79     }
80     dependsOn parallelTest
81 }
82
83 test {
84     exclude '**'
85     dependsOn parallelTest, notParallelTest
86 }
87
88 task fatJar(type: Jar) {
89     archiveFileName = project.name.toLowerCase() + '-jar-with-dependencies.jar'
90     from { (configurations.runtime - configurations.provided).collect { it.isDirectory() ? it : zipTree(it) } }
91     manifest {
92         attributes('Plugin-Main-Class': 'net.pterodactylus.sone.main.SonePlugin')
93     }
94     with jar
95 }
96
97 javadoc {
98     options {
99         quiet()
100         showFromPrivate()
101         footer('© 2010–2013 David â€˜Bombe’ Roden')
102         links('http://docs.oracle.com/javase/7/docs/api/')
103     }
104     failOnError = false
105 }
106
107 apply plugin: 'jacoco'
108
109 jacoco {
110     toolVersion = '0.8.4'
111 }
112
113 jacocoTestReport.dependsOn test
114
115 pitest {
116     pitestVersion = '1.4.10'
117     outputFormats = ['HTML', 'XML']
118     timestampedReports = false
119     timeoutFactor = 3.0
120 }
121
122 apply plugin: 'findbugs'
123
124 findbugs {
125     ignoreFailures = true
126 }
127
128 apply plugin: 'idea'
129
130 task countLinesMain(type: Exec) {
131     executable = 'cloc'
132     args = ['--by-file', '--xml', '--report-file=build/reports/cloc/main.xml', 'src/main']
133     standardOutput = new ByteArrayOutputStream()
134 }
135
136 task countLinesTest(type: Exec) {
137     executable = 'cloc'
138     args = ['--by-file', '--xml', '--report-file=build/reports/cloc/test.xml', 'src/test']
139     standardOutput = new ByteArrayOutputStream()
140 }
141
142 task countLines {
143     new File(buildDir, "reports/cloc").mkdirs()
144     dependsOn tasks.countLinesMain
145     dependsOn tasks.countLinesTest
146 }
147
148 noArg {
149     annotation('net.pterodactylus.sone.main.NoArg')
150 }