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