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