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