4ab4170fb368d580d3d506bcb50dee8c63100aac
[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.51'
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.9.1'
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 apply from: 'version.gradle'
59
60 task fatJar(type: Jar) {
61     archiveName = project.name + '-jar-with-dependencies.jar'
62     from { (configurations.runtime - configurations.provided).collect { it.isDirectory() ? it : zipTree(it) } }
63     manifest {
64         attributes('Plugin-Main-Class': 'net.pterodactylus.sone.main.SonePlugin')
65     }
66     with jar
67 }
68
69 javadoc {
70     options {
71         quiet()
72         showFromPrivate()
73         footer('© 2010–2013 David ‘Bombe’ Roden')
74         links('http://docs.oracle.com/javase/7/docs/api/')
75     }
76     failOnError = false
77 }
78
79 apply plugin: 'jacoco'
80
81 jacoco {
82     toolVersion = '0.7.9'
83 }
84
85 jacocoTestReport.dependsOn test
86
87 apply plugin: 'info.solidsoft.pitest'
88
89 pitest {
90     outputFormats = ['HTML', 'XML']
91     timestampedReports = false
92     timeoutFactor = 3.0
93 }
94
95 apply plugin: 'findbugs'
96
97 findbugs {
98     ignoreFailures = true
99 }
100
101 apply plugin: 'idea'
102
103 task countLinesMain(type: Exec) {
104     executable = 'cloc'
105     args = ['--by-file', '--xml', '--report-file=build/reports/cloc/main.xml', 'src/main']
106     standardOutput = new ByteArrayOutputStream()
107 }
108
109 task countLinesTest(type: Exec) {
110     executable = 'cloc'
111     args = ['--by-file', '--xml', '--report-file=build/reports/cloc/test.xml', 'src/test']
112     standardOutput = new ByteArrayOutputStream()
113 }
114
115 task countLines {
116     new File(buildDir, "reports/cloc").mkdirs()
117     dependsOn tasks.countLinesMain
118     dependsOn tasks.countLinesTest
119 }