1 import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
4 id 'org.jetbrains.kotlin.jvm' version '1.3.70'
5 id 'org.jetbrains.kotlin.plugin.noarg' version '1.3.70'
6 id 'info.solidsoft.pitest' version '1.4.5'
9 group = 'net.pterodactylus'
14 maven { url "https://maven.pterodactylus.net/" }
19 sourceCompatibility = 1.8
20 targetCompatibility = 1.8
22 tasks.withType(JavaCompile) {
23 options.encoding = 'UTF-8'
26 tasks.withType(KotlinCompile) {
34 dependencies.all { dep ->
35 configurations.default.exclude group: dep.group, module: dep.name
38 compile.extendsFrom provided
42 provided group: 'org.freenetproject', name: 'fred', version: '0.7.5.1475'
43 provided group: 'org.freenetproject', name: 'freenet-ext', version: '29'
44 provided group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.54'
46 compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8'
47 compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.3.0-RC'
49 compile group: 'net.pterodactylus', name: 'utils', version: '0.13.1'
50 compile group: 'com.google.inject', name: 'guice', version: '4.2.2'
51 compile group: 'com.google.guava', name: 'guava', version: '27.0.1-jre'
52 compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.1'
53 compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.9.1'
54 compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
55 compile group: 'org.jsoup', name: 'jsoup', version: '1.10.2'
56 compile group: 'io.dropwizard.metrics', name: 'metrics-core', version: '4.1.0'
57 compile group: 'javax.activation', name: 'javax.activation-api', version: '1.2.0'
59 testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit'
60 testCompile group: 'junit', name: 'junit', version: '4.11'
61 testCompile group: 'org.mockito', name: 'mockito-core', version: '2.28.2'
62 testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
65 apply from: 'version.gradle'
67 task parallelTest(type: Test) {
68 maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
70 excludeCategories 'net.pterodactylus.sone.test.NotParallel'
74 task notParallelTest(type: Test) {
77 includeCategories 'net.pterodactylus.sone.test.NotParallel'
79 dependsOn parallelTest
84 dependsOn parallelTest, notParallelTest
87 task fatJar(type: Jar) {
88 archiveFileName = project.name.toLowerCase() + '-jar-with-dependencies.jar'
89 from { (configurations.runtime - configurations.provided).collect { it.isDirectory() ? it : zipTree(it) } }
91 attributes('Plugin-Main-Class': 'net.pterodactylus.sone.main.SonePlugin')
100 footer('© 2010–2013 David ‘Bombe’ Roden')
101 links('http://docs.oracle.com/javase/7/docs/api/')
106 apply plugin: 'jacoco'
109 toolVersion = '0.8.4'
112 jacocoTestReport.dependsOn test
115 pitestVersion = '1.4.10'
116 outputFormats = ['HTML', 'XML']
117 timestampedReports = false
121 apply plugin: 'findbugs'
124 ignoreFailures = true
129 task countLinesMain(type: Exec) {
131 args = ['--by-file', '--xml', '--report-file=build/reports/cloc/main.xml', 'src/main']
132 standardOutput = new ByteArrayOutputStream()
135 task countLinesTest(type: Exec) {
137 args = ['--by-file', '--xml', '--report-file=build/reports/cloc/test.xml', 'src/test']
138 standardOutput = new ByteArrayOutputStream()
142 new File(buildDir, "reports/cloc").mkdirs()
143 dependsOn tasks.countLinesMain
144 dependsOn tasks.countLinesTest
148 annotation('net.pterodactylus.sone.main.NoArg')