Update jsr305 annotations package
[Sone.git] / build.gradle
1 group = 'net.pterodactylus'
2 version = '0.9.6'
3
4 buildscript {
5     repositories {
6         mavenCentral()
7     }
8     dependencies {
9         classpath group: 'info.solidsoft.gradle.pitest', name: 'gradle-pitest-plugin', version: '1.1.11'
10         classpath group: 'org.jetbrains.kotlin', name: 'kotlin-gradle-plugin', version: '1.1.4-3'
11     }
12 }
13
14 repositories {
15      maven { url "http://maven.pterodactylus.net/" }
16      mavenCentral()
17 }
18
19 apply plugin: 'java'
20
21 sourceCompatibility = 1.7
22 targetCompatibility = 1.7
23
24 tasks.withType(JavaCompile) {
25         options.encoding = 'UTF-8'
26 }
27
28 apply plugin: 'kotlin'
29
30 configurations {
31     provided {
32         dependencies.all { dep ->
33             configurations.default.exclude group: dep.group, module: dep.name
34         }
35     }
36     compile.extendsFrom provided
37 }
38  
39 dependencies {
40     provided group: 'org.freenetproject', name: 'fred', version: '0.7.5.1475'
41     provided group: 'org.freenetproject', name: 'freenet-ext', version: '29'
42     provided group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.54'
43
44     compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib'
45     compile group: 'net.pterodactylus', name: 'utils', version: '0.12.4'
46     compile group: 'com.google.inject', name: 'guice', version: '3.0'
47     compile group: 'com.google.guava', name: 'guava', version: '14.0.1'
48     compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.1.2'
49     compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
50     compile group: 'org.jsoup', name: 'jsoup', version: '1.10.2'
51
52     testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-test'
53     testCompile group: 'junit', name: 'junit', version: '4.11'
54     testCompile group: 'org.mockito', name: 'mockito-core', version: '2.1.0'
55     testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
56 }
57
58 task fatJar(type: Jar) {
59     archiveName = project.name + '-jar-with-dependencies.jar'
60     from { (configurations.runtime - configurations.provided).collect { it.isDirectory() ? it : zipTree(it) } }
61     manifest {
62         attributes('Plugin-Main-Class': 'net.pterodactylus.sone.main.SonePlugin')
63     }
64     with jar
65 }
66
67 javadoc {
68     options {
69         quiet()
70         showFromPrivate()
71         footer('© 2010–2013 David ‘Bombe’ Roden')
72         links('http://docs.oracle.com/javase/7/docs/api/')
73     }
74     failOnError = false
75 }
76
77 apply plugin: 'jacoco'
78
79 jacoco {
80     toolVersion = '0.7.9'
81 }
82
83 jacocoTestReport.dependsOn test
84
85 apply plugin: 'info.solidsoft.pitest'
86
87 pitest {
88     outputFormats = ['HTML', 'XML']
89     timestampedReports = false
90     timeoutFactor = 3.0
91 }
92
93 apply plugin: 'findbugs'
94
95 findbugs {
96     ignoreFailures = true
97 }
98
99 apply plugin: 'idea'
100
101 task countLinesMain(type: Exec) {
102     executable = 'cloc'
103     args = ['--by-file', '--xml', '--report-file=build/reports/cloc/main.xml', 'src/main']
104     standardOutput = new ByteArrayOutputStream()
105 }
106
107 task countLinesTest(type: Exec) {
108     executable = 'cloc'
109     args = ['--by-file', '--xml', '--report-file=build/reports/cloc/test.xml', 'src/test']
110     standardOutput = new ByteArrayOutputStream()
111 }
112
113 task countLines {
114     new File(buildDir, "reports/cloc").mkdirs()
115     dependsOn tasks.countLinesMain
116     dependsOn tasks.countLinesTest
117 }